[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH 2/5] build: add possibility to use LLVM tools
On Fri, Nov 29, 2024 at 08:57:47AM +0100, Jan Beulich wrote: > On 29.11.2024 02:49, Volodymyr Babchuk wrote: > > Currently, even if we are using clang as a C compiler, we still use > > GNU binutils. This patch adds new option "llvm" that allows to use > > linker, objcopy and all other tools from LLVM project. As LLVM tools > > use different approach for cross-compilation, we don't need > > CROSS_COMPILE prefix in this case. It might be worth explaining what this different approach is ;-). My guess is that you ask llvm/clang to build for a specific arch, via XEN_TARGET_ARCH=riscv64, and llvm doesn't need different binaries will just do what is needed, right? (with -march I guess). > This new option is meant to control both toolstack and hypervisor builds? > As to the latter, I assume you're aware we're trying to move away from > this kind of command line control of the build. Having "clang=y" is a bit useless when one can do "CC=clang" and let the build system figure out what CC is. That's at least true for the build system under "xen/". But if one want to use the whole LLVM toolchain, it as to write a lot more. To build Xen (just the hypervisor) with it, one would need to run: make CC=clang CXX=clang++ AS=llvm-as LD=ld.lld LD_LTO=llvm-lto \ ADDR2LINE=llvm-addr2line AR=llvm-ar RANLIB=llvm-ranlib NM=llvm-nm \ STRIP=llvm-strip OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump \ SIZEUTIL=llvm-size So while it's possible, maybe introducing "llvm" or "LLVM" to switch toolchain might be ok, to help. (Just because Linux did just that recently: https://www.kernel.org/doc/html/latest/kbuild/llvm.html#the-llvm-argument ) Beyond switching toolchain, I don't think $(llvm) or $(clang) should be used in the build system, and instead rely on autodetection for arguments. (There's already $(CONFIG_CC_IS_CLANG) and $(CONFIG_LD_IS_LLVM) in the hypervisor's build system, via Kconfig) At least for the hypervisor. For the toolstack, we should probably deal with toolchain in ./configure. Thanks, -- Anthony Perard | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |