You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Buildroot编译host-heimdal失败求助:未修改相关配置却报错

问题:Buildroot编译host-heimdal失败,未手动配置相关选项

我的defconfig基于configs/raspberrypi3_64_defconfig稍作修改,内容如下:

$ cat defconfig 
BR2_aarch64=y
BR2_cortex_a53=y
BR2_ARM_FPU_VFPV4=y

# patches
BR2_GLOBAL_PATCH_DIR="board/raspberrypi/patches"
BR2_DOWNLOAD_FORCE_CHECK_HASHES=y

BR2_SYSTEM_DHCP="eth0"

# Linux headers same as kernel, a 6.6 series
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_6=y

BR2_TOOLCHAIN_BUILDROOT_CXX=y

BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,576cc10e1ed50a9eacffc7a05c796051d7343ea4)/linux-576cc10e1ed50a9eacffc7a05c796051d7343ea4.tar.gz"
BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi3"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="broadcom/bcm2710-rpi-3-b broadcom/bcm2710-rpi-3-b-plus broadcom/bcm2710-rpi-cm3"

BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y

BR2_PACKAGE_RPI_FIRMWARE=y
BR2_PACKAGE_RPI_FIRMWARE_BOOTCODE_BIN=y
BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI=y
BR2_PACKAGE_RPI_FIRMWARE_CONFIG_FILE="board/raspberrypi3-64/config_3_64bit.txt"

# Required tools to create the SD image
BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_MTOOLS=y

# Filesystem / image
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
# BR2_TARGET_ROOTFS_TAR is not set
BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi3-64/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi3-64/post-image.sh"

# Enable compressed kernel module support
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
BR2_PACKAGE_KMOD_TOOLS=y
BR2_PACKAGE_XZ=y
BR2_PACKAGE_KMOD=y
BR2_PACKAGE_HOST_KMOD_XZ=y

执行make命令后编译失败,最后几行输出如下:

checking for library containing yywrap... -ll
checking for gawk... (cached) gawk
checking for ln -s or something else... ln -s
checking for __attribute__... no
checking for ld --version-script... yes
checking whether C compiler accepts -Wno-error=enum-conversion... yes
checking whether C compiler accepts -Wno-unused-but-set-variable... yes
checking for openldap... no
checking pkg-config is at least version 0.9.0... yes
checking for MICROHTTPD... no
checking for CJWT... no
checking for CJSON... no
checking for sqlite3... no
checking for libintl... no
checking for crypto library... included libhcrypto
checking if compiling threadsafe libraries... yes
checking for inline... inline
checking for an ANSI C-conforming const... yes
checking for size_t... no
checking for egrep... (cached) /usr/bin/grep -E
checking for pid_t... no
checking for uid_t... no
checking for gid_t... no
checking return type of signal handlers... void
checking for standards.h... no
checking for netinet/ip.h... no
checking for netinet/tcp.h... no
checking for egrep -e... (cached) /usr/bin/grep -E
checking for /home/mark/dev/buildroot/output/host/bin/ccache /usr/bin/gcc  options needed to detect all undeclared functions... cannot detect
configure: error: in '/home/mark/dev/buildroot/output/build/host-heimdal-f4faaeaba371fff3f8d1bc14389f5e6d70ca8e17':
configure: error: cannot make /home/mark/dev/buildroot/output/host/bin/ccache /usr/bin/gcc  report undeclared builtins
See 'config.log' for more details
make[1]: *** [package/pkg-generic.mk:279: /home/mark/dev/buildroot/output/build/host-heimdal-f4faaeaba371fff3f8d1bc14389f5e6d70ca8e17/.stamp_configured] Errore 1
make: *** [Makefile:83: _all] Errore 2

我在xconfig中搜索host-heimdal找不到相关选项,也从未修改过和它相关的配置,请问编译失败的原因是什么?

补充信息:

  • Buildroot版本:2024.08-rc3
  • 获取方式:git clone
  • 主机系统:Ubuntu 24.04

解答
  • host-heimdal被触发的原因:它是Buildroot中部分工具的隐式依赖,比如你启用了BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y,可能会通过依赖链间接拉取该包;另外2024.08-rc3作为候选版本,依赖关系处理可能存在变动,导致该包被自动加入编译流程。

  • 编译失败的直接原因:Ubuntu 24.04的系统gcc与ccache结合时,heimdal的configure脚本无法正确识别编译器特性,无法确认如何让编译器报告未声明的内置函数,最终触发配置错误。

  • 解决方法:

    1. 临时禁用ccache:在defconfig中添加BR2_CCACHE=n,或者执行make BR2_CCACHE=n重新编译。
    2. 升级Buildroot版本:切换到2024.08正式版或更新的git提交,这类候选版本的兼容性问题通常会在正式版中修复。
    3. 补全主机依赖:在Ubuntu 24.04上安装heimdal编译所需的系统包,执行sudo apt-get install libssl-dev flex bison后重试。

内容的提问来源于stack exchange,提问作者Mark

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.18 17:55:58