This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Add `project` in `runtime/CMakeList.txt`
ClosedPublic

Authored by aoli on Jul 19 2017, 3:55 PM.

Details

Summary
  • project is required when runtime/CMakeList.txt is the top-level CMakeList.txt file. This will establish version and policy settings.

Diff Detail

Repository
rL LLVM

Event Timeline

aoli created this revision.Jul 19 2017, 3:55 PM
aoli added a subscriber: llvm-commits.
aoli updated this revision to Diff 107421.Jul 19 2017, 5:10 PM

Add stage2 dependencies.

aoli edited the summary of this revision. (Show Details)Jul 19 2017, 5:12 PM
aoli updated this revision to Diff 107744.Jul 21 2017, 3:50 PM

Remove -Wl,-z,defs.

aoli edited the summary of this revision. (Show Details)Jul 21 2017, 3:50 PM
srhines added inline comments.Jul 27 2017, 11:58 AM
runtimes/CMakeLists.txt
429 ↗(On Diff #107744)

Is this dependency needed now? I assume runtimes depends on runtimes-configure, but maybe I am mistaken.

aoli updated this revision to Diff 108551.Jul 27 2017, 4:44 PM

Remove dependency. Update comments.

pirama edited edge metadata.Aug 21 2017, 5:43 PM

Chris, can you look at this change? This can help simplify the build setup for the Clang used in Android.

beanz added inline comments.Aug 22 2017, 3:54 PM
runtimes/CMakeLists.txt
429 ↗(On Diff #107744)

Uh... This part of the patch should be done differently.

This hack is in place because of how clang finds c++ headers relative to itself, so we need to configure the runtimes directory (which copies the c++ headers) otherwise we can't actually build anything with the stage1 compiler.

Making clang-bootstrap-deps depend on the runtimes target should be done separately only if the next stage build is intending to link against runtime libraries from the stage1 build, and even then I'm not sure we should be depending on the runtimes target, I'd much rather the dependency was setup on the top-level target for the runtime library (i.e. libcxx, libunwind, compiler-rt...).

aoli added inline comments.Aug 22 2017, 4:24 PM
runtimes/CMakeLists.txt
429 ↗(On Diff #107744)

I agree.

Shall we bring some new variables like LLVM_USE_STAGE1_LIBCXX, LLVM_USE_STAGE1_LIBUNWIND ...?

beanz added inline comments.Aug 28 2017, 9:45 AM
runtimes/CMakeLists.txt
429 ↗(On Diff #107744)

Configuring the bootstrap builds is currently done in Clang, not LLVM. We probably want an option like BOOTSTRAP_USE_<libname> which we can interpret in <clang>/CMakeLists.txt where we handle the other bootstrap options.

We don't want the option to name a specific stage because we do support many-layered bootstraps.

aoli updated this revision to Diff 113025.Aug 28 2017, 11:07 PM

Revert adding dependencies.

aoli added inline comments.Aug 28 2017, 11:10 PM
runtimes/CMakeLists.txt
429 ↗(On Diff #107744)

I reverted this change and I'll bring a new patch to add bootstrap options.

aoli added inline comments.Aug 28 2017, 11:24 PM
runtimes/CMakeLists.txt
429 ↗(On Diff #107744)

By using BOOTSTRAP_USE_<libname>, it will also pass USE_<libname> as variables to stage2 because the variables start with BOOTSTRAP_. To avoid passing unused variables, shall we use CLANG_BOOTSTRAP_USE_<libname> or something better?

beanz added inline comments.Aug 29 2017, 3:13 PM
runtimes/CMakeLists.txt
429 ↗(On Diff #107744)

Good call. CLANG_BOOTSTRAP_... is a good way to go.

beanz accepted this revision.Aug 29 2017, 3:14 PM

LGTM.

This revision is now accepted and ready to land.Aug 29 2017, 3:14 PM
aoli updated this revision to Diff 113494.Aug 31 2017, 6:05 PM

Remove redundant logic.

aoli retitled this revision from [CMake] Add more runtime configurations. to [CMake] Add `project` in `runtime/CMakeList.txt`.Aug 31 2017, 6:06 PM
aoli edited the summary of this revision. (Show Details)
This revision was automatically updated to reflect the committed changes.