On 09/04/2025 2:54 pm, Andriy Gapon wrote:
Host clang:
$ clang --version
FreeBSD clang version 19.1.4 (https://github.com/llvm/llvm-project.git llvmorg-19.1.4-0-gaadaa00de76e)
Target: x86_64-unknown-freebsd15.0
Thread model: posix
InstalledDir: /usr/bin
Build config: +assertions

Oh, and probably something that I should have mentioned (and recalled myself) from the start.  This is a build for a disk-constrained system, so it have these in its src.conf:

WITHOUT_CLANG=yes
WITH_LLVM_TARGET_X86=yes                # to undo effect of WITHOUT_CLANG

I am not sure where i picked up those, but I suspect that this kind of muckery with the toolchain can result in problems.

Okay, WITHOUT_WERROR did help, obviously.
But then I got another problem related to the use of -flto in usr.bin/gh-bc.
It caused .o files to be LLVM IR bitcode instead of "normal" object files.

My best guess now is that my combination of WITHOUT_CLANG and WITH_LLVM_TARGET_X86 causes a wrong (host) compiler to be used in the build.

My goal with those flags was to not build clang/llvm for the target, but to have them for the correct cross-build. But apparently the flags do not do that (any longer).

What's interesting is that I saw this during the build (make with -s option):
--------------------------------------------------------------
>>> stage 3: cross tools
--------------------------------------------------------------
===> lib/clang (obj,all,install)
===> lib/clang/libllvm (all)
===> lib/clang/libllvm (install)
===> usr.bin/clang (obj,all,install)
===> usr.bin/clang/lld (obj,all,install)
===> lib/libelftc (obj,all,install)
===> lib/libpe (obj,all,install)
===> usr.bin/elfctl (obj,all,install)
===> usr.bin/elfdump (obj,all,install)
===> usr.bin/objcopy (obj,all,install)
===> usr.bin/nm (obj,all,install)
===> usr.bin/size (obj,all,install)
===> usr.bin/strings (obj,all,install)
===> usr.bin/addr2line (obj,all,install)
===> cddl/lib/libctf (obj,all,install)
===> cddl/lib/libspl (obj,all,install)
===> cddl/usr.bin/ctfconvert (obj,all,install)
===> cddl/usr.bin/ctfmerge (obj,all,install)
===> stand/usb/tools (obj,all,install)
        2.15 real         1.64 user         0.50 sys
        0.05 real         0.00 user         0.04 sys

Trying now a build with WITHOUT_CLANG (as before) but without 
WITH_LLVM_TARGET_X86.

--
Andriy Gapon

Reply via email to