+ -
当前位置:首页 → 问答吧 → 第一次编译binutils-2.17出现的错误,求救

第一次编译binutils-2.17出现的错误,求救

时间:2008-01-01

来源:互联网

第一次编译binutils-2.17出现的错误,求救
hi ~ all
i am tring to compile binutils2.17 for my lfs
env: vmware5.5
liveCD:lfslivecd-x86-6.3-r2160.iso
i do like this:
我参考的文档
http://www.linuxfromscratch.org/ ... binutils-pass1.html

tar xvf /lfs-sources/binutils-2.17.tar.bz2
cd binutils-2.17
mkdir -v ../binutils-build
cd ../binutils-build
CC="gcc -B/usr/bin/" ../binutils-2.17/configure \
--prefix=/tools --disable-nls --disable-werror

then
vi config.log
**************************************************
代码:
configure:2317: checking for correct version of gmp.h
configure:2330: gcc -B/usr/bin/ -c -g -O2 conftest.c 1>&5
configure:2320:17: error: gmp.h: No such file or directory
configure: In function 'main':
configure:2324: error: 'choke' undeclared (first use in this function)
configure:2324: error: (Each undeclared identifier is reported only once
configure:2324: error: for each function it appears in.)
configure:2324: error: expected ';' before 'me'
configure: failed program was:
#line 2319 "configure"
#include "confdefs.h"
#include "gmp.h"
int main() {

#if __GNU_MP_VERSION < 3
choke me
#endif

; return 0; }
****************************************************
and what i have to do this??
Where do I get gmp.h? Do I need it? What else can be wrong?
thank you.

作者: awnun   发布时间: 2008-01-01

我曾经遇到过,换了一个2.16的就好了

作者: deargodzw   发布时间: 2008-01-01

把configure的过程发出来看一下

作者: youbest   发布时间: 2008-01-01

2.16的我下完了怎么拷到liveCD里面的呢
我做天用软件写到iso里面,结果liveCD坏掉了

你们是如何传文件过去的到liveCD中

作者: awnun   发布时间: 2008-01-01

执行
CC="gcc -B/usr/bin/" ../binutils-2.17/configure \
--prefix=/tools --disable-nls --disable-werror

