views:

219

answers:

2

I am trying to build Linux From Scratch, and now I am at chapter 5.4, which tells me how to build Binutils. I have binutils 2.20's source code, but when I try to build it:

time { ./binutils-2.20/configure --target=$LFS_TGT --prefix=/tools --disable-nls --disable-werror ; }

it gives me an error:

checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-lfs-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 a sed that does not truncate output... /bin/sed
checking for gawk... gawk
checking for gcc... GCC
checking for C compiler default output file name... 
configure: error: in `/media/LFS':
configure: error: C compiler cannot create executables
See `config.log' for more details.

You can see my config.log at pastebin.com: http://pastebin.com/hX7v5KLn

I have just installed Ubuntu 10.04, and reinstalled GCC and installed G++. Also, the build is done by a non-root, non-admin user called 'lfs' (which is also described in Linux From Scratch), and on a different partition than where the system is installed.

Can anyone help me? Thanks

A: 

Try:

export CC=/usr/bin/gcc

before running configure.

caf
Sorry, does not work :(
Time Machine
Well, the problem is that the configure script is trying to use `GCC` as the compiler, but the compiler is actually called `gcc`.
caf
So should I <code>export GCC=/usr/bin/gcc</code> ?
Time Machine
Perhaps, but it is unlikely. You need to find out why the configure script is trying to use "GCC" in the first place. I suspect you have a borked build environment.
caf
+1  A: 

Aha, the /tools directory didn't exist ><

I created it and now it compiles fine =D

Time Machine