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

为Yocto构建GoAccess配方时缺失ld-linux-armhf.so.3的解决咨询

Hi there! Let's work through your GoAccess Yocto recipe issues step by step:

1. Fixing the /lib/ld-linux-armhf.so.3 Error

This error is a classic cross-compilation gotcha—here's what's happening: the bin2c utility is being compiled for your target ARM architecture, but your build machine is x86. When the build process tries to run this ARM binary, it looks for the ARM dynamic linker (ld-linux-armhf.so.3) which doesn't exist on your x86 host.

The fix is to compile a host-compatible version of bin2c first, then tell the build system to use that instead of the cross-compiled one:

  • Add a pre-compile step to build bin2c with your host toolchain
  • Override the do_compile task to use this host binary

Here's how to implement it in your recipe:

do_compile_prepend() {
    # Build a version of bin2c that runs on your build host
    ${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} ${S}/tools/bin2c.c -o ${S}/tools/bin2c-host
}

do_compile() {
    # Use the host bin2c instead of the cross-compiled one
    oe_runmake BIN2C=${S}/tools/bin2c-host
}

And to clarify: ld-linux-armhf.so.3 is part of the glibc package for ARM targets, but you don't need to add it to DEPENDS—this isn't a missing dependency issue, it's a toolchain usage problem.

2. Recipe Cleanup & Optimizations

Your recipe has some redundant bits we can trim:

  • Remove unnecessary cd commands: The autotools class already sets ${S} as the working directory for do_configure and do_compile, so those cd ${S} lines are totally unnecessary and can be deleted.
  • Simplify configuration: Instead of overriding do_configure entirely, use the EXTRA_OECONF variable to pass your custom flags—this is the Yocto idiomatic way:
    EXTRA_OECONF = "--enable-utf8 --enable-geoip=legacy"
    
    You can then delete the entire do_configure function, since the autotools class will handle running configure with the correct host/build arguments plus your custom flags.
  • Drop the empty do_compile_prepend: The original empty cd ${S} block can be removed entirely once you add the bin2c pre-compile step.

3. Dependency Questions

Let's clear up your dependency doubts:

  • coreutils: You don't need this in DEPENDS. Yocto's build environment already provides all core utilities (like cat, sed, tr) via native packages or your build host's tools. Adding it here is redundant.
  • popt: To confirm if this is needed, check the GoAccess configure output (look for lines about popt) or run ./configure --help in the source tree to see if there's a --without-popt option. If it's not a hard requirement, you can safely remove it from DEPENDS.

Optimized Full Recipe

Putting it all together, here's your cleaned-up recipe:

SUMMARY = "GoAccess is an open source real-time web log analyzer and interactive viewer that runs in a terminal on *nix systems or through your browser."
HOMEPAGE = "https://goaccess.io"
SECTION = "console/utils"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://COPYING;md5=01c937f4a0ce3daba5ca22e80b53d24b"
DEPENDS = "ncurses geoip tokyocabinet gettext-native"
SRC_URI = "https://tar.goaccess.io/goaccess-${PV}.tar.gz"
SRC_URI[md5sum] = "6f4b60f87755a7d1b350badfedda0aa3"
SRC_URI[sha256sum] = "e8fbb9ff852556d72dfd9f1d0134ba075ce5b4c41289902a6f4e0d97c69377be"
S = "${WORKDIR}/goaccess-${PV}"

inherit autotools pkgconfig

EXTRA_OECONF = "--enable-utf8 --enable-geoip=legacy"

do_compile_prepend() {
    # Build host-compatible bin2c to avoid cross-compilation runtime issues
    ${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} ${S}/tools/bin2c.c -o ${S}/tools/bin2c-host
}

do_compile() {
    oe_runmake BIN2C=${S}/tools/bin2c-host
}

Final Tip

Before rebuilding, run bitbake goaccess -c cleanall to wipe any stale build artifacts—this ensures you're starting fresh with your updated recipe.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.08 20:12:55