wrapper: Handle 5.18 updates to LLVM variable
Linux commit e9c281928c24 ("kbuild: Make $(LLVM) more flexible") adjusted the $(LLVM)
variable to have two additional meanings/forms other than 1:
-
LLVM=<bin_path>/
to build with<bin_path>/clang
, link with<bin_path>/ld.lld
, etc. -
LLVM=-<number>
to build withclang-<number>
, link withld.lld-<number>
, etc.
This allows users to easily use their own toolchains on disk or versioned LLVM toolchains from their distribution.
The tuxmake
compiler wrapper logic does not handle these situations:
$ tuxmake -t llvm -w ccache default LLVM=.../16.0.6/bin/
...
make --silent --keep-going --jobs=128 O=... LLVM=.../16.0.6/bin/ 'CC=ccache gcc' 'HOSTCC=ccache gcc' defconfig
...
Adjust the wrapper logic to handle all three meanings of $(LLVM)
.
One small note: The old logic would only assume clang
as the compiler when LLVM
is set to 1
. The new logic assumes clang
as the compiler whenever LLVM
is set, which is more in line with kbuild's own logic.