无法< built-in>了解gcc错误输出的含义

elcex8rz  于 2022-11-13  发布在  其他
关注(0)|答案(1)|浏览(142)

我正在尝试调试u-boot构建失败。我发现了一个失败的命令:

$ 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.

问题是In file included from <built-in>:1:是什么意思?我如何理解从tools/envcrc.cinclude/compiler.h的包含路径?tools/envcrc.c没有直接包含compiler.hhttps://github.com/u-boot/u-boot/blob/v2022.07/tools/envcrc.c

ibps3vxo

ibps3vxo1#

如果你看一下命令行,有一个-include ./include/compiler.h选项,它告诉编译器包含那个文件,即使在任何源文件中都没有这样的#include指令。错误消息通常会说明包含include/compiler.h的源文件,但这里没有这样的文件,所以他们把<built-in>放在消息中。
实际的问题是include/compiler.h似乎使用了一个从未定义过的宏CONFIG_IS_ENABLED。您应该尝试调查为什么会这样,或者应该如何定义或在哪里定义它。

相关问题