diff options
-rw-r--r-- | compiler-rt/CMakeLists.txt | 2 | ||||
-rw-r--r-- | compiler-rt/lib/sanitizer_common/CMakeLists.txt | 3 | ||||
-rw-r--r-- | compiler-rt/lib/tsan/CMakeLists.txt | 7 |
3 files changed, 9 insertions, 3 deletions
diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt index d41761cfba2..8f00eeaeb1b 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt @@ -193,6 +193,8 @@ if (SUPPORTS_NO_NON_VIRTUAL_DTOR_FLAG) endif() check_cxx_compiler_flag(-Wglobal-constructors SUPPORTS_GLOBAL_CONSTRUCTORS_FLAG) # Not all sanitizers forbid global constructors. +check_cxx_compiler_flag("-Werror -Wframe-larger-than=512" + SUPPORTS_FRAME_LARGER_THAN_FLAG) if(APPLE) # Obtain the iOS Simulator SDK path from xcodebuild. diff --git a/compiler-rt/lib/sanitizer_common/CMakeLists.txt b/compiler-rt/lib/sanitizer_common/CMakeLists.txt index bd2ca81baab..26e6a27cd76 100644 --- a/compiler-rt/lib/sanitizer_common/CMakeLists.txt +++ b/compiler-rt/lib/sanitizer_common/CMakeLists.txt @@ -99,6 +99,9 @@ else() /GR-) endif() +if(SUPPORTS_FRAME_LARGER_THAN_FLAG) + list(APPEND SANITIZER_CFLAGS -Wframe-larger-than=512) +endif() if(SUPPORTS_GLOBAL_CONSTRUCTORS_FLAG) list(APPEND SANITIZER_CFLAGS -Wglobal-constructors) endif() diff --git a/compiler-rt/lib/tsan/CMakeLists.txt b/compiler-rt/lib/tsan/CMakeLists.txt index dab681a62bd..030904798cb 100644 --- a/compiler-rt/lib/tsan/CMakeLists.txt +++ b/compiler-rt/lib/tsan/CMakeLists.txt @@ -9,9 +9,10 @@ set(TSAN_CFLAGS -fPIE -fno-rtti) -set(TSAN_RTL_CFLAGS - ${TSAN_CFLAGS} - -Wframe-larger-than=512) +set(TSAN_RTL_CFLAGS ${TSAN_CFLAGS}) +if(SUPPORTS_FRAME_LARGER_THAN_FLAG) + list(APPEND TSAN_RTL_CFLAGS -Wframe-larger-than=512) +endif() if(SUPPORTS_GLOBAL_CONSTRUCTORS_FLAG) list(APPEND TSAN_RTL_CFLAGS -Wglobal-constructors) endif() |