This is an archive of the discontinued LLVM Phabricator instance.

[runtimes] adds llvm-libgcc to the list of runtimes to be sorted
ClosedPublic

Authored by cjdb on Jun 24 2022, 5:23 PM.

Details

Reviewers
phosek
jdoerfert
ldionne
Group Reviewers
Restricted Project
Restricted Project
Commits
rGef0b20d8e8db: [runtimes] adds llvm-libgcc to the list of runtimes to be sorted
Summary

llvm-libgcc is not a part of LLVM_ALL_RUNTIMES because llvm-libgcc is
incompatible with an explicit libunwind and compiler-rt. This meant that
it was being filtered out and not built.

Diff Detail

Event Timeline

cjdb created this revision.Jun 24 2022, 5:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 24 2022, 5:23 PM
Herald added a subscriber: mgorny. · View Herald Transcript
cjdb requested review of this revision.Jun 24 2022, 5:23 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 24 2022, 5:23 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Herald added a reviewer: Restricted Project. · View Herald Transcript
phosek accepted this revision.Jun 24 2022, 7:14 PM

LGTM

ldionne added inline comments.
runtimes/CMakeLists.txt
18–25

I'd like to suggest this instead:

set(LLVM_DEFAULT_RUNTIMES "libc;libunwind;libcxxabi;libcxx;compiler-rt;openmp")
set(LLVM_ALL_RUNTIMES "${LLVM_DEFAULT_RUNTIMES};llvm-libgcc")
set(LLVM_ENABLE_RUNTIMES "" CACHE STRING
  "Semicolon-separated list of runtimes to build (which must be in ${LLVM_ALL_RUNTIMES}), or \"all\", in which case the following set of default runtimes will be used: ${LLVM_DEFAULT_RUNTIMES}.")
if(LLVM_ENABLE_RUNTIMES STREQUAL "all" )
  set(LLVM_ENABLE_RUNTIMES ${LLVM_DEFAULT_RUNTIMES})
endif()
include(SortSubset)
sort_subset("${LLVM_ALL_RUNTIMES}" "${LLVM_ENABLE_RUNTIMES}" LLVM_ENABLE_RUNTIMES)

This opens the door to adding other "alternative" runtimes that are not selected by default when one uses all. Note that all becomes a slight misnomer, but it seems like it already is anyway cause there exists some runtimes (such as llvm-libgcc) that are not selected by all.

cjdb updated this revision to Diff 440775.Jun 28 2022, 2:50 PM

makes requested change

cjdb added inline comments.Jun 28 2022, 2:50 PM
runtimes/CMakeLists.txt
18–25

Thanks for the improvement, this should future-proof it.

I'm okay with duping users into thinking that all still means everything, because it does from a user's perspective. llvm-libgcc is incompatible with compiler-rt and libunwind because it builds them both with strict opinions (and then does extra stuff). As a user, even I'm not supposed to install llvm-libgcc and expect it to work. That's something only toolchain release managers who own pretty much everything (that would be cjdb@ only when concerned with the ChromeOS toolchain). That's a really small group of people to cater for, and llvm-libgcc actually makes them go quite out of their way to say "yes, I know what I'm doing!" before it'll build for them.

I think the same should be true for anything else that shouldn't be covered by default, so I've left the LLVM_ENABLE_RUNTIMES description unchanged (but this should otherwise be the same as your suggestion).

ldionne accepted this revision.Jun 30 2022, 7:02 AM
This revision is now accepted and ready to land.Jun 30 2022, 7:02 AM
This revision was landed with ongoing or failed builds.Jun 30 2022, 4:51 PM
This revision was automatically updated to reflect the committed changes.