LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 07-15-2004, 06:24 PM   #1
aoe2bug
LQ Newbie
 
Registered: Apr 2004
Posts: 10

Rep: Reputation: 0
Unhappy "ld unrecognized option '--as-needed'"


hello folks,

sorry if this is answered elsewhere, but my searches didn't come up with anything related.

recently i updated some software on my computer with swaret, and all went fine, i thought. but since then i cannot compile any programs. i'd looked into it more recently and found that the error stems from ld, here are some of the errors exhibited:
---------------------------------------------------------
root@hostname:/usr/src/linux# make menuconfig
HOSTCC scripts/basic/fixdep
/usr/bin/ld: unrecognized option '--as-needed'
/usr/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status
make[1]: *** [scripts/basic/fixdep] Error 1
make: *** [scripts_basic] Error 2
---------------------------------------------------------
root@hostname:/home/user/downloads/gpgme-0.3.16# ./configure
checking for a BSD-compatible install... /usr/bin/ginstall -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... gcc
checking for C compiler default output... configure: error: C compiler cannot create executables
See `config.log' for more details.
root@hostname:/home/user/downloads/gpgme-0.3.16#
--------------------------------------------------------------
root@hostname:/proc/bus/usb# ld --as-needed
ld: unrecognized option '--as-needed'
ld: use the --help option for usage information
root@hostname:/proc/bus/usb#
----------------------------------------------------------------

so i realized that the problem came from ld, but how can i fix this? where is this --as-needed option specified? if any more info is needed, I'm here.

system:
slackware 9, updated occasionally to -current though swaret
celeron 600mhz, 192 mb ram, 10gb harddrive.

Last edited by aoe2bug; 07-10-2010 at 03:25 AM. Reason: anon
 
Old 07-15-2004, 10:31 PM   #2
thegeekster
Member
 
Registered: Dec 2003
Location: USA (Pacific coast)
Distribution: Vector 5.8-SOHO, FreeBSD 6.2
Posts: 513

Rep: Reputation: 33
AFAIK, 'ld' doesn't have the option '--as-needed'..............my guess is whatever installation is passing that option is at fault............ld is the GNU linker and found in the binutils package...............I just upgraded my kernel a couple of days ago to version 2.4.26, and I had no problems upgrading (other than some problems with not making the correct modules in the menuconfig, but that was user error.... )

As for configureing that gpg package, the problem is with the compiler itself and says to look in the " 'config.log' for more details"..............could be it's not finding the right header files (aka, "includes").......
 
Old 07-15-2004, 11:57 PM   #3
aoe2bug
LQ Newbie
 
Registered: Apr 2004
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks. I figured that '--as-needed' probably wasn't a valid option, but where would it be configured? (how can i turn it off). the config.log file just shows the ld error i posted, i was just using gpg as an example. I've never had any problems before with compiling. i compiled linux 2.6.4 and .5 and .6 easily. (i was bored the weeks that they were released). anyway, i was going to do a complete reinstall with 10 anyway, (it would be easier then figuring out which packages to uninstall to free up space, 300mb left) if anyone knows how to change the ld thing that'd be great, but otherwise thanks thegeekster.

Last edited by aoe2bug; 07-10-2010 at 03:26 AM. Reason: anon
 
Old 08-15-2004, 02:33 PM   #4
dhcernese
LQ Newbie
 
Registered: Aug 2004
Location: New England
Distribution: debian
Posts: 3

Rep: Reputation: 0
did you ever find a solution?

I have the same problem. Two systems,

one is Debian/testing on Itanium
one is Debian/testing on Alpha

both are using identical versions of gcc+ld:
gcc (GCC) 3.3.4 (Debian 1:3.3.4-6sarge1)
GNU ld version 2.14.90.0.7 20031029 Debian GNU/Linux

(2.14.90.0.7 is also the binutils version on both)
The Itanium can compile just fine. Same code on Alpha gets the error you discovered:

/usr/bin/ld: unrecognized option '--as-needed'

Anyone know the solution?
 
Old 08-16-2004, 10:35 PM   #5
aoe2bug
LQ Newbie
 
Registered: Apr 2004
Posts: 10

Original Poster
Rep: Reputation: 0
no, sorry. i never had a chance to fix the problem. but im going to do a clean install of slackware 10, so i think that will solve it.
 
Old 08-17-2004, 06:59 PM   #6
dhcernese
LQ Newbie
 
Registered: Aug 2004
Location: New England
Distribution: debian
Posts: 3

Rep: Reputation: 0
work around

I worked around the problem by editing
/usr/lib/gcc-lib/<platform>/<version>/specs file
to remove the --as-needed and --noas-needed switches,
now everything works!

it's very strange that this problem occurs with the same exact version of gcc+binutils that don't have a problem on other platforms.
 
  


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
bash script: using "select" to show multi-word options? (like "option 1"/"o zidane_tribal Programming 6 03-21-2013 11:35 AM
Unrecognized PCMCIA card - "Intel AnyPoint" wireless ethernet adamwynne Linux - Laptop and Netbook 1 07-15-2004 10:50 PM
XF86Config : Option "Resolution" "800" carboncopy Slackware 2 12-16-2003 11:13 PM
Option "ZAxisMapping" "4 5" won't work apax Linux - Hardware 7 11-06-2003 10:41 AM
anging "Protocol" option to "IMPS/2" in XF86Config-4 causes problems zstingx Linux - General 2 10-27-2003 10:47 AM


All times are GMT -5. The time now is 06:15 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration