由于在 Buildroot (stdio.h) 中缺少 GCC headers,无法构建包

Cannot build package due to missing GCC headers in Buildroot (stdio.h)

最近,我将 Buildroot 目录从 2019.11 更新到 2022.2,以便为新板 (RPi4B Rev1.5) 构建并访问更新的 Linux 内核和 headers。不幸的是,由于缺少 SWUpdate 包 headers,我一直无法构建。

错误摘录如下。完整的日志可以在 this link 找到(因为它很长)。

 CC      tools/swupdate-client.o
ipc/network_ipc-if.c:8:10: fatal error: stdio.h: No such file or directory
8 | #include <stdio.h>
  |          ^~~~~~~~~
ipc/network_ipc.c:9:10: fatal error: stdio.h: No such file or directory
9 | #include <stdio.h>
  |          ^~~~~~~~~
compilation terminated.
In file included from /home/haelyons/project_folder/buildroot/output/host/lib/gcc/arm- 
buildroot-linux-gnueabihf/10.3.0/include-fixed/syslimits.h:7,
             from /home/haelyons/project_folder/buildroot/output/host/lib/gcc/arm-buildroot- 
linux-gnueabihf/10.3.0/include-fixed/limits.h:34,
             from parser/parse_external.c:10:
/home/haelyons/project_folder/buildroot/output/host/lib/gcc/arm-buildroot-linux- 
gnueabihf/10.3.0/include-fixed/limits.h:195:15: fatal error: limits.h: No such file or 
directory

基本上,由于这是 Buildroot 中包含的一个包,我不确定问题是出在我安装的 GCC 上,还是出在包本身引用了不正确的文件夹上。如果可能的话,我将非常感谢一些正确方向的指示,例如我可以执行更多测试来诊断此问题。谢谢,H.

经过更多研究,发现这是 Buildroot 配置中分配的配置路径的问题。它指的是 RPi3 配置,它需要不同的内核和 GCC 版本。修复涉及以下内容:

make nconfig
# Navigate to: Target Packages > System Tools > SWUpdate Config Path
# Update the patch to the new board's config - BR2_EXTERNAL=<path>
make -C savedefconfig BR2_DEFCONFIG=../<config path>