|
1 | | -diff --git a/src/tbb/cmake/compilers/GNU.cmake b/src/tbb/cmake/compilers/GNU.cmake |
2 | | -index cf6d8bdb..8f9f0b59 100644 |
3 | 1 | --- a/src/tbb/cmake/compilers/GNU.cmake |
4 | 2 | +++ b/src/tbb/cmake/compilers/GNU.cmake |
5 | | -@@ -47,19 +47,44 @@ endif() |
| 3 | +@@ -47,19 +47,44 @@ |
6 | 4 | # >=2.31.1). Capturing the output in CMake can be done like below. The version |
7 | 5 | # information is written to either stdout or stderr. To not make any |
8 | 6 | # assumptions, both are captured. |
@@ -48,19 +46,37 @@ index cf6d8bdb..8f9f0b59 100644 |
48 | 46 | message(TRACE "Extracted GNU assembler version: major=${_tbb_gnu_asm_major_version} minor=${_tbb_gnu_asm_minor_version}") |
49 | 47 |
|
50 | 48 | math(EXPR _tbb_gnu_asm_version_number "${_tbb_gnu_asm_major_version} * 1000 + ${_tbb_gnu_asm_minor_version}") |
51 | | -@@ -81,7 +106,14 @@ endif() |
| 49 | +@@ -73,6 +98,16 @@ |
| 50 | + |
| 51 | + set(TBB_COMMON_LINK_LIBS ${CMAKE_DL_LIBS}) |
| 52 | + |
| 53 | ++# Local addition: on mingw the helpers for -fstack-protector-strong and |
| 54 | ++# _FORTIFY_SOURCE (__stack_chk_fail, __stack_chk_guard, __strncpy_chk, ...) |
| 55 | ++# live in libssp rather than libgcc, and older toolchains (Rtools42 / gcc 10) |
| 56 | ++# do not pull it in implicitly. It has to go here, with the link libraries, |
| 57 | ++# rather than in the linker flags: those are emitted before the objects, and |
| 58 | ++# GNU ld only resolves symbols already undefined when it reaches a library. |
| 59 | ++if (MINGW) |
| 60 | ++ set(TBB_COMMON_LINK_LIBS ${TBB_COMMON_LINK_LIBS} ssp) |
| 61 | ++endif() |
| 62 | ++ |
| 63 | + # Ignore -Werror set through add_compile_options() or added to CMAKE_CXX_FLAGS if TBB_STRICT is disabled. |
| 64 | + if (NOT TBB_STRICT AND COMMAND tbb_remove_compile_flag) |
| 65 | + tbb_remove_compile_flag(-Werror) |
| 66 | +@@ -81,8 +116,15 @@ |
52 | 67 | if (NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL Intel) |
53 | 68 | # gcc 6.0 and later have -flifetime-dse option that controls elimination of stores done outside the object lifetime |
54 | 69 | set(TBB_DSE_FLAG $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},6.0>>:-flifetime-dse=1>) |
55 | 70 | - set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},8.0>>:-fstack-clash-protection>) |
56 | | -+ |
| 71 | + |
57 | 72 | + # -fstack-clash-protection is broken on mingw's SEH targets: compiling |
58 | 73 | + # task_dispatcher.h makes GCC 10 abort with "internal compiler error: in |
59 | 74 | + # seh_emit_stackalloc, at config/i386/winnt.c". It is a hardening flag |
60 | 75 | + # rather than a correctness one, so simply leave it off there. |
61 | 76 | + if (NOT MINGW) |
62 | 77 | + set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},8.0>>:-fstack-clash-protection>) |
63 | 78 | + endif() |
64 | | - |
| 79 | ++ |
65 | 80 | # Suppress GCC 12.x-13.x warning here that to_wait_node(n)->my_is_in_list might have size 0 |
66 | 81 | set(TBB_COMMON_LINK_FLAGS ${TBB_COMMON_LINK_FLAGS} $<$<AND:$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},12.0>>,$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},14.0>>:-Wno-stringop-overflow>) |
| 82 | + endif() |
0 commit comments