linux - Yocto 上的 gcc-arm-linux-gnueabihf

标签 linux gcc yocto

我刚刚在我的 Ubuntu 上使用以下命令安装了一个 hardfloat 工具链

apt-get install gcc-arm-linux-gnueabihf

我想使用 hardfloat 工具链在 Yocto 上编译我的包。所以我将以下行添加到 conf/local.conf

TUNE_FEATURES ?= "armv7athf-neon"
SDK_PATH="/usr/arm-linux-gnueabihf"
TARGET_SYS = "arm-linux-gnueabihf"
PATH +=":${SDK_PATH}/bin"
CONFIGURE_FLAGS="--target=$TARGET_SYS --host=$TARGET_SYS --build=i686-linux --with-libtool-sysroot=$SYSROOT"
CPPFLAGS="-march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 --sysroot=$SYSROOT"
CFLAGS="$CPPFLAGS"
CXXFLAGS="$CPPFLAGS"
LDFLAGS="--sysroot=$SYSROOT"

但是在编译命令 bitbake gmp 之后我收到了这个错误:

| configure: error: --target is not appropriate for GMP
| Use --build=CPU-VENDOR-OS if you need to specify your CPU and/or system
| explicitly.  Use --host if cross-compiling (see "Installing GMP" in the
| manual for more on this).

关于 virtual:native:/home/dev/yocto/poky-daisy/meta/recipes-support/gmp/gmp_5.1.1.bb, do_configure

需要注意的是,在对 conf/local.conf 进行任何更改之前,一切都正常运行

最佳答案

我有同样的问题,当尝试编译arm-linux-gnueabihf

编辑 meta/recipes-support/gmp/gmp.inc 并添加

PACKAGECONFIG[host] = "--host=${HOST_SYS},--host=${TARGET_SYS},host"
EXTRA_OECONF += " --disable-assembly"

这是因为 gmt.inc 使用 autotools /meta/classes/autotools.bbclass 和 autotools.bbclass 中的变量 CONFIGUREOPTS 包含 --host=${HOST_SYS}

关于linux - Yocto 上的 gcc-arm-linux-gnueabihf,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26947430/

相关文章:

linux - Grep 并删除文件

c++ - QtCreator静态分析器在yocto上失败 “gnu/stubs-soft.h”丢失

yocto - 配方中的功能未被覆盖

linux - Yocto - 尝试使用实时内核版本

regex - find -regex 不适用于 {} 说明符

c++ - 可以将 2.1834e+14 转换为实数

linux - GNU Parallel - 如何使用输入参数捕获具有名称的文件中的输出

c++ - 函数没有实现宏?

c - 为什么在编译程序时我的 max 和 min int 不工作?

c - Printf 中的类型转换