This is an archive of the discontinued LLVM Phabricator instance.

[llvm-driver] Support single distributions
ClosedPublic

Authored by abrachet on Aug 5 2022, 8:47 PM.

Details

Summary

LLVM_DISTRIBUTION_COMPONENTS now influences the llvm binary in the
normal cmake output directory when it is set. This allows for
distribution targets to only include tools they want in the llvm
binary. It must be done this way because only one target can be
associated with a specific output name.

Diff Detail

Event Timeline

abrachet created this revision.Aug 5 2022, 8:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 5 2022, 8:47 PM
abrachet requested review of this revision.Aug 5 2022, 8:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 5 2022, 8:47 PM

Since distributions are used for selecting components that are distributed in the toolchain, and most vendors only have a single distribution, I'd prefer using the name llvm (rather than llvm-distribution) for the default distribution since that binary is going to be shipped in the toolchain (and "distribution" is an internal concept that users shouldn't be concerned with).

I wonder if we could use the following approach:

  • If LLVM_DISTRIBUTION_COMPONENTS isn't set, then combine all supported tools into llvm driver.
  • If LLVM_DISTRIBUTION_COMPONENTS is set, then combine all supported tools listed in LLVM_DISTRIBUTION_COMPONENTS into llvm driver and leave all other tools standalone.
  • (In the future) If LLVM_DISTRIBUTIONS is set, then combine all supported tools listed in LLVM_<name>_DISTRIBUTION_COMPONENTS into llvm-<name> driver and leave all other tools standalone.

What do you think?

llvm/cmake/modules/AddLLVM.cmake
2068

Should this apply to ${dest} as well?

llvm/tools/llvm-driver/CMakeLists.txt
31 ↗(On Diff #450465)

Nit: you can omit, variables in CMake don't need to be initialized.

abrachet updated this revision to Diff 464342.Sep 30 2022, 11:40 AM
abrachet edited the summary of this revision. (Show Details)
abrachet marked an inline comment as done.

Since distributions are used for selecting components that are distributed in the toolchain, and most vendors only have a single distribution, I'd prefer using the name llvm (rather than llvm-distribution) for the default distribution since that binary is going to be shipped in the toolchain (and "distribution" is an internal concept that users shouldn't be concerned with).

I wonder if we could use the following approach:

  • If LLVM_DISTRIBUTION_COMPONENTS isn't set, then combine all supported tools into llvm driver.
  • If LLVM_DISTRIBUTION_COMPONENTS is set, then combine all supported tools listed in LLVM_DISTRIBUTION_COMPONENTS into llvm driver and leave all other tools standalone.
  • (In the future) If LLVM_DISTRIBUTIONS is set, then combine all supported tools listed in LLVM_<name>_DISTRIBUTION_COMPONENTS into llvm-<name> driver and leave all other tools standalone.

What do you think?

Sounds good. 1 and 2 have been implemented and 3 has been saved for later

phosek accepted this revision.Sep 30 2022, 12:21 PM

LGTM

This revision is now accepted and ready to land.Sep 30 2022, 12:21 PM
This revision was landed with ongoing or failed builds.Oct 1 2022, 1:21 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 1 2022, 1:21 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript