Page MenuHomePhabricator

[CMake] Use top-level CMake file when building compiler-rt builtins

Authored by phosek on Aug 29 2016, 12:59 PM.



Using compiler-rt/lib/builtins CMake file to build builtins forces compiler-rt CMake build to assume that it is being built as standalone which results in builtins being installed in the library directory instead of Clang resource directory as it does when compiler-rt is built from within projects. Using top-level CMake file to build compiler-rt builtins solves this issue.

Diff Detail

Event Timeline

phosek updated this revision to Diff 69603.Aug 29 2016, 12:59 PM
phosek retitled this revision from to [CMake] Use top-level CMake file when building compiler-rt builtins.
phosek updated this object.
phosek added a reviewer: beanz.
phosek set the repository for this revision to rL LLVM.
phosek added a subscriber: llvm-commits.
beanz requested changes to this revision.Aug 29 2016, 1:02 PM
beanz edited edge metadata.

The entire point of using the subdirectory as the entry point is that the compiler capabilities checks do not require a fully functioning cross toolchain. This is essential for bootstraps in many situations.

The correct fix here would be to override the install path, not stop using the subdirectory.

This revision now requires changes to proceed.Aug 29 2016, 1:02 PM

Alternatively, we could modify compiler-rt's CMake build to use llvm-config to figure out the correct install path and Clang version when being built as standalone (although that's somewhat orthogonal to this issue).

beanz added a comment.Aug 29 2016, 1:28 PM

rL280002 should resolve this.

phosek abandoned this revision.Aug 29 2016, 2:04 PM