[lfs-support] gcc compile phase 2 error

Bruce Dubbs bruce.dubbs at gmail.com
Wed Sep 5 22:39:18 PDT 2012

Ashkan Rahmani wrote:
> hi every body
> I have some problem in gcc compile phase 2.
> as mentioned in book i try to configure gcc by this command:
> CC=$LFS_TGT-gcc \
> AR=$LFS_TGT-ar\
> RANLIB=$LFS_TGT-ranlib\
> ../gcc-4.7.1/configure\

You should be the lfs user.  Double check the that the PATH is set 
properly as in Section 4.4.  Also check that $LFS_TGT is properly set 
and that the tools are (/tools/bin/x86_64-lfs-linux-gnu-*) are installed 

> checking whether the C compiler works... configure: error: in
> `/mnt/lfs/sources/gcc-build':
> configure: error: cannot run C compiled programs.
> If you meant to cross compile, use `--host'.
> beside it I have other problems:
> 1- Some times it seems something cause $FSL variable became empty. and I
> have to set it again.

If you set LFS in Section 4.4, it should be there when you switch to the 
lfs user.

> 2- checking build system type... x86_64-unknown-linux-gnu: why unknown
> linux?!

That's just the way it's been as a part of the build procedures for 
x86_64.   It comes from 'uname -p'.  At one time we had a patch to fix 
that but dropped it for compatibility reasons.

   -- Bruce

More information about the lfs-support mailing list