代码:
checking host system type...
i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking build system type... i686-pc-linux-gnu
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 -B/usr/bin/
checking whether the C compiler (gcc -B/usr/bin/ ) works... yes
checking whether the C compiler (gcc -B/usr/bin/ ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc -B/usr/bin/ accepts -g... yes
checking for gnatbind... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for correct version of gmp.h... no
checking for bison... bison -y
checking for bison... bison
checking for gm4... no
checking for gnum4... no
checking for m4... m4
checking for flex... flex
checking for flex... flex
checking for makeinfo... makeinfo
checking for expect... no
checking for runtest... no
checking for i686-pc-linux-gnu-ar... no
checking for ar... ar
checking for i686-pc-linux-gnu-as... no
checking for as... as
checking for i686-pc-linux-gnu-dlltool... no
checking for dlltool... no
checking for i686-pc-linux-gnu-ld... /usr/bin/ld
checking for i686-pc-linux-gnu-lipo... no
checking for lipo... no
checking for i686-pc-linux-gnu-nm... no
checking for nm... nm
checking for i686-pc-linux-gnu-ranlib... no
checking for ranlib... ranlib
checking for i686-pc-linux-gnu-strip... no
checking for strip... strip
checking for i686-pc-linux-gnu-windres... no
checking for windres... no
checking for i686-pc-linux-gnu-objcopy... no
checking for objcopy... objcopy
checking for i686-pc-linux-gnu-objdump... no
checking for objdump... objdump
checking for i686-pc-linux-gnu-cc... no
checking for cc... cc
checking for i686-pc-linux-gnu-c++... no
checking for c++... c++
checking for i686-pc-linux-gnu-gcc... no
checking for gcc... gcc
checking for i686-pc-linux-gnu-gcj... no
checking for gcj... no
checking for i686-pc-linux-gnu-gfortran... no
checking for gfortran... no
checking for ar... no
checking for i686-pc-linux-gnu-ar... no
checking for ar... ar
checking for as... no
checking for i686-pc-linux-gnu-as... no
checking for as... as
checking for dlltool... no
checking for i686-pc-linux-gnu-dlltool... no
checking for dlltool... no
checking for ld... no
checking for i686-pc-linux-gnu-ld... no
checking for ld... ld
checking for lipo... no
checking for i686-pc-linux-gnu-lipo... no
checking for lipo... no
checking for nm... no
checking for i686-pc-linux-gnu-nm... no
checking for nm... nm
checking for objdump... no
checking for i686-pc-linux-gnu-objdump... no
checking for objdump... objdump
checking for ranlib... no
checking for i686-pc-linux-gnu-ranlib... no
checking for ranlib... ranlib
checking for strip... no
checking for i686-pc-linux-gnu-strip... no
checking for strip... strip
checking for windres... no
checking for i686-pc-linux-gnu-windres... no
checking for windres... no
checking where to find the target ar... just compiled
checking where to find the target as... just compiled
checking where to find the target cc... host tool
checking where to find the target c++... host tool
checking where to find the target c++ for libstdc++... host tool
checking where to find the target dlltool... just compiled
checking where to find the target gcc... host tool
checking where to find the target gcj... host tool
checking where to find the target gfortran... host tool
checking where to find the target ld... just compiled
checking where to find the target lipo... host tool
checking where to find the target nm... just compiled
checking where to find the target objdump... just compiled
checking where to find the target ranlib... just compiled
checking where to find the target strip... just compiled
checking where to find the target windres... just compiled
checking whether to enable maintainer-specific portions of Makefiles... no
updating cache ./config.cache
creating ./config.status
creating Makefile
lfs:/mnt/lfs/sources/binutils-2.17$
lfs:/mnt/lfs/sources/binutils-2.17$

作者: awnun   发布时间: 2008-01-01

看来和预料的一样,configure完成了,不过你这个应该是在binutils-build里,最好别在binutils代码的目录里.

作者: youbest   发布时间: 2008-01-01

configure是正常的
到binutils-build目录下面看config.log会报错
在binutils-2.17下面放的code
代码:
mkdir -v ../binutils-build
cd ../binutils-build
CC="gcc -B/usr/bin/" ../binutils-2.17/configure \
--prefix=/tools --disable-nls --disable-werror
就是一开始提的问题了
不清楚怎么解决
要换版本??
又是怎么拷到liveCD中的呢

作者: awnun   发布时间: 2008-01-01

试试继续吧.

作者: youbest   发布时间: 2008-01-01

youbest:
看来和预料的一样,configure完成了,不过你这个应该是在binutils-build里,最好别在binutils代码的目录里.

能否具体说清楚点不?

作者: yingkity   发布时间: 2008-05-26

哪位已经解决了这个问题,给我点提示,谢谢~

作者: yingkity   发布时间: 2008-05-26

我第一次编译的时候使用的命令是:
使用lfs用户登陆:
cd $LFS/source

tar -jxvf binutils-2.17.tar.bz2

mkdir -v ../binutils-build

cd ../binutils-build

CC="gcc -B/usr/bin/" ../binutils-2.17/configure \
--prefix=/tools --disable-nls --disable-werror

creating cache ./config.cache
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking build system type... x86_64-unknown-linux-gnu
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 -B/usr/bin/
checking whether the C compiler (gcc -B/usr/bin/ ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.


vi ./config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

configure:611: checking host system type
configure:632: checking target system type
configure:650: checking build system type
configure:705: checking for a BSD compatible install
configure:758: checking whether ln works
configure:782: checking whether ln -s works
configure:1867: checking for gcc
configure:1980: checking whether the C compiler (gcc -B/usr/bin ) works
configure:1996: gcc -B/usr/bin -o conftest conftest.c 1>&5
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
configure: failed program was:

#line 1991 "configure"
#include "confdefs.h"

main(){return(0);}

作者: dusks   发布时间: 2008-08-12

引用:
作者: dusks
我第一次编译的时候使用的命令是:
使用lfs用户登陆:
cd $LFS/source

tar -jxvf binutils-2.17.tar.bz2

mkdir -v ../binutils-build

cd ../binutils-build

CC="gcc -B/usr/bin/" ../binutils-2.17/configure \
--prefix=/tools --disable-nls --disable-werror

creating cache ./config.cache
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking build system type... x86_64-unknown-linux-gnu
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 -B/usr/bin/
checking whether the C compiler (gcc -B/usr/bin/ ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.


vi ./config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

configure:611: checking host system type
configure:632: checking target system type
configure:650: checking build system type
configure:705: checking for a BSD compatible install
configure:758: checking whether ln works
configure:782: checking whether ln -s works
configure:1867: checking for gcc
configure:1980: checking whether the C compiler (gcc -B/usr/bin ) works
configure:1996: gcc -B/usr/bin -o conftest conftest.c 1>&5
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
configure: failed program was:

#line 1991 "configure"
#include "confdefs.h"

main(){return(0);}
问题解决!方法如下:

是这个文件缺失:crt1.o

使用下例的方法找到并安装上,即可解决问题。
On Ubuntu:
apt-get install libc6-dev

On debian:
apt-get install libc6-dev

On Fedora:

$ locate crt1.o
/usr/lib/crt1.o


$ rpm -qf /usr/lib/crt1.o
glibc-devel-X.X.X-XX


Then install the package glibc-devel-X.X.X-XX using yum, rpm, etc

作者: dusks   发布时间: 2008-08-12

我也碰上了和楼主一样的问题
正愁着不知如何解决呢

作者: lofeng410   发布时间: 2008-10-18

引用:
作者: lofeng410
我也碰上了和楼主一样的问题
正愁着不知如何解决呢
楼主用的是vmware,怎能不出错?

用虚拟机的就应该明白虚拟机下一切皆有可能。

LFS的光盘和手册都是针对不用虚拟机的情况进行的测试。

作者: ti8er   发布时间: 2008-10-18

引用:
作者: ti8er
楼主用的是vmware,怎能不出错?

用虚拟机的就应该明白虚拟机下一切皆有可能。

LFS的光盘和手册都是针对不用虚拟机的情况进行的测试。
现在我没有用虚拟机了
但是跟楼主的问题一样 make的时候陷入死循环
现在发现可能是binutils-2.17中的很多文件的time stamp比系统时间还要新(系统时间是GMT 2002.12.31),在我这可能是这个原因造成死循环的。
我正在尝试用touch命令更改binutils-2.17中文件的time stamp,但是这个方式不是很好,因为后面还会出现这个问题。我想问下,可有直接更新系统时间的命令(通过网络更新)?这样才能彻底的解决问题

作者: lofeng410   发布时间: 2008-10-18

好像不是这个原因 touch后问题依旧

作者: lofeng410   发布时间: 2008-10-18

引用:
作者: lofeng410
现在我没有用虚拟机了
但是跟楼主的问题一样 make的时候陷入死循环
现在发现可能是binutils-2.17中的很多文件的time stamp比系统时间还要新(系统时间是GMT 2002.12.31),在我这可能是这个原因造成死循环的。
我正在尝试用touch命令更改binutils-2.17中文件的time stamp,但是这个方式不是很好,因为后面还会出现这个问题。我想问下,可有直接更新系统时间的命令(通过网络更新)?这样才能彻底的解决问题
你现在的系统时间是多少?

作者: ti8er   发布时间: 2008-10-18

1、检查你的时区:
echo TZ
2、用date命令直接改你的系统时间
date 101811402008

作者: ti8er   发布时间: 2008-10-18

引用:
作者: ti8er
你现在的系统时间是多少?
进入系统后date后的时间是GMT 2002.12.31
我已经date -s 081018了
但是错误依旧 在config.log文件中依然提示找不到:
-----------------------------------------------------------------------------------------------
configure:2324: error: 'choke' undeclared (first use in this function)
configure:2324: error: (Each undeclared identifier is reported only once
configure:2324: error: for each function it appears in.)
configure:2324: error: expected ';' before 'me'
configure: failed program was:
#line 2319 "configure"
#include "confdefs.h"
#include "gmp.h"
int main() {

#if __GNU_MP_VERSION < 3
choke me
#endif

; return 0; }

作者: lofeng410   发布时间: 2008-10-18

目前这样make就是死循环
一直循环显示的包含下面的内容:
checking where to find the target ar... host tool
checking where to find the target as... host tool
checking where to find the target cc... host tool
checking where to find the target c++... host tool
checking where to find the target c++ for libstdc++... host tool
checking where to find the target dlltool... host tool
checking where to find the target gcc... host tool
checking where to find the target gcj... host tool
checking where to find the target gfortran... host tool
checking where to find the target ld... host tool
checking where to find the target lipo... host tool
checking where to find the target nm... host tool
checking where to find the target objdump... host tool
checking where to find the target ranlib... host tool
checking where to find the target strip... host tool
checking where to find the target windres... host tool
checking where to find the target windmc... host tool

作者: lofeng410   发布时间: 2008-10-18

你开始是怎么做的?

作者: ti8er   发布时间: 2008-10-18

你现在是在LIVECD环境下的吧?
echo $PATH
我看看你的PATH。
然后
mount
给我看看。

作者: ti8er   发布时间: 2008-10-18

然后删除解压的binutils-2.17目录,重新解压。进入目录,输入命令:
./config.guess

给我看看结果。

作者: ti8er   发布时间: 2008-10-18

引用:
作者: ti8er
你开始是怎么做的?
按照手册一步步来的
export输出也正常的

作者: lofeng410   发布时间: 2008-10-18

给我看看上面命令的结果。好分析一下。

作者: ti8er   发布时间: 2008-10-18

引用:
作者: ti8er
你现在是在LIVECD环境下的吧?
echo $PATH
我看看你的PATH。
然后
mount
给我看看。
echo $PATH的输出是:
/tools/bin:/bin:/usr/bin

mount的输出是:
/dev/mapper/lfs-cd on / type ext2 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
decpts on /dev/pts type devpts (rw,gid=4,mode=620)
/dev/hda4 on /mnt/lfs type ext3 (rw)

./config.guess的输出是:
i686-pc-linux-gnu

作者: lofeng410   发布时间: 2008-10-18

我是在另外一台电脑上做LFS的
给分配了5.5G的空间 /dev/hda4
/dev/hda3为交换分区

作者: lofeng410   发布时间: 2008-10-18

你在/目录下建立了tools的连接没有?
ln -sv /mnt/lfs/tools /
这个命令。

作者: ti8er   发布时间: 2008-10-18

mkdir -v ../binutils-build
cd ../binutils-build
CC="gcc -B/usr/bin/" ../binutils-2.17/configure \
--prefix=/tools --disable-nls --disable-werror
你确保输入正确了吧?看看屏幕是否有什么提示没有?

作者: ti8er   发布时间: 2008-10-18

输入命令:
whereis gcc
看看结果。

作者: ti8er   发布时间: 2008-10-18

引用:
作者: lofeng410
echo $PATH的输出是:
/tools/bin:/bin:/usr/bin

mount的输出是:
/dev/mapper/lfs-cd on / type ext2 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
decpts on /dev/pts type devpts (rw,gid=4,mode=620)
/dev/hda4 on /mnt/lfs type ext3 (rw)

./config.guess的输出是:
i686-pc-linux-gnu
你的mount怎么会没有tmpfs这个挂载?

/dev/hda7 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=4,mode=620)
tmpfs on /dev/shm type tmpfs (rw)

这是我的LFS系统的mount

作者: ti8er   发布时间: 2008-10-18

不好意思 刚才出去开会了 刚回来~~

作者: lofeng410   发布时间: 2008-10-18

引用:
作者: ti8er
你在/目录下建立了tools的连接没有?
ln -sv /mnt/lfs/tools /
这个命令。
有建立这个连接的

引用:
作者: ti8er
mkdir -v ../binutils-build
cd ../binutils-build
CC="gcc -B/usr/bin/" ../binutils-2.17/configure \
--prefix=/tools --disable-nls --disable-werror
你确保输入正确了吧?看看屏幕是否有什么提示没有?
输入是正确的,输出也没有特别的内容,最后的输出是诸如这样的:
checking where to find the target ar... just compiled
checking where to find the target as... ust compiled
checking where to find the target cc... host tool
checking where to find the target c++... host tool


引用:
作者: ti8er
输入命令:
whereis gcc
看看结果。
输出为:
/usr/bin/gcc /usr/lib/gcc /usr/share/man/man1/gcc.1

作者: lofeng410   发布时间: 2008-10-18

引用:
作者: ti8er
你的mount怎么会没有tmpfs这个挂载?

/dev/hda7 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=4,mode=620)
tmpfs on /dev/shm type tmpfs (rw)

这是我的LFS系统的mount
我也不知道 但是我多了/dev/mapper/lfs-cd on / type ext2 (rw)我是从光盘启动的

作者: lofeng410   发布时间: 2008-10-18

引用:
作者: lofeng410
我也不知道 但是我多了/dev/mapper/lfs-cd on / type ext2 (rw)我是从光盘启动的
光盘启动也应该有tmpfs的挂载项目。你看看英文手册6.2.3章的内容:

mount -vt devpts devpts $LFS/dev/pts
mount -vt tmpfs shm $LFS/dev/shm
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys

不过不清楚少这个会不会影响到编译。你再make,还不行吗?

作者: ti8er   发布时间: 2008-10-18

输入命令:
md5sum binutils-2.17.tar.bz2
看看结果是不是下面的:
e26e2e06b6e4bf3acf1dc8688a94c0d1 binutils-2.17.tar.bz2

我怀疑是不是你的软件包有问题?

上面的代码,0是数字零,不是英文字母o

作者: ti8er   发布时间: 2008-10-18

引用:
作者: ti8er
光盘启动也应该有tmpfs的挂载项目。你看看英文手册6.2.3章的内容:

mount -vt devpts devpts $LFS/dev/pts
mount -vt tmpfs shm $LFS/dev/shm
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys

不过不清楚少这个会不会影响到编译。你再make,还不行吗?
make还是不行 仍然是死循环

作者: lofeng410   发布时间: 2008-10-18

引用:
作者: ti8er
输入命令:
md5sum binutils-2.17.tar.bz2
看看结果是不是下面的:
e26e2e06b6e4bf3acf1dc8688a94c0d1 binutils-2.17.tar.bz2

我怀疑是不是你的软件包有问题?

上面的代码,0是数字零,不是英文字母o
软件包没有问题的啊 MD5值跟你的一样的

作者: lofeng410   发布时间: 2008-10-18

你挂载tmpfs上去试试?还是不行就奇怪了。难道这个CD不兼容你的电脑配置?

mount -vt tmpfs tmpfs /dev/shm

作者: ti8er   发布时间: 2008-10-18

不行就只好用LFS6.2的binutils-2.16.1版本了。

作者: ti8er   发布时间: 2008-10-18

你现在不是在那台机器上工作的吗?你用live-cd 的图形界面不可以上网和打中文吗?

作者: ti8er   发布时间: 2008-10-18

引用:
作者: ti8er
不行就只好用LFS6.2的binutils-2.16.1版本了。
我正在从
http://ftp.gnu.org/gnu/binutils/
下载binutils-1.16.1
LFS6.2里面的导出来比较麻烦

作者: lofeng410   发布时间: 2008-10-18

引用:
作者: ti8er
你现在不是在那台机器上工作的吗?你用live-cd 的图形界面不可以上网和打中文吗?
不是在那台机器上上网和打中文的 现在有两台电脑 但是只有一根网线 所以。。。

作者: lofeng410   发布时间: 2008-10-18

我看了一下,tmpfs的作用还是很重要的,但是是否会影响到编译就不太清楚。
你那台机器的配置是怎么样的?你挂载tmpfs试试行了没有?不行的话重启电脑,再mount看看有没有这个系统。如果还没有,你把CD拿到你另一台机器上试试,看看有没有?

作者: ti8er   发布时间: 2008-10-18

如果你用2.16.1版本的可以的话,把你的电脑配置和相关情况贴出来反映到LFS的官方网站上面去,看看他们有什么说法没有。

作者: ti8er   发布时间: 2008-10-18