3

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

2 Answers2

3

The /tools directory didn't exist. I created it and now it compiles fine.

nsane
  • 1,715
  • 4
  • 21
  • 31
0

Try:

export CC=/usr/bin/gcc

before running configure.

caf
  • 233,326
  • 40
  • 323
  • 462
  • 1
    Well, the problem is that the configure script is trying to use `GCC` as the compiler, but the compiler is actually called `gcc`. – caf May 03 '10 at 00:47
  • 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 May 03 '10 at 03:41