[PATCH] D25230: [compiler-rt] Exclude compiler-rt from using -fmodules when LLVM_ENABLE_MODULES=On

Kuba Brecka via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 4 04:30:19 PDT 2016


kubabrecka created this revision.
kubabrecka added reviewers: kcc, aprantl, dvyukov.
kubabrecka added subscribers: zaks.anna, llvm-commits.
kubabrecka set the repository for this revision to rL LLVM.
kubabrecka added a project: Sanitizers.
Herald added subscribers: mgorny, beanz, dberris.

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.


Repository:
  rL LLVM

https://reviews.llvm.org/D25230

Files:
  CMakeLists.txt


Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -205,6 +205,12 @@
   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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25230.73454.patch
Type: text/x-patch
Size: 685 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161004/35f47ae2/attachment.bin>


More information about the llvm-commits mailing list