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.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Thanks! This will allow us to enable compiler-rt on the http://lab.llvm.org:8080/green/job/clang-stage2-cmake-modulesRDA/ bot again.
For more context; on Darwin building compiler-rt with modules enabled produces errors like:
../projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:784:22: error: conflicting types for 'pread' INTERCEPTOR(SSIZE_T, pread, int fd, void *ptr, SIZE_T count, OFF_T offset) { ^ <...>/usr/include/unistd.h:576:10: note: previous declaration is here ssize_t pread(int __fd, void * __buf, size_t __nbyte, off_t __offset) __DARWIN_ALIAS_C(pread); ^ In file included from ../projects/compiler-rt/lib/asan/asan_interceptors.cc:205: ../projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:784:22: error: declaration of 'pread' must be imported from module 'Darwin.POSIX.unistd' before it is required INTERCEPTOR(SSIZE_T, pread, int fd, void *ptr, SIZE_T count, OFF_T offset) { ^