第一次编译binutils-2.17出现错误的解决方法

0 views
Skip to first unread message

羽衣甘蓝

unread,
Oct 16, 2008, 9:08:18 AM10/16/08
to Linux-release
接着我们需要建立一个目录,因为binutils建议使用一个空目录来编译,所以
代码:
mkdir -v ../binutils-build
cd ../binutils-build
CC="gcc -B/usr/bin/" ../binutils-2.17/configure --prefix=/tools --
disable-nls --disable-werror
make
make install
make -C ld clean
make -C ld LIB_PATH=/tools/lib
cp -v ld/ld-new /tools/bin
cd ..
rm -rf binutils-build
rm -rf binutils-2.17

给出的信息是:

lfs@viennaten-desktop:/mnt/lfs/sources/binutils-build$ CC="gcc -B/usr/
bin/" ../binutils-2.17/configure --prefix=/tools --disable-nls --
disable-werror
loading cache ./config.cache
checking host system type... i686-pc-linux-gnulibc1
checking target system type... i686-pc-linux-gnulibc1
checking build system type... i686-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 -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
Reply all
Reply to author
Forward
0 new messages