LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 08-03-2004, 05:18 AM   #1
alext_29
LQ Newbie
 
Registered: Aug 2004
Posts: 1

Rep: Reputation: 0
error while configuring gcc-3.3.3 (pass1)


hi,

i am having trouble running configure while building gcc-3.3.3 (pass1). The command i have used is
../gcc-3.3.3/configure --prefix=/tools \
--with-local-prefix=/tools \
--disable-nls --enable-shared \
--enable-languages=c

the error response i am getting is :
Configuring for a i686-pc-linux-gnu host.
Created "Makefile" in /mnt/lfs/untar/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.


my system is a p4, running fedora 2 as the host OS. gcc as well as ld are being recognised at the command prompt.

if anyone can figure out whats going wrong it wd be gr8. thanks in advance.

alex
 
Old 08-03-2004, 06:01 AM   #2
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
Im sure you used copy & paste to use the command given in the book and accidentally copied & pasted something, which was just a suggestion to put your own stuff in here

the error message tells you: /tools/bin/ld: unrecognized option '--as-needed'

this is - of course - not a valid option to configure and therefore it has to fail on that one

check the command you issued !
 
Old 08-03-2004, 08:48 AM   #3
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
Shouldn't you be building in /mnt/lfs/sources? Does the user lfs have read, write or execute permissions in /mnt/lfs/untar?
 
Old 08-17-2004, 11:55 AM   #4
Doktor Prokt
LQ Newbie
 
Registered: Jul 2004
Posts: 24

Rep: Reputation: 15
Hello,

i got exactly the same problem and I solved it by downloading the newest version of binutils (2.15).
With this version is shipped a new ld program which supports the "--as-needed" switch. Seemed to work for me.

good luck with your lfs,

Doktor Prokt
 
Old 09-28-2004, 11:48 PM   #5
gaidin_
LQ Newbie
 
Registered: Sep 2004
Posts: 2

Rep: Reputation: 0
Re: error while configuring gcc-3.3.3 (pass1)

I found while using Knoppix to build my LFS 5.11 that I had to set the CC environment variable to point to the gcc-2.95 instead gcc-3.3 that /usr/bin/gcc was linked to. As soon as I did this the error went away.


Quote:
Originally posted by alext_29
hi,

i am having trouble running configure while building gcc-3.3.3 (pass1). The command i have used is
../gcc-3.3.3/configure --prefix=/tools \
--with-local-prefix=/tools \
--disable-nls --enable-shared \
--enable-languages=c

the error response i am getting is :
Configuring for a i686-pc-linux-gnu host.
Created "Makefile" in /mnt/lfs/untar/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.


my system is a p4, running fedora 2 as the host OS. gcc as well as ld are being recognised at the command prompt.

if anyone can figure out whats going wrong it wd be gr8. thanks in advance.

alex
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
okok how about configuring the gcc Quiber SUSE / openSUSE 2 10-20-2010 01:09 PM
glibc pass1--configure error keyur Linux From Scratch 5 01-30-2009 05:05 AM
Error configuring GCC, First Pass lloyd_smart Linux From Scratch 8 10-29-2004 11:45 AM
Compiling GCC (pass1):ld cannot find -lc Dargason Linux From Scratch 2 07-15-2004 02:48 AM
gcc pass1 in chap5 doesn't get very far! davemar Linux From Scratch 3 03-31-2004 03:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 12:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration