Skip to content

Commit d993d31

Browse files
authored
Fix filtering of FORTIFY_SOURCE flags (#119719)
On Fedora and RHEL, when building the VMR (and runtime) we provide additional CFLAGS/CXXFLAGS to the build, including this set: -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS This is filtered incorrectly in eng/native/configureplatform.cmake, resulting in this CFLAG: -Wp,-Wp,-D_GLIBCXX_ASSERTIONS This is invalid and makes the build fail.
1 parent 0b195cc commit d993d31

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

eng/native/configureplatform.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,8 @@ endif()
511511
string(TOLOWER "${CMAKE_BUILD_TYPE}" LOWERCASE_CMAKE_BUILD_TYPE)
512512
if(LOWERCASE_CMAKE_BUILD_TYPE STREQUAL debug)
513513
# Clear _FORTIFY_SOURCE=2, if set
514+
string(REPLACE "-Wp,-D_FORTIFY_SOURCE=2 " "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
515+
string(REPLACE "-Wp,-D_FORTIFY_SOURCE=2 " "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
514516
string(REPLACE "-D_FORTIFY_SOURCE=2 " "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
515517
string(REPLACE "-D_FORTIFY_SOURCE=2 " "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
516518
endif()

0 commit comments

Comments
 (0)