I'm trying to debug u-boot build failure. I've found single command that fails:
$ gcc -v -Wp,-MD,tools/.envcrc.o.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu11 -DCONFIG_FIT_SIGNATURE -DCONFIG_FIT_SIGNATURE_MAX_SIZE=0xffffffff -DCONFIG_FIT_CIPHER -include ./include/compiler.h -idirafterinclude -idirafter./arch/arm/include -I./scripts/dtc/libfdt -I./tools -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -D_GNU_SOURCE -c -o tools/envcrc.o tools/envcrc.c
clang version 11.1.0
Target: aarch64-apple-darwin
Thread model: posix
InstalledDir: /nix/store/vj903fik1afanjnrmkxxlf56lxharyrn-clang-11.1.0/bin
(in-process)
"/nix/store/vj903fik1afanjnrmkxxlf56lxharyrn-clang-11.1.0/bin/clang-11" -cc1 -triple arm64-apple-macosx11.0.0 -Wundef-prefix=TARGET_OS_ -Werror=undef-prefix -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name envcrc.c -mrelocation-model pic -pic-level 2 -mframe-pointer=none -fno-rounding-math -munwind-tables -fcompatibility-qualified-id-block-type-checking -target-cpu apple-a13 -target-feature +v8.3a -target-feature +crypto -target-feature +crc -target-feature +fullfp16 -target-feature +lse -target-feature +neon -target-feature +ras -target-feature +rdm -target-feature +rcpc -target-feature +zcm -target-feature +zcz -target-feature +sha2 -target-feature +aes -target-abi darwinpcs -fallow-half-arguments-and-returns -debugger-tuning=lldb -target-linker-version 530 -v -nostdsysteminc -resource-dir /nix/store/b9bh3z78rqff14bf0fd78xb07b5cnwdw-clang-wrapper-11.1.0/resource-root -dependency-file tools/.envcrc.o.d -MT tools/envcrc.o -sys-header-deps -include ./include/compiler.h -idirafter include -idirafter ./arch/arm/include -idirafter /nix/store/amkqyy3v347mkdd9x1116nawinnc1r3j-libSystem-11.0.0/include -isystem /nix/store/zfya80qwrpl6lf06k8r9dmjvgi9rzdam-libcxx-11.1.0-dev/include -isystem /nix/store/m0jxx2yxfw0pma1l9ajnhlsmdqdl6mn2-libcxxabi-11.1.0-dev/include -isystem /nix/store/yrig22cjci7sdr8csgr8l0bhkjprxfd8-dtc-1.6.1/include -isystem /nix/store/xdrpnixj0wijcb2gqkah3gz4cx3b89iz-flex-2.6.4/include -isystem /nix/store/a3kk9mqy6axn7k0zg46r6jg03gs4vgv2-openssl-1.1.1q-dev/include -isystem /nix/store/9lmynkzmnzdhnq6j0ckwqs2fvv7lxr0n-python3-3.10.6-env/include -D CONFIG_FIT_SIGNATURE -D CONFIG_FIT_SIGNATURE_MAX_SIZE=0xffffffff -D CONFIG_FIT_CIPHER -I ./scripts/dtc/libfdt -I ./tools -D USE_HOSTCC -D __KERNEL_STRICT_NAMES -D _GNU_SOURCE -internal-isystem /nix/store/b9bh3z78rqff14bf0fd78xb07b5cnwdw-clang-wrapper-11.1.0/resource-root/include -O2 -Wall -Wstrict-prototypes -std=gnu11 -fdebug-compilation-dir /Users/zaripov-kamil/Documents/code/nixpkgs/u-boot-2022.07 -ferror-limit 19 -stack-protector 1 -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fmax-type-align=16 -fcolor-diagnostics -vectorize-loops -vectorize-slp -o tools/envcrc.o -x c tools/envcrc.c
clang -cc1 version 11.1.0 based upon LLVM 11.1.0 default target aarch64-apple-darwin21.2.0
#include "..." search starts here:
#include <...> search starts here:
./scripts/dtc/libfdt
./tools
/nix/store/zfya80qwrpl6lf06k8r9dmjvgi9rzdam-libcxx-11.1.0-dev/include
/nix/store/m0jxx2yxfw0pma1l9ajnhlsmdqdl6mn2-libcxxabi-11.1.0-dev/include
/nix/store/yrig22cjci7sdr8csgr8l0bhkjprxfd8-dtc-1.6.1/include
/nix/store/xdrpnixj0wijcb2gqkah3gz4cx3b89iz-flex-2.6.4/include
/nix/store/a3kk9mqy6axn7k0zg46r6jg03gs4vgv2-openssl-1.1.1q-dev/include
/nix/store/9lmynkzmnzdhnq6j0ckwqs2fvv7lxr0n-python3-3.10.6-env/include
/nix/store/b9bh3z78rqff14bf0fd78xb07b5cnwdw-clang-wrapper-11.1.0/resource-root/include
include
./arch/arm/include
/nix/store/amkqyy3v347mkdd9x1116nawinnc1r3j-libSystem-11.0.0/include
End of search list.
In file included from <built-in>:1:
In file included from ././include/compiler.h:23:
include/errno.h:28:5: error: function-like macro 'CONFIG_IS_ENABLED' is not defined
#if CONFIG_IS_ENABLED(ERRNO_STR)
^
In file included from <built-in>:1:
In file included from ././include/compiler.h:24:
In file included from include/stdlib.h:9:
In file included from include/malloc.h:369:
In file included from include/linux/string.h:21:
In file included from ./arch/arm/include/asm/string.h:4:
In file included from include/config.h:4:
include/configs/qemu-arm.h:33:5: error: function-like macro 'CONFIG_IS_ENABLED' is not defined
#if CONFIG_IS_ENABLED(CMD_USB)
^
include/configs/qemu-arm.h:39:5: error: function-like macro 'CONFIG_IS_ENABLED' is not defined
...
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
The question is what In file included from <built-in>:1:
does mean? How can I understand exact include path from tools/envcrc.c
which I'm trying to compile to include/compiler.h
? tools/envcrc.c
didn't include compiler.h
directly: https://github.com/u-boot/u-boot/blob/v2022.07/tools/envcrc.c.
If you look at the command line, there is the option -include ./include/compiler.h
, which tells the compiler to include that file even though there is no such #include
directive in any source file. The error message would normally state the source file from which include/compiler.h
was included, but here there is no such file, so they put <built-in>
in the message instead.
The actual issue is that include/compiler.h
seems to be using a macro CONFIG_IS_ENABLED
which was never defined. You should try to investigate why that is, or how or where it was supposed to be defined.