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

[PATCH] Generate map files and enable integrity check



Enable linker options to generates map files, to help debugging crashdumps
Adds map files to output package
Add /INTEGRITYCHECK to linker options
Removes /LTCG from linker command line for XenAgent. This removes a linker log 
output suggesting
removal of this argument.

https://learn.microsoft.com/en-us/cpp/build/reference/map-generate-mapfile?view=msvc-170
https://learn.microsoft.com/en-us/cpp/build/reference/mapinfo-include-information-in-mapfile?view=msvc-170
https://learn.microsoft.com/en-us/cpp/build/reference/integritycheck-require-signature-check?view=msvc-170

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxx>
---
 vs2019/xenagent/xenagent.vcxproj     | 4 ++++
 vs2019/xencontrol/xencontrol.vcxproj | 4 ++++
 vs2019/xeniface/xeniface.vcxproj     | 4 ++++
 vs2022/xenagent/xenagent.vcxproj     | 4 ++++
 vs2022/xencontrol/xencontrol.vcxproj | 4 ++++
 vs2022/xeniface/xeniface.vcxproj     | 4 ++++
 6 files changed, 24 insertions(+)

diff --git a/vs2019/xenagent/xenagent.vcxproj b/vs2019/xenagent/xenagent.vcxproj
index 02b7b65..27bf3af 100644
--- a/vs2019/xenagent/xenagent.vcxproj
+++ b/vs2019/xenagent/xenagent.vcxproj
@@ -35,7 +35,10 @@
     </ClCompile>
     <Link>
       
<AdditionalDependencies>powrprof.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalOptions>/INTEGRITYCHECK 
%(AdditionalOptions)</AdditionalOptions>
       <CETCompat>true</CETCompat>
+      <GenerateMapFile>true</GenerateMapFile>
+      <MapExports>true</MapExports>
     </Link>
     <ResourceCompile>
       
<AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@@ -67,6 +70,7 @@
   <ItemGroup>
     <FilesToPackage Include="$(TargetPath)" />
     <FilesToPackage Include="$(OutDir)$(TargetName).pdb" />
+    <FilesToPackage Include="$(OutDir)$(TargetName).map" />
     <FilesToPackage Include="$(OutDir)$(TargetName).dll" />
   </ItemGroup>
   <ItemGroup>
diff --git a/vs2019/xencontrol/xencontrol.vcxproj 
b/vs2019/xencontrol/xencontrol.vcxproj
index 5474ceb..5da405e 100644
--- a/vs2019/xencontrol/xencontrol.vcxproj
+++ b/vs2019/xencontrol/xencontrol.vcxproj
@@ -34,7 +34,10 @@
     </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>
+      <AdditionalOptions>/INTEGRITYCHECK 
%(AdditionalOptions)</AdditionalOptions>
       <CETCompat>true</CETCompat>
+      <GenerateMapFile>true</GenerateMapFile>
+      <MapExports>true</MapExports>
     </Link>
     <ResourceCompile>
       
<AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@@ -56,6 +59,7 @@
   <ItemGroup>
     <FilesToPackage Include="$(TargetPath)" />
     <FilesToPackage Include="$(OutDir)$(TargetName).pdb" />
+    <FilesToPackage Include="$(OutDir)$(TargetName).map" />
     <FilesToPackage Include="$(OutDir)$(TargetName).dll" />
     <FilesToPackage Include="$(OutDir)$(TargetName).lib" />
   </ItemGroup>
diff --git a/vs2019/xeniface/xeniface.vcxproj b/vs2019/xeniface/xeniface.vcxproj
index 9b72b69..1c5c15b 100644
--- a/vs2019/xeniface/xeniface.vcxproj
+++ b/vs2019/xeniface/xeniface.vcxproj
@@ -32,8 +32,11 @@
     </ResourceCompile>
     <Link>
       
<AdditionalDependencies>$(DDK_LIB_PATH)\ntstrsafe.lib;$(DDK_LIB_PATH)\procgrp.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalOptions>/INTEGRITYCHECK 
%(AdditionalOptions)</AdditionalOptions>
       
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
       <CETCompat>true</CETCompat>
+      <GenerateMapFile>true</GenerateMapFile>
+      <MapExports>true</MapExports>
     </Link>
     <DriverSign>
       <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
@@ -65,6 +68,7 @@
   <ItemGroup>
     <FilesToPackage Include="$(TargetPath)" />
     <FilesToPackage Include="$(OutDir)$(TargetName).pdb" />
+    <FilesToPackage Include="$(OutDir)$(TargetName).map" />
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\src\xeniface\ioctls.c" />
diff --git a/vs2022/xenagent/xenagent.vcxproj b/vs2022/xenagent/xenagent.vcxproj
index dedd1d2..5f360ca 100644
--- a/vs2022/xenagent/xenagent.vcxproj
+++ b/vs2022/xenagent/xenagent.vcxproj
@@ -35,7 +35,10 @@
     </ClCompile>
     <Link>
       
<AdditionalDependencies>powrprof.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalOptions>/INTEGRITYCHECK 
%(AdditionalOptions)</AdditionalOptions>
       <CETCompat>true</CETCompat>
+      <GenerateMapFile>true</GenerateMapFile>
+      <MapExports>true</MapExports>
     </Link>
     <ResourceCompile>
       
<AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@@ -57,6 +60,7 @@
   <ItemGroup>
     <FilesToPackage Include="$(TargetPath)" />
     <FilesToPackage Include="$(OutDir)$(TargetName).pdb" />
+    <FilesToPackage Include="$(OutDir)$(TargetName).map" />
     <FilesToPackage Include="$(OutDir)$(TargetName).dll" />
   </ItemGroup>
   <ItemGroup>
diff --git a/vs2022/xencontrol/xencontrol.vcxproj 
b/vs2022/xencontrol/xencontrol.vcxproj
index c6ea3ed..aed7b7f 100644
--- a/vs2022/xencontrol/xencontrol.vcxproj
+++ b/vs2022/xencontrol/xencontrol.vcxproj
@@ -34,7 +34,10 @@
     </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>
+      <AdditionalOptions>/INTEGRITYCHECK 
%(AdditionalOptions)</AdditionalOptions>
       <CETCompat>true</CETCompat>
+      <GenerateMapFile>true</GenerateMapFile>
+      <MapExports>true</MapExports>
     </Link>
     <ResourceCompile>
       
<AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@@ -51,6 +54,7 @@
   <ItemGroup>
     <FilesToPackage Include="$(TargetPath)" />
     <FilesToPackage Include="$(OutDir)$(TargetName).pdb" />
+    <FilesToPackage Include="$(OutDir)$(TargetName).map" />
     <FilesToPackage Include="$(OutDir)$(TargetName).dll" />
     <FilesToPackage Include="$(OutDir)$(TargetName).lib" />
   </ItemGroup>
diff --git a/vs2022/xeniface/xeniface.vcxproj b/vs2022/xeniface/xeniface.vcxproj
index bcce921..776e68e 100644
--- a/vs2022/xeniface/xeniface.vcxproj
+++ b/vs2022/xeniface/xeniface.vcxproj
@@ -32,8 +32,11 @@
     </ResourceCompile>
     <Link>
       
<AdditionalDependencies>$(DDK_LIB_PATH)\ntstrsafe.lib;$(DDK_LIB_PATH)\procgrp.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalOptions>/INTEGRITYCHECK 
%(AdditionalOptions)</AdditionalOptions>
       
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
       <CETCompat>true</CETCompat>
+      <GenerateMapFile>true</GenerateMapFile>
+      <MapExports>true</MapExports>
     </Link>
     <DriverSign>
       <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
@@ -57,6 +60,7 @@
   <ItemGroup>
     <FilesToPackage Include="$(TargetPath)" />
     <FilesToPackage Include="$(OutDir)$(TargetName).pdb" />
+    <FilesToPackage Include="$(OutDir)$(TargetName).map" />
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\src\xeniface\ioctls.c" />
-- 
2.41.0.windows.3




 


Rackspace

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