[compiler-rt] r283658 - [compiler-rt] Exclude compiler-rt from using -fmodules when LLVM_ENABLE_MODULES=On

Kuba Brecka via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 8 02:01:28 PDT 2016


Author: kuba.brecka
Date: Sat Oct  8 04:01:27 2016
New Revision: 283658

URL: http://llvm.org/viewvc/llvm-project?rev=283658&view=rev
Log:
[compiler-rt] Exclude compiler-rt from using -fmodules when LLVM_ENABLE_MODULES=On

Sanitizers are intentionally not including system headers and often declare slightly different function prototypes, which is incompatible with -fmodules and -fcxx-modules. Let’s simply exclude compiler-rt from using -fmodules.

Differential Revision: https://reviews.llvm.org/D25230


Modified:
    compiler-rt/trunk/CMakeLists.txt

Modified: compiler-rt/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=283658&r1=283657&r2=283658&view=diff
==============================================================================
--- compiler-rt/trunk/CMakeLists.txt (original)
+++ compiler-rt/trunk/CMakeLists.txt Sat Oct  8 04:01:27 2016
@@ -205,6 +205,12 @@ elseif(MSVC)
   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Z[i7I]" "/Z7")
 endif()
 
+if(LLVM_ENABLE_MODULES)
+  # Sanitizers cannot be built with -fmodules. The interceptors intentionally
+  # don't include system headers, which is incompatible with modules.
+  list(APPEND SANITIZER_COMMON_CFLAGS -fno-modules)
+endif()
+
 # Turn off several warnings.
 append_list_if(COMPILER_RT_HAS_WGNU_FLAG -Wno-gnu SANITIZER_COMMON_CFLAGS)
 append_list_if(COMPILER_RT_HAS_WVARIADIC_MACROS_FLAG -Wno-variadic-macros SANITIZER_COMMON_CFLAGS)




More information about the llvm-commits mailing list