[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH][xeniface] Fix compiler options


  • To: <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Owen Smith <owen.smith@xxxxxxxxxx>
  • Date: Thu, 5 May 2022 08:03:27 +0100
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Owen Smith <owen.smith@xxxxxxxxxx>
  • Delivery-date: Thu, 05 May 2022 07:03:40 +0000
  • Ironport-data: A9a23:UjMZe6qGFY6FZslA6fzWKyiPOwheBmJJZRIvgKrLsJaIsI4StFCzt garIBnVPPfeMzOkL49+bom/9xwEsJ+DytMxTVE+qCw3E3kQ8ZuZCYyVIHmrMnLJJKUvbq7GA +byyDXkBJppJpMJjk71atANlVEliefQAOCU5NfsYkidfyc9IMsaoU8lyrdRbrJA24DjWVvQ4 Y6q+qUzBXf+s9JKGjNMg068gEsHUMTa4Fv0aXRnOJinFHeH/5UkJMp3yZOZdhMUcaENdgKOf M7RzanRw4/s10xF5uVJMFrMWhZirrb6ZWBig5fNMkSoqkAqSicais7XOBeAAKv+Zvrgc91Zk b1wWZKMpQgBLKf9p+gMYQJhLAJnIrwfo6KcfSb4vpnGp6HGWyOEL/RGCUg3OcsT+/ptAHEI/ vsdQNwPRknd3aTsmuv9E7QywJR4RCXoFNp3VnVIyi7UC7A9RJHfQ43B5MNC3Sd2jcdLdRrbT 5VBNWs/PE+YC/FJEnZOC7sPnui4vHnQfx0b+FWqtKQ16kGGmWSd15CyaYGIK7RmX/59gUee4 3rYumj0HBweHNie0iaetGKhgPfVmiH2U55UE6e3nsOGm3XKmDZVUkdPEwLm/7/p0SZSRu6zN WQG8BsRobkA73WUbcDiTkTjvSXY4FkTDo84//IB1CmBza/d4gC8D2cCTyJcZNFOiPLaVQDGx XfSwYq3WGUHXKm9DCvEq+zK9W/a1T09dzdqWMMScecSDzAPSqkXhwmHcNtsGbXdYjbdSWCpm GDiQMTTatwuYS83O0eToAivb9GE/MGhousJCuL/BDjN0++BTNT5D7FEEHCChRq6EK6XT0Oao F8PkNWE4eYFAPmlzXLQGbpVTOHwvarcbFUwZGKD+LF7rFyQF4OLJ9gMsFmS2m80Wir7RdMZS BCK4l4AjHOiFHCrcbV2c+qM5zcClsDd+SDefqmMNLJmO8EpHCfepX0GTRPAjgjFzRl3+Ylia MjzTCpZJStDYUiR5GHtHLl1PH5C7n1W+F4/srimkUT6iebOOC/9pHVsGALmU93VJZis+G39m +uz/ePTlX2zjMWWjvHrzLMu
  • Ironport-hdrordr: A9a23:zv0976+p6r9VFQs2fyFuk+DSI+orL9Y04lQ7vn2YSXRuHfBw8P re+cjztCWE7wr5N0tApTntAsS9qBDnhPxICOsqXYtKNTOO0ADDEGgL1/qH/9SKIUPDH4BmuZ uIC5IOa+HNMQ==
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

Adds '/ZH:SHA_256' '/CETCOMPAT' '/sdl' to compiler and '/SafeSEH' to x86 linker
command lines
These changes were prompted by binskim https://github.com/microsoft/binskim

Note: Rule BA2004 (Warning_NativeWithInsecureStaticLibraryCompilands) is still
      reported for xeniface_coinst.dll, xencontrol.dll and xenagent.exe

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
 vs2019/xenagent/xenagent.vcxproj               | 3 +++
 vs2019/xencontrol/xencontrol.vcxproj           | 3 +++
 vs2019/xeniface/xeniface.vcxproj               | 8 +++++++-
 vs2019/xeniface_coinst/xeniface_coinst.vcxproj | 3 +++
 4 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/vs2019/xenagent/xenagent.vcxproj b/vs2019/xenagent/xenagent.vcxproj
index 1076c81..02b7b65 100644
--- a/vs2019/xenagent/xenagent.vcxproj
+++ b/vs2019/xenagent/xenagent.vcxproj
@@ -22,6 +22,8 @@
   </PropertyGroup>
   <ItemDefinitionGroup>
     <ClCompile>
