diff options
Diffstat (limited to 'dev-cpp/tbb/files/tbb-2022.3.0-no-clobber-hardened.patch')
| -rw-r--r-- | dev-cpp/tbb/files/tbb-2022.3.0-no-clobber-hardened.patch | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/dev-cpp/tbb/files/tbb-2022.3.0-no-clobber-hardened.patch b/dev-cpp/tbb/files/tbb-2022.3.0-no-clobber-hardened.patch new file mode 100644 index 000000000000..ac8b3d756a0f --- /dev/null +++ b/dev-cpp/tbb/files/tbb-2022.3.0-no-clobber-hardened.patch @@ -0,0 +1,37 @@ +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) |
