[PATCH] D103125: [Clang][WIP] Allow renaming of "clang"

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 25 16:22:58 PDT 2021


nemanjai created this revision.
nemanjai added reviewers: rjmccall, rsmith, craig.topper, t.p.northover, arsenm, kparzysz, echristo.
Herald added subscribers: usaxena95, s.egerton, kadircet, arphaman, delcypher, simoncook, mgorny.
nemanjai requested review of this revision.
Herald added subscribers: llvm-commits, Sanitizers, wdng.
Herald added projects: clang, Sanitizers, LLVM, clang-tools-extra.

It is likely that at least some vendors would like the ability to rename the clang executable to a proprietary name. That would allow a clear differentiation between the upstream clang and a proprietary downstream version of clang on the same system.

I am not sure if there are vendors that already do this downstream but it seems like a useful capability to allow that to be parameterized in the CMake configuration and an upstream buildbot to be added that builds with a different name. We at IBM certainly desire this capability and are willing to convert one of our upstream buildbots to such a build.

This patch provides a new CMake macro `CLANG_EXE_NAME` that can be used to specify the name of the clang executable. Then the symlinks to it (i.e. `clang-cl` and `clang++` will use that name and append the appropriate suffix). Furthermore, this patch updates test cases and utilities that use `clang` to use this name. The name is added to `llvm-config` so that it can be queried using `llvm-config --clang-exe` (which will return the full path with the correct name of the clang executable).

This is a work in progress because it is incomplete. Depending on the feedback on this review, the name change can affect the various `clang-xx` utilities, `libclang...` libraries, etc.

Please provide feedback if you think this is useful, not useful, a good/bad idea, good/bad technical direction etc.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103125

Files:
  clang-tools-extra/clangd/test/lit.site.cfg.py.in
  clang-tools-extra/test/CMakeLists.txt
  clang-tools-extra/test/lit.site.cfg.py.in
  clang/CMakeLists.txt
  clang/include/clang/Config/config.h.cmake
  clang/runtime/CMakeLists.txt
  clang/test/Analysis/check-analyzer-fixit.py
  clang/test/Analysis/scan-build/cxx-name.test
  clang/test/CMakeLists.txt
  clang/test/Driver/baremetal.cpp
  clang/test/Driver/check-time-trace.cpp
  clang/test/lit.cfg.py
  clang/test/lit.site.cfg.py.in
  clang/test/utils/update_cc_test_checks/lit.local.cfg
  clang/tools/clang-offload-bundler/CMakeLists.txt
  clang/tools/clang-offload-wrapper/CMakeLists.txt
  clang/tools/driver/CMakeLists.txt
  clang/utils/perf-training/CMakeLists.txt
  compiler-rt/cmake/Modules/AddCompilerRT.cmake
  compiler-rt/cmake/base-config-ix.cmake
  llvm/cmake/modules/LLVMExternalProjectUtils.cmake
  llvm/include/llvm/Config/config.h.cmake
  llvm/test/lit.site.cfg.py.in
  llvm/tools/llvm-config/llvm-config.cpp
  llvm/tools/llvm-rc/llvm-rc.cpp
  llvm/utils/lit/lit/llvm/config.py
  llvm/utils/update_cc_test_checks.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103125.347801.patch
Type: text/x-patch
Size: 32764 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210525/28da86a8/attachment.bin>


More information about the llvm-commits mailing list