+      <AdditionalOptions>/ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
+      <SDLCheck>true</SDLCheck>
       
<AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       
<PreprocessorDefinitions>PROJECT=$(ProjectName);WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <WarningLevel>EnableAllWarnings</WarningLevel>
@@ -33,6 +35,7 @@
     </ClCompile>
     <Link>
       
<AdditionalDependencies>powrprof.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <CETCompat>true</CETCompat>
     </Link>
     <ResourceCompile>
       
<AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
diff --git a/vs2019/xencontrol/xencontrol.vcxproj 
b/vs2019/xencontrol/xencontrol.vcxproj
index 36383d8..5474ceb 100644
--- a/vs2019/xencontrol/xencontrol.vcxproj
+++ b/vs2019/xencontrol/xencontrol.vcxproj
@@ -19,6 +19,8 @@
   </PropertyGroup>
   <ItemDefinitionGroup>
     <ClCompile>
+      <AdditionalOptions>/ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
+      <SDLCheck>true</SDLCheck>
       
<AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       
<PreprocessorDefinitions>WIN32;_WINDOWS;_USRDLL;XENCONTROL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <WarningLevel>EnableAllWarnings</WarningLevel>
@@ -32,6 +34,7 @@
     </ClCompile>
     <Link>
       
<AdditionalDependencies>setupapi.lib;ws2_32.lib;shlwapi.lib;wtsapi32.lib;userenv.lib;version.lib;ntdll.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <CETCompat>true</CETCompat>
     </Link>
     <ResourceCompile>
       
<AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
diff --git a/vs2019/xeniface/xeniface.vcxproj b/vs2019/xeniface/xeniface.vcxproj
index 7e6b79d..b9756dd 100644
--- a/vs2019/xeniface/xeniface.vcxproj
+++ b/vs2019/xeniface/xeniface.vcxproj
@@ -19,6 +19,7 @@
   </PropertyGroup>
   <ItemDefinitionGroup>
     <ClCompile>
+      <AdditionalOptions>/ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
       
<AdditionalIncludeDirectories>$(WindowsSdkDir)\include\km;..\..\include;</AdditionalIncludeDirectories>
       
<PreprocessorDefinitions>PROJECT=$(ProjectName);POOL_NX_OPTIN=1;NT_PROCESSOR_GROUPS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <IntrinsicFunctions>true</IntrinsicFunctions>
@@ -30,7 +31,6 @@
       
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ResourceCompile>
     <Link>
-      <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
       
<AdditionalDependencies>$(DDK_LIB_PATH)\ntstrsafe.lib;$(DDK_LIB_PATH)\procgrp.lib;%(AdditionalDependencies)</AdditionalDependencies>
       
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
       <CETCompat>true</CETCompat>
@@ -43,11 +43,17 @@
     <ClCompile>
       
<PreprocessorDefinitions>__i386__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
+    <Link>
+      <ImageHasSafeExceptionHandlers>true</ImageHasSafeExceptionHandlers>
+    </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Platform)'=='x64'">
     <ClCompile>
       
<PreprocessorDefinitions>__x86_64__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
+    <Link>
+      <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+    </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)'=='Windows 8 Release'">
     <ClCompile>
diff --git a/vs2019/xeniface_coinst/xeniface_coinst.vcxproj 
b/vs2019/xeniface_coinst/xeniface_coinst.vcxproj
index 77e6836..9035a14 100644
--- a/vs2019/xeniface_coinst/xeniface_coinst.vcxproj
+++ b/vs2019/xeniface_coinst/xeniface_coinst.vcxproj
@@ -18,6 +18,8 @@
   </PropertyGroup>
   <ItemDefinitionGroup>
     <ClCompile>
+      <AdditionalOptions>/ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
+      <SDLCheck>true</SDLCheck>
       
<AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       
<PreprocessorDefinitions>PROJECT=$(ProjectName);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <WarningLevel>EnableAllWarnings</WarningLevel>
@@ -30,6 +32,7 @@
     <Link>
       
<ModuleDefinitionFile>../../src/coinst/xeniface_coinst.def</ModuleDefinitionFile>
       
<AdditionalDependencies>setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <CETCompat>true</CETCompat>
     </Link>
     <ResourceCompile>
       
<AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-- 
2.32.0.windows.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.