﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
885	GCC-3.3.3 - Pass 1 fails at  Prepare GCC for compilation	a_spicer@…	lfs-book@…	"Following the 5.1.1 LFS book (html version) exactly word for word, at the
GCC-3.3.3 - Pass 1 section, in the ""Prepare GCC for compilation"" portion of that
page (again following this book word for word) we are to do the following:

../gcc-3.3.3/configure --prefix=/tools \
    --with-local-prefix=/tools \
    --disable-nls --enable-shared \
    --enable-languages=c

But this fails with the following exact error messages:

lfs:/mnt/lfs/sources/gcc-build$ ../gcc-3.3.3/configure --prefix=/tools    
--with-local-prefix=/tools     --disable-nls --enable-shared    
--enable-languages=c
Configuring for a i686-pc-linux-gnu host.
Created ""Makefile"" in /mnt/lfs/sources/gcc-build using ""mt-frag""
/tools/bin/ld: unrecognized option '--as-needed'
/tools/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status
*** The command 'gcc -o conftest -g -O2   conftest.c' failed.
*** You must set the environment variable CC to a working compiler.

Thinking this has to be an LD problem with the LD that we are using in this
""protected"" build environment ... the current ""host GCC"" must be using something
that ""protected /tools/bin/ld"" doesn't like?

While Google groups searching for this I found:

http://groups.google.com/groups?q=%22unrecognized+option+%27--as-needed%27%22&hl=en&lr=&ie=UTF-8&selm=1SmcR-6sh-9%40gated-at.bofh.it&rnum=1

* This persons problem was similar, although not exactly our environment. I
translated his ""specs"" file location to my local machine (again, Fedora Core 2)
and took out 1 each of ""--as-needed"" and ""--no-as-needed"", and ran the LFS
book's configure command again. This time it succeeded. Problem gone.

The fix, such as it is, is to edit  
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/specs and remove all  
references to --as-needed and --no-as-needed (there aren't many). ld is  
then happy, and things compile well."	defect	closed	highest		Book	5.1.1	major	wontfix		a_spicer@…
