Skip to content

Commit 827c8bf

Browse files
committed
EDGEML-13495: Fix Binskim issues in xrt
Signed-off-by: Yvonne Yang <Yvonne.Yang@amd.com> Revert /OPT:REF back for non-debug builds Signed-off-by: Yvonne Yang <Yvonne.Yang@amd.com>
1 parent 3100735 commit 827c8bf

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/CMake/nativeWin.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ if (MSVC)
4444
/Qspectre # compile with the Spectre mitigations switch
4545
/ZH:SHA_256 # enable secure source code hashing
4646
/guard:cf # enable compiler control guard feature (CFG) to prevent attackers from redirecting execution to unsafe locations
47+
/GF # eliminate duplicate strings
4748
$<$<NOT:$<CONFIG:Debug>>:/guard:cast> # enable cast guard to prevent type confusion
4849
$<$<NOT:$<CONFIG:Debug>>:/d2CastGuardFailureMode:fastfail> # fastfail mode for cast guard
4950
$<$<NOT:$<CONFIG:Debug>>:/GL> # enable whole program optimization
50-
$<$<NOT:$<CONFIG:Debug>>:/GF> # eliminate duplicate strings
5151
)
5252
add_link_options(
5353
/NODEFAULTLIB:libucrt$<$<CONFIG:Debug>:d>.lib # Hybrid CRT

src/runtime_src/tools/scripts/xrtdeps-win.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def getBuildAndInstallLibraryMinimum(self, verbose):
237237
if verbose == True:
238238
print ("Building and installing the boost library...")
239239

240-
cmd = "b2 -j6 install toolset=msvc-14.1 --prefix=" + self.install_dir + " --build-type=complete address-model=64 architecture=x86 link=static threading=multi --with-filesystem --with-program_options --with-system"
240+
cmd = "b2 -j6 install toolset=msvc-14.1 --prefix=" + self.install_dir + " --build-type=complete address-model=64 architecture=x86 link=static threading=multi cxxflags=/W3 --with-filesystem --with-program_options --with-system"
241241
print (cmd)
242242
os.system(cmd)
243243

@@ -285,7 +285,7 @@ def getBuildAndInstallLibrary(self, verbose):
285285
if verbose == True:
286286
print ("Building and installing the boost library...")
287287

288-
cmd = "b2 -j6 install toolset=msvc-14.1 --prefix=" + self.install_dir + " --build-type=complete"
288+
cmd = "b2 -j6 install toolset=msvc-14.1 --prefix=" + self.install_dir + " --build-type=complete cxxflags=/W3"
289289
print (cmd)
290290
os.system(cmd)
291291

src/runtime_src/tools/scripts/xrtdeps-win19.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def getBuildAndInstallLibraryMinimum(self, verbose):
237237
if verbose == True:
238238
print ("Building and installing the boost library...")
239239

240-
cmd = "b2 -j6 install toolset=msvc --prefix=" + self.install_dir + " --build-type=complete address-model=64 architecture=x86 link=static threading=multi --with-filesystem --with-program_options --with-system"
240+
cmd = "b2 -j6 install toolset=msvc --prefix=" + self.install_dir + " --build-type=complete address-model=64 architecture=x86 link=static threading=multi cxxflags=/W3 --with-filesystem --with-program_options --with-system"
241241
print (cmd)
242242
os.system(cmd)
243243

@@ -285,7 +285,7 @@ def getBuildAndInstallLibrary(self, verbose):
285285
if verbose == True:
286286
print ("Building and installing the boost library...")
287287

288-
cmd = "b2 -j6 install toolset=msvc --prefix=" + self.install_dir + " --build-type=complete"
288+
cmd = "b2 -j6 install toolset=msvc --prefix=" + self.install_dir + " --build-type=complete cxxflags=/W3"
289289
print (cmd)
290290
os.system(cmd)
291291

src/runtime_src/tools/scripts/xrtdeps-win22.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def getBuildAndInstallLibraryMinimum(self, verbose):
249249
if verbose == True:
250250
print ("Building and installing the boost library...")
251251

252-
cmd = "b2 -j6 install toolset=msvc --prefix=" + self.install_dir + " --build-type=complete address-model=64 architecture=x86 link=static threading=multi --with-filesystem --with-program_options --with-system"
252+
cmd = "b2 -j6 install toolset=msvc --prefix=" + self.install_dir + " --build-type=complete address-model=64 architecture=x86 link=static threading=multi cxxflags=/W3 --with-filesystem --with-program_options --with-system"
253253
print (cmd)
254254
os.system(cmd)
255255

@@ -297,7 +297,7 @@ def getBuildAndInstallLibrary(self, verbose):
297297
if verbose == True:
298298
print ("Building and installing the boost library...")
299299

300-
cmd = "b2 -j6 install toolset=msvc --prefix=" + self.install_dir + " --build-type=complete"
300+
cmd = "b2 -j6 install toolset=msvc --prefix=" + self.install_dir + " --build-type=complete cxxflags=/W3"
301301
print (cmd)
302302
os.system(cmd)
303303

0 commit comments

Comments
 (0)