Page MenuHomeFreeBSD

native-xtools: use static LLVM libraries
ClosedPublic

Authored by mhorne on Wed, Jan 21, 6:21 PM.
Tags
None
Referenced Files
F143925537: D54815.diff
Mon, Feb 2, 2:00 AM
Unknown Object (File)
Sun, Feb 1, 4:13 AM
Unknown Object (File)
Fri, Jan 30, 9:02 PM
Unknown Object (File)
Wed, Jan 28, 6:25 PM
Unknown Object (File)
Sun, Jan 25, 11:40 PM
Unknown Object (File)
Sun, Jan 25, 6:55 PM
Unknown Object (File)
Sun, Jan 25, 11:34 AM
Unknown Object (File)
Sat, Jan 24, 9:26 PM
Subscribers

Details

Summary

Set the MK_LLVM_LINK_STATIC_LIBRARIES knob to yes for the native-xtools
build target.

This addresses a build failure that occurs otherwise.

PR: 286710, 291409
MFC after: 3 days

Test Plan

build failure snippit from the PR, and I saw the same error locally:

--- llvm-ar ---
c++ -target x86_64-unknown-freebsd15.0 --sysroot=/usr/obj/aarch64/usr/src/amd64.amd64/nxb/arm64.aarch64/tmp -B/usr/obj/aarch64/usr/src/amd64.amd64/nxb/arm64.aarch64/tmp/usr/bin -O2 -pipe -fno-common -I/usr/obj/aarch64/usr/src/amd64.amd64/nxb/arm64.aarch64/lib/clang/libllvm -I/usr/src/lib/clang/include -I/usr/src/contrib/llvm-project/llvm/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DHAVE_VCS_VERSION_INC -DNDEBUG -DLLVM_DEFAULT_TARGET_TRIPLE=\"aarch64-unknown-freebsd15.0\" -DLLVM_HOST_TRIPLE=\"x86_64-unknown-freebsd15.0\" -DDEFAULT_SYSROOT=\"\" -DLLVM_TARGET_ENABLE_AARCH64 -DLLVM_TARGET_ENABLE_ARM -DLLVM_TARGET_ENABLE_POWERPC -DLLVM_TARGET_ENABLE_RISCV -DLLVM_TARGET_ENABLE_X86 -DLLVM_NATIVE_ASMPARSER=LLVMInitializeX86AsmParser -DLLVM_NATIVE_ASMPRINTER=LLVMInitializeX86AsmPrinter -DLLVM_NATIVE_DISASSEMBLER=LLVMInitializeX86Disassembler -DLLVM_NATIVE_TARGET=LLVMInitializeX86Target -DLLVM_NATIVE_TARGETINFO=LLVMInitializeX86TargetInfo -DLLVM_NATIVE_TARGETMC=LLVMInitializeX86TargetMC -ffunction-sections -fdata-sections -ffile-prefix-map=/usr/src=/usr/src -ffile-prefix-map=/usr/obj/aarch64/usr/src/amd64.amd64/nxb=/usr/obj -Wno-format-zero-length -Wdate-time -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-error=unused-but-set-parameter -Wno-error=cast-function-type-mismatch -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Wno-parentheses -Qunused-arguments -fno-exceptions -fno-rtti -ffile-prefix-map=/usr/src=/usr/src -ffile-prefix-map=/usr/obj/aarch64/usr/src/amd64.amd64/nxb=/usr/obj -std=c++17 -stdlib=libc++  -Wl,--gc-sections -Wl,-zrelro -static    -o llvm-ar  llvm-ar-driver.o llvm-ar.o /usr/obj/aarch64/usr/src/amd64.amd64/nxb/arm64.aarch64/lib/clang/libllvm/libprivatellvm.so  -lz  -lprivatezstd    -lcompiler_rt   -lcompiler_rt   -lcompiler_rt  -lexecinfo  -lelf  -ltinfow    -lcompiler_rt   -lcompiler_rt   -lcompiler_rt -lpthread -lc -lsys
c++: error: no such file or directory: '/usr/obj/aarch64/usr/src/amd64.amd64/nxb/arm64.aarch64/lib/clang/libllvm/libprivatellvm.so'
*** [llvm-ar] Error code 1

make[5]: stopped making "all" in /usr/src/usr.bin/clang/llvm-ar
make[5]: 1 error

make[5]: stopped making "all" in /usr/src/usr.bin/clang/llvm-ar

make[4]: stopped making "all" in /usr/src/usr.bin/clang
--- all_subdir_usr.bin/clang/llvm-nm ---

make[4]: stopped making "all" in /usr/src/usr.bin/clang
--- all_subdir_usr.bin/clang/clang ---

make[4]: stopped making "all" in /usr/src/usr.bin/clang
--- all_subdir_usr.bin/clang/clang-scan-deps ---

make[4]: stopped making "all" in /usr/src/usr.bin/clang

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 70045
Build 66928: arc lint + arc unit

Event Timeline

mhorne created this revision.

On the one hand we should be able to just bring along the necessary libraries for LLVM tools in whatever use case we have. On the other hand this is a simple and straightforward change to fix this case, which needs to work so fine with me.

Makefile.inc1
3208–3210

I guess the actual bug is related to this - we set MK_LLVM_BINUTILS=no here, and the PRs report failures in LLVM_BINUTILS tools like llvm-strings.

This revision is now accepted and ready to land.Wed, Jan 21, 7:49 PM

I confirm this change allows me to cross-build arm64 poudriere jails (from 13 to 15) on stable/15/amd64 which were broken otherwise since approx 202509

could you please commit and MFC this?

This revision was automatically updated to reflect the committed changes.