Open Quuxplusone opened 8 years ago
Bugzilla Link | PR25753 |
Status | REOPENED |
Importance | P normal |
Reported by | Jeremy Huddleston Sequoia (jeremyhu@apple.com) |
Reported on | 2015-12-05 12:26:50 -0800 |
Last modified on | 2018-06-11 20:16:29 -0700 |
Version | unspecified |
Hardware | Macintosh MacOS X |
CC | chris.bieneman@me.com, dvyukov@google.com, llvm-bugs@lists.llvm.org, mracek@apple.com, nicolasweber@gmx.de, vitalybuka@google.com |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also | PR25885 |
I believe that in older builds, tsan wasn't being built by default, so this may not be a new issue, just one that was uncovered by starting to build tsan by default.
The autoconf-based build system used the built clang to compile compiler-rt. Is this issue happening because cmake is instead using the bootstrap compiler?
Yeah, that looks to be the case.
I'm seeing this on my bots too, even after a clobber build. How did you fix this?
I guess this is from r254603 (http://reviews.llvm.org/D15109) if your Xcode isn't new enough? (Where "new enough" means "really new")
Since this causes issues, can we either make cmake check if the installed Xcode is new enough and only build tsan on OS X if it is, or at least provide a toggle to disable tsan on OS X?
Is there a way to have cmake use the newly built clang to compile the runtime libraries, like we do with the autoconf build system?
Hm, maybe we can just upgrade from Xcode 6.2 to Xcode 7 on that bot of mine.
But in general it'd be good if we were less reckless about requiring latest Xcodes.
You can use just-built clang to build compiler-rt in CMake if you set LLVM_BUILD_EXTERNAL_COMPILER_RT=On.
There are two solutions for this. Either pass LLVM_BUILD_EXTERNAL_COMPILER_RT=On to CMake, or on trunk you can put compiler-rt in the LLVM runtimes subdirectory.
Sorry Chris, but that doesn't actually work.
I tested that with our llvm-3.8 port on Mountain Lion in MacPorts without success. The LLVM_BUILD_EXTERNAL_COMPILER_RT=ON option causes none of compiler_rt to be built at all.
compiler-rt has always been in llvm/projects/compiler-rt. I don't see a "runtimes" directory, so I assume that's what you meant. AFAIK, it has to be placed there and there isn't really another option. Not doing that will certainly cause failure. Perhaps I'm missing something there ?
The issue is that compiler_rt should be built, but it (and likely the rest of the runtime libs for that matter) using the just-built clang and not the compiler that was used to build llvm and clang. The old autoconf-based build system used the built clang, but the cmake build system does not.
The "runtimes" directory is new in LLVM 4.0, so you can see and test it on trunk (which is why my earlier comment said you can do that on trunk).
I would expect LLVM_BUILD_EXTERNAL_COMPILER_RT=On to work on 3.8 and 3.9, but likely not earlier. With that compiler-rt should be built correctly. Does the generated build file contain a "compiler-rt" target?
Obsolete?