Compilation 针对ARM的交叉编译GSL 1.16

Compilation 针对ARM的交叉编译GSL 1.16,compilation,arm,raspberry-pi,gsl,gentoo,Compilation,Arm,Raspberry Pi,Gsl,Gentoo,我正在尝试交叉编译用于ARM体系结构(特别是Raspberry Pi)的GNU科学库(gsl,v1.16)。我使用了以下配置: CROSS=armv6j-hardfloat-linux-gnueabi ./configure --host=x86_64-pc-linux-gnu --build=$CROSS --target=$CROSS \ CC=/usr/bin/$CROSS-gcc \ CXX=/usr/bin/$CROSS-g++ \ AR=/usr/bin/$CROSS-ar \ RA

我正在尝试交叉编译用于ARM体系结构(特别是Raspberry Pi)的GNU科学库(gsl,v1.16)。我使用了以下配置:

CROSS=armv6j-hardfloat-linux-gnueabi
./configure --host=x86_64-pc-linux-gnu --build=$CROSS --target=$CROSS \
CC=/usr/bin/$CROSS-gcc \
CXX=/usr/bin/$CROSS-g++ \
AR=/usr/bin/$CROSS-ar \
RANLIB=/usr/bin/$CROSS-ranlib \
CFLAGS="-march=armv6 -mfloat-abi=hard -mfpu-vfp"
我收到以下错误消息:

libtool: compile:  /usr/bin/armv6j-hardfloat-linux-gnueabi-gcc 
-DHAVE_CONFIG_H -I. -I.. -I.. -march=armv6 -mfloat-abi=hard -mfpu=vfp 
-MT read.lo -MD -MP -MF .deps/read.Tpo -c read.c -o read.o
In file included from fp.c:10:0:
fp-gnux86.c: In function 'gsl_ieee_set_mode':
fp-gnux86.c:42:15: error: '_FPU_SINGLE' undeclared (first use in this function)
fp-gnux86.c:42:15: note: each undeclared identifier is reported only once for each function it appears in
fp-gnux86.c:45:15: error: '_FPU_DOUBLE' undeclared (first use in this function)
fp-gnux86.c:48:15: error: '_FPU_EXTENDED' undeclared (first use in this function)
fp-gnux86.c:57:15: error: '_FPU_RC_NEAREST' undeclared (first use in this function)
fp-gnux86.c:60:15: error: '_FPU_RC_DOWN' undeclared (first use in this function)
fp-gnux86.c:63:15: error: '_FPU_RC_UP' undeclared (first use in this function)
fp-gnux86.c:66:15: error: '_FPU_RC_ZERO' undeclared (first use in this function)
fp-gnux86.c:76:13: error: '_FPU_MASK_DM' undeclared (first use in this function)
make[2]: *** [fp.lo] Error 1
我正在64位Linux Gentoo系统上编译。我已经使用Gentoo工具链来设置我的交叉编译器。任何关于我做错了什么的指点都是高度赞赏的


提前谢谢

我不能保证它会起作用,但使用emerge包装器可能会让你运气更好

armv6j-hardfloat-linux-gnueabi-emerge gsl

我编写了一系列脚本,使这类事情更加可靠,但不幸的是,我陷入了交叉编译Python模块的地狱,从未使其进入可发布状态。

您的配置不正确,交叉编译build=(您的x86 gcc)和host=target=(arm工具链)。请尝试下面的命令

/configure--host=armv6j硬浮点linux-gnueabi--build=x86_64-pc-linux-gnu--target=armv6j硬浮点linux-gnueabi\

CFLAGS=“-march=armv6-mfloat abi=hard-mfpu vfp”

非常感谢您指出我的错误。事实上,我混淆了主机和构建标记。根据你的建议,我成功地交叉编译了GSL。再次感谢。