diff options
Diffstat (limited to 'compiler-rt/CMakeLists.txt')
-rw-r--r-- | compiler-rt/CMakeLists.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt index c5003b5efa1d..0dcb417a85f8 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt @@ -54,6 +54,7 @@ option(COMPILER_RT_BUILD_ORC "Build ORC runtime" ON) mark_as_advanced(COMPILER_RT_BUILD_ORC) option(COMPILER_RT_BUILD_GWP_ASAN "Build GWP-ASan, and link it into SCUDO" ON) mark_as_advanced(COMPILER_RT_BUILD_GWP_ASAN) +option(COMPILER_RT_ENABLE_CET "Build Compiler RT with CET enabled" OFF) if(FUCHSIA) set(COMPILER_RT_HWASAN_WITH_INTERCEPTORS_DEFAULT OFF) @@ -244,6 +245,14 @@ include(config-ix) # Setup Compiler Flags #================================ +# fcf-protection is a gcc/clang option for CET support on Linux platforms. +# We need to handle MSVC CET option on Windows platforms. +if (NOT MSVC) + if (COMPILER_RT_ENABLE_CET AND NOT COMPILER_RT_HAS_FCF_PROTECTION_FLAG) + message(FATAL_ERROR "Compiler used to build compiler-rt doesn't support CET!") + endif() +endif() + if(MSVC) # Override any existing /W flags with /W4. This is what LLVM does. Failing to # remove other /W[0-4] flags will result in a warning about overriding a |