make buildworld failed while upgrading 14-STABLE

Hi folks, I got the below error while trying to upgrading my FreeeBSD box. Could you let me know how to get around it? Thank you so much!

I followed instructions in /usr/src/UPDATING and run the below command first
# make delete-old
# make delete-old-libs
and deleted all these files. Maybe that is the issue and now the compiler complains missing headers while bootstrapping.
Code:
# uname -a
FreeBSD mybox 14.1-STABLE FreeBSD 14.1-STABLE

# cd /usr/src & make buildworld

--------------------------------------------------------------
>>> stage 1.2: bootstrap tools
--------------------------------------------------------------
cd /usr/src; time env INSTALL="sh /usr/src/tools/install.sh"  TOOLS_PREFIX=/usr/obj/usr/src/amd64.amd64/tmp  PATH=/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/libexec:/sbin:/bin:/usr/sbin:/usr/bin  WORLDTMP=/usr/obj/usr/src/amd64.amd64/tmp  MAKEFLAGS="-m /usr/src/tools/build/mk  -m /usr/src/share/mk" make  -f Makefile.inc1  DESTDIR=  OBJTOP='/usr/obj/usr/src/amd64.amd64/tmp/obj-tools'  OBJROOT='${OBJTOP}/'  UNIVERSE_TOOLCHAIN_PATH=  MAKEOBJDIRPREFIX=  BOOTSTRAPPING=1401500  BWPHASE=bootstrap-tools  -DNO_CPU_CFLAGS  -DNO_LINT  -DNO_PIC  -DNO_SHARED  MK_ASAN=no  MK_CTF=no  MK_CLANG_EXTRAS=no  MK_CLANG_FORMAT=no  MK_CLANG_FULL=no  MK_HTML=no  MK_MAN=no  MK_RETPOLINE=no  MK_SSP=no  MK_TESTS=no  MK_UBSAN=no  MK_WERROR=no  MK_INCLUDES=yes  MK_MAN_UTILS=yes MK_LLVM_TARGET_ALL=no _NO_INCLUDE_COMPILERMK=t _cleanobj_fast_depend_hack
>>> Deleting stale dependencies...
MACHINE=amd64 MACHINE_ARCH=amd64  ALL_libcompats=32  sh /usr/src/tools/build/depend-cleanup.sh /usr/obj/usr/src/amd64.amd64/tmp/obj-tools
        0.24 real         0.11 user         0.13 sys
cd /usr/src; time env INSTALL="sh /usr/src/tools/install.sh"  TOOLS_PREFIX=/usr/obj/usr/src/amd64.amd64/tmp  PATH=/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/libexec:/sbin:/bin:/usr/sbin:/usr/bin  WORLDTMP=/usr/obj/usr/src/amd64.amd64/tmp  MAKEFLAGS="-m /usr/src/tools/build/mk  -m /usr/src/share/mk" make  -f Makefile.inc1  DESTDIR=  OBJTOP='/usr/obj/usr/src/amd64.amd64/tmp/obj-tools'  OBJROOT='${OBJTOP}/'  UNIVERSE_TOOLCHAIN_PATH=  MAKEOBJDIRPREFIX=  BOOTSTRAPPING=1401500  BWPHASE=bootstrap-tools  -DNO_CPU_CFLAGS  -DNO_LINT  -DNO_PIC  -DNO_SHARED  MK_ASAN=no  MK_CTF=no  MK_CLANG_EXTRAS=no  MK_CLANG_FORMAT=no  MK_CLANG_FULL=no  MK_HTML=no  MK_MAN=no  MK_RETPOLINE=no  MK_SSP=no  MK_TESTS=no  MK_UBSAN=no  MK_WERROR=no  MK_INCLUDES=yes  MK_MAN_UTILS=yes MK_LLVM_TARGET_ALL=no bootstrap-tools
===> lib/clang/libllvmminimal (obj,all,install)
c++  -O2 -pipe -fno-common -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 -DLLVM_DEFAULT_TARGET_TRIPLE=\"x86_64-unknown-freebsd15.0\" -DLLVM_HOST_TRIPLE=\"x86_64-unknown-freebsd15.0\" -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 -gline-tables-only -MD -MF.depend.Demangle_ItaniumDemangle.o -MTDemangle/ItaniumDemangle.o -Wno-format-zero-length -Wdate-time -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-error=unused-but-set-parameter -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  -fno-exceptions -fno-rtti -gline-tables-only -std=c++17    -stdlib=libc++ -Wno-c++11-extensions    -c /usr/src/contrib/llvm-project/llvm/lib/Demangle/ItaniumDemangle.cpp -o Demangle/ItaniumDemangle.o
In file included from /usr/src/contrib/llvm-project/llvm/lib/Demangle/ItaniumDemangle.cpp:13:
In file included from /usr/src/contrib/llvm-project/llvm/include/llvm/Demangle/Demangle.h:12:
In file included from /usr/include/c++/v1/cstddef:36:
In file included from /usr/include/c++/v1/__assert:13:
In file included from /usr/include/c++/v1/__assertion_handler:14:
/usr/include/c++/v1/__verbose_abort:13:10: fatal error: '__availability' file not found
   13 | #include <__availability>
      |          ^~~~~~~~~~~~~~~~
