主题 : 交叉编译gmp出现的问题 复制链接 | 浏览器收藏 | 打印
一生只为研究嵌入式方向的知识!永远支持ARM板!
级别: 侠客
UID: 59072
精华: 0
发帖: 81
金钱: 410 两
威望: 82 点
综合积分: 162 分
注册时间: 2011-11-18
最后登录: 2013-10-24
楼主  发表于: 2012-05-22 11:11

 交叉编译gmp出现的问题

大家好,最近要做一个在ARM上用到gmp库的东西,所以要交叉编译gmp.有一个网站上找到了编译方法。可是我编译的时候老是报错,当我:
./configure CC="/opt/arm/usr/bin/arm-linux-gcc" CPP="/opt/arm/usr/bin/arm-linux-gcc  -E"   报错如下:
[root@localhost gmp-4.3.2]# ./configure CC="/opt/arm/usr/bin/arm-linux-gcc"
CPP="/opt/arm/usr/bin/arm-linux-gcc -E"
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking ABI=32
checking whether /opt/arm/usr/bin/arm-linux-gcc is gcc... yes
checking compiler /opt/arm/usr/bin/arm-linux-gcc -m32 -O2 -pedantic
-fomit-frame-pointer ... no
checking compiler /opt/arm/usr/bin/arm-linux-gcc -O2 -pedantic
-fomit-frame-pointer ... no, program does not run
configure: error: could not find a working compiler, see config.log for
details
[root@localhost gmp-4.3.2]#

求大家指点一下吧!
King!
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2012-05-22 15:43
正确交叉编译gmp的方法是(以6410为目标平台)
export PATH=/opt/arm/usr/bin:$PATH
$CFLAGS="-march=armv6" ./configure --host=arm-linux
$make
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
一生只为研究嵌入式方向的知识!永远支持ARM板!
级别: 侠客
UID: 59072
精华: 0
发帖: 81
金钱: 410 两
威望: 82 点
综合积分: 162 分
注册时间: 2011-11-18
最后登录: 2013-10-24
2楼  发表于: 2012-05-22 16:44
引用第1楼kasim于2012-05-22 15:43发表的  :
正确交叉编译gmp的方法是(以6410为目标平台)
export PATH=/opt/arm/usr/bin:$PATH
$CFLAGS="-march=armv6" ./configure --host=arm-linux
$make

多谢,可是第二条语句我不太懂!
King!
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
3楼  发表于: 2012-05-22 17:40

 回 2楼(汤辉270) 的帖子

对于执行configure脚本而言,设定CFLAGS环境变量为"-march=armv6", 这其实是arm-linux-gcc的执行参数,用来确保生成的二进制档是适用于armv6平台的,比如S3C6410
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."