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

1
  • What happens if you compile a simple c program from the command line? Commented May 3, 2010 at 0:26

2 Answers 2

3

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

Sign up to request clarification or add additional context in comments.

Comments

0

Try:

export CC=/usr/bin/gcc 

before running configure.

2 Comments

Well, the problem is that the configure script is trying to use GCC as the compiler, but the compiler is actually called gcc.
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.