1 error generated.
*** Error code 1

Stop.
make[3]: stopped in /usr/src/lib/clang/libllvmminimal
*** Error code 1

Stop.
make[2]: stopped in /usr/src
        0.97 real         0.63 user         0.34 sys
*** Error code 1

Stop.
make[1]: stopped in /usr/src
*** Error code 1

Stop.
make: stopped in /usr/src
[1]   Done                    cd /usr/src


# cc -v

FreeBSD clang version 18.1.6 ([URL]https://github.com/llvm/llvm-project.git[/URL] llvmorg-18.1.6-0-g1118c2e05e67)
Target: x86_64-unknown-freebsd14.1
Thread model: posix
InstalledDir: /usr/bin
[code]
# /etc/make.conf # this file is empty
 
well, I got around the above problem by upgrading the system using pkgbase, and all these headers are restored... It works fine but now I got a GENERIC kernel.

# uname -a
FreeBSD mybox 14.2-RELEASE FreeBSD 14.2-RELEASE releng/14.2-n269506-c8918d6c7412 GENERIC amd64

Is there a way to use customized kernel within the framework of pkgbase (without messing things around)?
 
How did you get sources? Did you use sources from Release-14.2? Did your kernel (from sources 14.2) build successfully?
Originally I have a local git repository at /usr/src for 14-STABLE (that one failed to compile due to missing headers).

Now my local copy of /usr/src has been overwritten by pkgbase. I haven't tried to compile kernel/world yet because I need to know the standard way to customize kernel with pkgbase, and there is not document explaining this.
 
I haven't tried to compile kernel/world yet because I need to know the standard way to customize kernel with pkgbase, and there is not document explaining this.
There is no standard way to customize kernel with pkgbase. In any case, a custom kernel must be build from source when the initial system installation originates from a fresh install of a official installation media, system upgrade from freebsd-update(8) or pkgbase.

This means: populate /usr/src (with the correct branch), make kernel-toolchain && make kernel.

For the time being, there is no handle to leave a copy of the existing kernel when system update is from pkgbase and the kernel is updated. The custom kernel gets overwritten with a GENERIC when packages are from a official repository.

See
How to handle /boot/kernel and /boot/kernel.$KERNCONF for multi-kernel support ...
and
Ensuring updating the kernel leaves a copy of the currently-running kernel (i.e. replacement for installkernel/freebsd-update kernel.old) for recovery, at least between releases, but ideally including patches
under "Goals, and additional unresolved issues" in the PkgBase wiki.
 
There is no standard way to customize kernel with pkgbase. In any case, a custom kernel must be build from source when the initial system installation originates from a fresh install of a official installation media, system upgrade from freebsd-update(8) or pkgbase.

This means: populate /usr/src (with the correct branch), make kernel-toolchain && make kernel.

For the time being, there is no handle to leave a copy of the existing kernel when system update is from pkgbase and the kernel is updated. The custom kernel gets overwritten with a GENERIC when packages are from a official repository.

See

and

under "Goals, and additional unresolved issues" in the PkgBase wiki.
The handbook says "It is never a good idea to use a different version of the kernel than the rest of the operating system." How do I make sure the source that is used to compile my customized kernel is in perfect sync with the rest of the FreeBSD, which is maintained by pkgbase?
 
How do I make sure the source that is used to compile my customized kernel is in perfect sync with the rest of the FreeBSD, which is maintained by pkgbase?
I don't know if there is a better way, a method I can think of is to get the commit hash from which the pkgbase GENERIC kernel is build from, then git checkout <hash>

Here, from a old test system, the highlighted number would be the partial commit hash (first 12 digits of 40).
Rich (BB code):
 # uname -v
FreeBSD 14.1-STABLE stable/14-n2682244-954692a14402 GENERIC

You can ask on the freebsd-pkgbase@ mailing list if there is a better method and any other questions that may arise.
 
Another way would be to use src package (if still exist on pkgbase), create custom kernel config alone, then build and install customized kernel.
Because for pkgbase at any point, src pkg should be exactly which the pkgs are built from. Beware not to mix multiple version of pkgbase (update all at once).
Anyway, my decision is to upgrade via building everything from src. ;)
 
This means: populate /usr/src (with the correct branch), make kernel-toolchain && make kernel.
I have a question: does make kernel-toolchain compile everything that is needed to compile the kernel? There is little document regarding this, unfortunately. The handbook only mentions to perform make buildworld buildkernel which obviously is an over-kill in my senario.

Yes, I have been able to compile the kernel based on FreeBSD-src-sys provided by pkgbase, which is in perfect sync with the system binaries installed by pkgbase.
Code:
# pkg info | grep -i kernel
FreeBSD-kernel-generic-14.2p2  FreeBSD GENERIC kernel
FreeBSD-src-sys-14.2p2         FreeBSD Kernel Sources

However the compiled binaries conflict with FreeBSD-kernel-generic and lead to many warnings like below while checking the pkg dependencies:
FreeBSD-kernel-generic-14.2p2: checksum mismatch for xxx
 
Back
Top