mirror of
https://anongit.gentoo.org/git/repo/gentoo.git
synced 2025-12-17 15:43:55 +00:00
Don't force -fcf-protection=* or other flag we already set in the toolchain where appropriate. Closes: https://bugs.gentoo.org/965340 Signed-off-by: Sam James <sam@gentoo.org>
37 lines
2 KiB
Diff
37 lines
2 KiB
Diff
We already set these flags as appropriate in the toolchain.
|
|
--- a/cmake/compilers/Clang.cmake
|
|
+++ b/cmake/compilers/Clang.cmake
|
|
@@ -63,15 +63,11 @@ if (CMAKE_SYSTEM_PROCESSOR MATCHES "(AMD64|amd64|i.86|x86)" AND NOT EMSCRIPTEN)
|
|
endif()
|
|
|
|
# Clang flags to prevent compiler from optimizing out security checks
|
|
-set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -Wformat -Wformat-security -Werror=format-security -fPIC $<$<NOT:$<BOOL:${EMSCRIPTEN}>>:-fstack-protector-strong>)
|
|
-
|
|
-if (NOT APPLE AND NOT ANDROID_PLATFORM AND CMAKE_SYSTEM_PROCESSOR MATCHES "(AMD64|amd64|i.86|x86)")
|
|
- set(TBB_LIB_COMPILE_FLAGS ${TBB_LIB_COMPILE_FLAGS} -fstack-clash-protection $<$<NOT:$<BOOL:${EMSCRIPTEN}>>:-fcf-protection=full>)
|
|
-endif()
|
|
+set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -Wformat -Wformat-security -Werror=format-security -fPIC)
|
|
|
|
# -z switch is not supported on MacOS
|
|
if (NOT APPLE)
|
|
- set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -Wl,-z,relro,-z,now,-z,noexecstack)
|
|
+ set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -Wl,-z,noexecstack)
|
|
endif()
|
|
|
|
set(TBB_COMMON_LINK_LIBS ${CMAKE_DL_LIBS})
|
|
--- a/cmake/compilers/GNU.cmake
|
|
+++ b/cmake/compilers/GNU.cmake
|
|
@@ -121,12 +121,7 @@ endif ()
|
|
|
|
# Gnu flags to prevent compiler from optimizing out security checks
|
|
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -fno-strict-overflow -fno-delete-null-pointer-checks -fwrapv)
|
|
-set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -Wformat -Wformat-security -Werror=format-security
|
|
- -fstack-protector-strong )
|
|
-if (CMAKE_SYSTEM_PROCESSOR MATCHES "(AMD64|amd64|i.86|x86)" AND NOT EMSCRIPTEN)
|
|
- set(TBB_LIB_COMPILE_FLAGS ${TBB_LIB_COMPILE_FLAGS} $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},8.0>>:-fcf-protection=full>)
|
|
-endif ()
|
|
-set(TBB_LIB_COMPILE_FLAGS ${TBB_LIB_COMPILE_FLAGS} $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},8.0>>:-fstack-clash-protection>)
|
|
+set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -Wformat -Wformat-security -Werror=format-security)
|
|
|
|
# -z switch is not supported on MacOS and MinGW
|
|
if (NOT APPLE AND NOT MINGW)
|