This is an archive of the discontinued LLVM Phabricator instance.

[BOLT][CMAKE] Use BOLT_CLANG_EXE and BOLT_LLD_EXE as is
ClosedPublic

Authored by Amir on Jan 16 2022, 6:10 PM.

Details

Summary

Add an ability to provide paths that don't match tool name exactly:
e.g. clang-13.
Remove use_lld call that sets up unused extra tools.

Test plan:

cmake -G Ninja ../llvm-project/llvm -DLLVM_TARGETS_TO_BUILD="X86;AArch64" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_PROJECTS="bolt" -DBOLT_CLANG_EXE=/usr/bin/clang-13 -DBOLT_LLD_EXE=/usr/bin/lld-13 
...
llvm-lit: /data/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using clang: /usr/bin/clang-13
llvm-lit: /data/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using lld: /usr/bin/lld-13

cmake -G Ninja ../llvm-project/llvm -DLLVM_TARGETS_TO_BUILD="X86;AArch64" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_PROJECTS="bolt;lld" -DBOLT_CLANG_EXE=/usr/bin/clang-13
...
llvm-lit: /data/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using clang: /usr/bin/clang-13
llvm-lit: /data/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using lld: /data/llvm-build2/bin/lld

cmake -G Ninja ../llvm-project/llvm -DLLVM_TARGETS_TO_BUILD="X86;AArch64" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_PROJECTS="bolt;clang;lld" 
...
llvm-lit: /data/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using clang: /data/llvm-build3/bin/clang
llvm-lit: /data/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using lld: /data/llvm-build3/bin/lld

Diff Detail

Event Timeline

Amir created this revision.Jan 16 2022, 6:10 PM
Amir requested review of this revision.Jan 16 2022, 6:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 16 2022, 6:10 PM
Amir edited the summary of this revision. (Show Details)Jan 16 2022, 10:15 PM
Amir updated this revision to Diff 400621.Jan 17 2022, 12:30 PM

Use CLANG and LLD environment variables, removing the dependence on
https://reviews.llvm.org/D117445

maksfb accepted this revision.Jan 18 2022, 7:33 PM
This revision is now accepted and ready to land.Jan 18 2022, 7:33 PM
This revision was landed with ongoing or failed builds.Jan 18 2022, 9:14 PM
This revision was automatically updated to reflect the committed changes.