This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by kubamracek on Oct 4 2016, 4:30 AM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

kubamracek updated this revision to Diff 73454.Oct 4 2016, 4:30 AM
kubamracek retitled this revision from to [compiler-rt] Exclude compiler-rt from using -fmodules when LLVM_ENABLE_MODULES=On.
kubamracek updated this object.
kubamracek added reviewers: kcc, aprantl, dvyukov.
kubamracek set the repository for this revision to rL LLVM.
kubamracek added a project: Restricted Project.
kubamracek added subscribers: zaks.anna, llvm-commits.
aprantl accepted this revision.Oct 4 2016, 8:43 AM
aprantl edited edge metadata.

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) {
^
This revision is now accepted and ready to land.Oct 4 2016, 8:43 AM
aprantl edited edge metadata.Oct 4 2016, 8:44 AM
aprantl added subscribers: rsmith, bruno.
This revision was automatically updated to reflect the committed changes.