make buildworld fails under FreeBSD 14.0-RELEASE

I recently did a successful(?) major upgrade of my server, from 13.2 to 14.0 RELEASE via the standard freebsd-update procedure, as documented well in the handbook. This is a typical procedure I successfully follower several times for minor and major upgrades.

Code:
root@DeathStar:/usr/src # uname -apKU
FreeBSD DeathStar 14.0-RELEASE-p2 FreeBSD 14.0-RELEASE-p2 #0: Tue Dec  5 00:31:31 UTC 2023     root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64 amd64 1400097 1400097

Nevertheless, I wanted to build world from source.
So I removed /usr/src directory by issuing the command rm -rf /usr/src and git clone the FreeBSD 14.0-RELEASE source code via the officially git repository, issuing the command git clone -o freebsd -b releng/14.0 https://git.FreeBSD.org/src.git /usr/src

I cd to the /usr/src directory and issued the following commands as root:
make cleanworld
make buildworld

During the >>> stage 1.2: bootstrap tools build, the compilation fails:

Code:
/usr/include/x86/stdarg.h:34:4: error: this file needs to be ported to your compiler
  #error this file needs to be ported to your compiler
   ^
/usr/src/contrib/llvm-project/llvm/lib/Support/PrettyStackTrace.cpp:241:3: error: use of undeclared identifier 'va_start'
  va_start(AP, Format);
  ^
/usr/src/contrib/llvm-project/llvm/lib/Support/PrettyStackTrace.cpp:243:3: error: use of undeclared identifier 'va_end'
  va_end(AP);
  ^
/usr/src/contrib/llvm-project/llvm/lib/Support/PrettyStackTrace.cpp:250:3: error: use of undeclared identifier 'va_start'
  va_start(AP, Format);
  ^
/usr/src/contrib/llvm-project/llvm/lib/Support/PrettyStackTrace.cpp:252:3: error: use of undeclared identifier 'va_end'
  va_end(AP);
  ^
5 errors generated.
*** Error code 1

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

The file /etc/make.conf is empty

If it helps, these ports are installed at my system:
Code:
llvm-15,1                      Meta-port for the default version of the LLVM Toolchain
llvm15-15.0.7_7                LLVM and Clang
gcc-12_5                       Meta-port for the default version of the GNU Compiler Collection
gcc12-12.2.0_6                 GNU Compiler Collection 12
gccmakedep-1.0.3               Create dependencies in makefiles using 'gcc -M'

Any help would be appreciated. Thanks in advance for your time and effort.
 
I have tried to build from ports the llvm15. The build failed
Code:
In file included from /usr/include/stdarg.h:5:
/usr/include/x86/stdarg.h:34:4: error: this file needs to be ported to your compiler
  #error this file needs to be ported to your compiler
   ^
1 error generated.
error: command '/usr/bin/cc' failed with exit code 1
*** Error code 1

Any clues?
 
Code:
root@DeathStar:~ # /usr/bin/cc -v
FreeBSD clang version 16.0.6 (https://github.com/llvm/llvm-project.git llvmorg-16.0.6-0-g7cbf1a259152)
Target: x86_64-unknown-freebsd14.0
Thread model: posix
InstalledDir: /usr/bin
 
Make sure your PATH is something like /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin. That is, build with standard tools in preference to local ones. Second, look at stdarg.h to see why the #error line is reached.
 
OK.

What are the first 20 lines of /usr/include/x86/stdarg.h?
Apart from the comments , these are the only lines in /usr/include/x86/stdarg.h
Code:
#ifndef _MACHINE_STDARG_H_
#define _MACHINE_STDARG_H_

#include <sys/_stdarg.h>

#ifndef va_start
  #error this file needs to be ported to your compiler
#endif

#endif /* !_MACHINE_STDARG_H_ */
 
Make sure your PATH is something like /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin. That is, build with standard tools in preference to local ones. Second, look at stdarg.h to see why the #error line is reached.
Code:
root@DeathStar:~ # echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin

/root/bin is an empty directory.
 
Make sure your PATH is something like /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin. That is, build with standard tools in preference to local ones. Second, look at stdarg.h to see why the #error line is reached.
also use "su -" instead of "su" to go to root.
 
Make sure your PATH is something like /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin. That is, build with standard tools in preference to local ones. Second, look at stdarg.h to see why the #error line is reached.

It says above that /usr/bin/cc has the problem.
 
Apart from the comments , these are the only lines in /usr/include/x86/stdarg.h
Code:
#ifndef _MACHINE_STDARG_H_
#define _MACHINE_STDARG_H_

#include <sys/_stdarg.h>

#ifndef va_start
  #error this file needs to be ported to your compiler
#endif

#endif /* !_MACHINE_STDARG_H_ */

What's in /usr/include/sys/_stdarg.h?
 
Try freebsd-update IDS and check if any of system headers (or anything else) was modified/not updated.
I run the above command.
Apart from some SHA256 mismatches regarding /etc/passwd and "similar" files, which is OK, there are some other "errors" such as the following:
Code:
...
/usr/src/contrib/bc/locales/de_AT.ISO8859-1.msg is a symlink, but should be a regular file.
...
/usr/src/sys/contrib/openzfs/cmd/zed/zed.d/pool_import-led.sh is a symlink, but should be a regular file.
/usr/src/sys/contrib/openzfs/cmd/zed/zed.d/resilver_finish-notify.sh is a symlink, but should be a regular file.
...
/usr/src/sys/contrib/openzfs/cmd/zpool/zpool.d/test_status is a symlink, but should be a regular file.
...

I don't see any "errors" for example regarding /usr/include, /usr/lib etc.
 
That shouldn’t be in PATH but given it was last, no harm done.
That should be in the PATH because I put it there. From time to time I use it for quick testing of my compiled apps. Most of the time is just an empty directory.
 
Should I try something like freebsd-update -F -r 14.0-RELEASE as it seems that somehow, during the upgrade, something went wrong.
Any suggestions?
 
Code:
root@DeathStar:/usr/include/sys # less _stdarg.h
"_stdarg.h" may be a binary file.  See it anyway?

yes, it is a binary file. Answering yes, displays @^ characters.
This is your problem. I would be concerned about the integrity of your system. If it is UFS, fsck it and make sure it is clean before any repairs. If zfs, see if there any any snapshots under /.zfs/snapshot/ and if so, they have the same file but undamaged. Check if there any other damaged files. To repair, copy it from /sys/sys.

Before doing anything major make sure your system is in good shape.

Should I try something like freebsd-update -F -r 14.0-RELEASE as it seems that somehow, during the upgrade, something went wrong.
I don’t use freebsd-update but seems you shouldn’t have to run it again, nor would it help if there is something wrong with your system. Is the root on zfs or ufs?

As cracauer also suggests, one thing you can try if space is not an issue & the root fs seems reasonably fine, is to download https://download.freebsd.org/releases/amd64/amd64/14.0-RELEASE/base.txz in a scratch directory, untar it and diff -r its usr/include against the standard one. Similarly for binaries and libraries.
 
Back
Top