Re: stable does not compile, llvm error

From: Tom Vogt <freebsdlists_at_bsdunix.ch>
Date: Tue, 18 Apr 2023 17:41:51 UTC
Hi Dimitry,

Am 16/04/2023 um 20:57 schrieb Dimitry Andric:
> On 16 Apr 2023, at 20:32, Tom Vogt <freebsdlists@bsdunix.ch> wrote:
>>
>> I try to compile the latest 13 stable version but it fails with an llvm error.
>>
>> My working version is:
>> 13.2-STABLE stable/13-3cea7ca84 GENERIC amd64
>>
>> The version I try o compile is:
>> git show -s
>> commit 3e9d966ce45e3971c295a1dff7435d6b9f1321da (grafted, HEAD -> stable/13, origin/stable/13)
>>
>> Compile:
>> make -j `sysctl -n hw.ncpu` buildworld buildkernel && make installkernel
>>
>> Error:
>> cc  -O2 -pipe -fno-common -I/usr/obj/usr/src/amd64.amd64/tmp/obj-tools/lib/clang/libllvm -I/usr/src/contrib/llvm-project/llvm/lib/Target/X86 -I/usr/src/contrib/llvm-project/llvm/lib/ObjCopy -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=\"x86_64-unknown-freebsd13.2\" -DLLVM_HOST_TRIPLE=\"x86_64-unknown-freebsd13.2\" -DDEFAULT_SYSROOT=\"/usr/obj/usr/src/amd64.amd64/tmp\" -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 -MD  -MF.depend.Support_BLAKE3_blake3.o -MTSupport/BLAKE3/blake3.o -std=gnu99 -Wno-format-zero-length -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-error=unused-but-set-variable -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 -I/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/include -c /usr/src/contrib/llvm-project/llvm/lib/Support/BLAKE3/blake3.c -o Support/BLAKE3/blake3.o
>> In file included from /usr/src/contrib/llvm-project/llvm/lib/Support/BLAKE3/blake3.c:13:
>> /usr/src/contrib/llvm-project/llvm/lib/Support/BLAKE3/blake3_impl.h:61:10: fatal error: 'immintrin.h' file not found
>> #include <immintrin.h>
>>          ^~~~~~~~~~~~~
> 
> This type of error pops up every once in a while, and it usually turns
> out that people deleted their /usr/lib/clang directory for some reason,
> or if they did a packaged base install, they did not install the
> toolchain packages.
> 
> In any case, you will have to restore the files in /usr/lib/clang for
> the build to continue.
> 

Thank you. Looks like I've compiled stable once without toolchain. 
Installing llvm15 package and use CROSS_TOOLCHAIN=llvm15 during make 
world did it.

Regards,
Tom