简体   繁体   English

Arm (armhf) 的交叉编译增强失败,模块“警告功能”中未知

[英]Cross compiling boost for Arm (armhf) fails with unknown in module "warnings-feature"

Following the Boost "Cross-compilation" instructions here ,按照此处的 Boost“交叉编译”说明,

Having already run bootstrap.sh , and created a local, native b2 .已经运行bootstrap.sh ,并创建了一个本地的、原生的b2

And using a user-config.jam of:并使用user-config.jam的:

using gcc : arm :arm-linux-gnueabihf-g++ ;

Kicking off the build:开始构建:

./b2 toolset=gcc-arm target-os=linux

Boost's b2 spits out a bunch of error messages, and halts: Boost 的b2吐出一堆错误信息,然后停止:

username@ubuntu:~/Code/boost_1_81_0$ ./b2 toolset=gcc-arm target-os=linux
/home/username/Code/boost_1_81_0/tools/build/src/util/numbers.jam:23: in numbers.check from module numbers
error: arm in arm
error: is not a number
/home/username/Code/boost_1_81_0/tools/build/src/build/version.jam:110: in version.version-compatible from module version
/home/username/Code/boost_1_81_0/tools/build/src/tools/common.jam:1132: in common.find-compiler from module common
/home/username/Code/boost_1_81_0/tools/build/src/tools/gcc.jam:165: in gcc.init from module gcc
/home/username/Code/boost_1_81_0/tools/build/src/build/toolset.jam:44: in toolset.using from module toolset
/home/username/Code/boost_1_81_0/tools/build/src/build-system.jam:543: in process-explicit-toolset-requests from module build-system
/home/username/Code/boost_1_81_0/tools/build/src/build-system.jam:610: in load from module build-system
/home/username/Code/boost_1_81_0/tools/build/src/kernel/modules.jam:294: in import from module modules
/home/username/Code/boost_1_81_0/tools/build/src/kernel/bootstrap.jam:135: in module scope from module

Obviously it doesn't expect the values the instructions suggest.显然它不期望指令建议的值。

Is there any way forward?有什么办法吗?

I am not sure about what exactly went wrong, but a complete, working procedure for cross-compiling boost for arm-linux-gnueabihf on Ubuntu 22.04 would be:我不确定到底出了什么问题,但是在 Ubuntu 22.04 上交叉编译arm-linux-gnueabihf的完整工作程序是:

# Retrieve/install cross-compiler.
wget  https://developer.arm.com/-/media/Files/downloads/gnu/12.2.rel1/binrel/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-linux-gnueabihf.tar.xz
tar Jxf arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-linux-gnueabihf.tar.xz
export CROSS_COMPILE=$(pwd)/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-

# Retrieve/install boost source code.
wget https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.tar.bz2
tar jxf boost_1_81_0.tar.bz2

# Build boost
cd boost_1_81_0
echo "using gcc : arm : ${CROSS_COMPILE}g++ ;" > user_config.jam
./bootstrap.sh --prefix=$(pwd)/boost-1.81.0-arm-none-linux-gnueabihf
./b2 install toolset=gcc-arm link=static cxxflags=-fPIC --with-filesystem --with-test --with-log --with-program_options -j32 --user-config=user_config.jam

After the compilation ends, the compilation artifacts should reside in directory boost_1_81_0/boost-1.81.0-arm-none-linux-gnueabihf .编译结束后,编译工件应位于目录boost_1_81_0/boost-1.81.0-arm-none-linux-gnueabihf中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM