打印

在Linux上建立ARM交叉编译环境遇到问题

[复制链接]
2621|6
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
来与君|  楼主 | 2008-5-14 11:17 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
目          的:熟悉Linux,自己编译生成ARM交叉编译环境
宿主        机:Ubuntu 8.04
gcc      版本:gcc -dumpversion 4.2.3
所使用傻瓜脚本:http://www.kegel.com/crosstool/crosstool-0.43.tar.gz中的demo-arm.sh
问          题:出现编译错误提示而终止,提示如下
                + echo Build binutils
Build binutils
+ mkdir -p build-binutils
+ cd build-binutils
+ test ! -f Makefile
+ /home/somebody/Down/crosstool-0.43/build/arm-unknown-linux-gnu/gcc-4.1.0-glibc-2.3.2/binutils-2.16.1/configure --target=arm-unknown-linux-gnu --host=i686-host_pc-linux-gnulibc1 --prefix=/opt/crosstool/gcc-4.1.0-glibc-2.3.2/arm-unknown-linux-gnu --disable-nls --with-sysroot=/opt/crosstool/gcc-4.1.0-glibc-2.3.2/arm-unknown-linux-gnu/arm-unknown-linux-gnu
creating cache ./config.cache
checking host system type... i686-host_pc-linux-gnulibc1
checking target system type... arm-unknown-linux-gnu
checking build system type... i686-host_pc-linux-gnulibc1
checking for a BSD compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.

我认为是在编译binutils时碰到问题了。打开命令行相关的binutils-2.16.1目录下configure文件,和“checking whether the C compiler”相关的行可能是这两句
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:1922: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5

疑          问:1、gcc未找到?但是在命令行已经能够单独运行gcc了。
                2、$CFLAGS和$LDFLAGS这两个变量的问题?不知道。

请大伙指教,我这里先行谢过。

相关帖子

沙发
brandnew| | 2008-5-14 12:19 | 只看该作者

。。。

你周围难道就没搞这个的人吗?

使用特权

评论回复
板凳
来与君|  楼主 | 2008-5-14 12:29 | 只看该作者

呵呵,楼上说中了

不行的话,我就下现成的……

使用特权

评论回复
地板
阿南| | 2008-5-14 12:33 | 只看该作者

还是用现成的吧

使用特权

评论回复
5
simon21ic| | 2008-5-14 14:47 | 只看该作者

确认一下build-essential装了没

使用特权

评论回复
6
来与君|  楼主 | 2008-5-14 18:36 | 只看该作者

谢谢阿南,谢谢Simon

正如Simon所讲,安装了build-essential之后,这道坎跨过去了,现在正在热力编译中……

还请Simon多多指教!

使用特权

评论回复
7
来与君|  楼主 | 2008-5-14 18:46 | 只看该作者

总之,两条腿走路吧

+ echo crosstool: binutils built ok
crosstool: binutils built ok
+ echo Install glibc headers needed to build bootstrap compiler -- but only if gcc-3.x
Install glibc headers needed to build bootstrap compiler -- but only if gcc-3.x
+ grep -q gcc-[34] /home/Somebody/Down/crosstool-0.43/build/arm-unknown-linux-gnu/gcc-4.1.0-glibc-2.3.2/gcc-3.3.6/ChangeLog
+ test ! -f /opt/crosstool/gcc-4.1.0-glibc-2.3.2/arm-unknown-linux-gnu/arm-unknown-linux-gnu/include/features.h
+ mkdir -p build-glibc-headers
+ cd build-glibc-headers
+ test ! -f Makefile
+ libc_cv_ppc_machine=yes CC=gcc /home/Somebody/Down/crosstool-0.43/build/arm-unknown-linux-gnu/gcc-4.1.0-glibc-2.3.2/glibc-2.3.2/configure --prefix=/usr --build=i686-pc-linux-gnu --host=arm-unknown-linux-gnu --without-cvs --disable-sanity-checks --with-headers=/opt/crosstool/gcc-4.1.0-glibc-2.3.2/arm-unknown-linux-gnu/arm-unknown-linux-gnu/include --enable-hacker-mode
checking build system type... i686-pc-linux-gnu
checking host system type... arm-unknown-linux-gnu
checking sysdep dirs... sysdeps/arm/elf sysdeps/unix/sysv/linux/arm sysdeps/unix/sysv/linux sysdeps/gnu sysdeps/unix/common sysdeps/unix/mman sysdeps/unix/inet sysdeps/unix/sysv sysdeps/unix/arm sysdeps/unix sysdeps/posix sysdeps/arm/fpu sysdeps/arm sysdeps/wordsize-32 sysdeps/ieee754/flt-32 sysdeps/ieee754/dbl-64 sysdeps/ieee754 sysdeps/generic/elf sysdeps/generic
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for pwd... /bin/pwd
checking for arm-unknown-linux-gnu-gcc... gcc
checking version of gcc... 4.2.3, bad
checking for gnumake... no
checking for gmake... no
checking for make... make
checking version of make... 3.81, ok
configure: error:
*** These critical programs are missing or too old: gcc
*** Check the INSTALL file for required versions.

看来不是嫌gcc太年轻,就是嫌make太老了。
稍后再查……

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

10

主题

367

帖子

0

粉丝