Skip to content

Add compatibility with LLVM_DISTRIBUTION_COMPONENTS #693

@jonathonpenix

Description

@jonathonpenix

Background
LLVM_DISTRIBUTION_COMPONENTS is the documented/recommended way of building an LLVM distribution: https://github.com/llvm/llvm-project/blob/main/llvm/docs/BuildingADistribution.rst

Right now, I think eld is incompatible with this (adding eld into LLVM_DISTRIBUTION_COMPONENTS results in cmake failures) as it doesn't export the relevant install targets.

Reproducer
It's a bit of a silly example, but:

cmake -G Ninja \
   -DCMAKE_BUILD_TYPE=Release \
   -DCMAKE_INSTALL_PREFIX=$PWD/install \
   -DLLVM_ENABLE_ASSERTIONS:BOOL=ON \
   -DLLVM_ENABLE_PROJECTS='llvm;clang' \
   -DLLVM_EXTERNAL_PROJECTS=eld \
   -DLLVM_EXTERNAL_ELD_SOURCE_DIR=${PWD}/llvm-project/eld \
   -DLLVM_TARGETS_TO_BUILD='ARM;AArch64;RISCV' \
   -DELD_TARGETS_TO_BUILD='ARM;AArch64;RISCV' \
   -DCMAKE_CXX_FLAGS='-stdlib=libc++' \
   -DLLVM_DISTRIBUTION_COMPONENTS='clang;dsymutil;LTO;ld.eld;LW' \
   -B $PWD/build \
   -S ./llvm-project/llvm

produces the following errors:

CMake Error at cmake/modules/LLVMDistributionSupport.cmake:286 (message):
  Specified distribution component 'ld.eld' doesn't have an install target
Call Stack (most recent call first):
  CMakeLists.txt:1502 (llvm_distribution_add_targets)


CMake Error at cmake/modules/LLVMDistributionSupport.cmake:294 (message):
  Specified distribution component 'ld.eld' doesn't have an install-stripped
  target.  Its installation target creation should be changed to use
  add_llvm_install_targets, or you should manually create the
  'install-ld.eld-stripped' target.
Call Stack (most recent call first):
  CMakeLists.txt:1502 (llvm_distribution_add_targets)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions