Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 49744 - gcc-3.4.0: trying to emerge gaim-0.77 - "ld: unrecognized option '--as-needed'"
Summary: gcc-3.4.0: trying to emerge gaim-0.77 - "ld: unrecognized option '--as-needed'"
Status: RESOLVED DUPLICATE of bug 50211
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Please assign to toolchain
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-02 12:22 UTC by Kit Fenderson-Peters
Modified: 2005-07-17 13:06 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kit Fenderson-Peters 2004-05-02 12:22:39 UTC
While trying to emerge gaim-0.77 (not to mention certain other packages) I got the error while running configure:

checking for C compiler default output... configure: error: C compiler cannot create executables
See `config.log' for more details.

config.log shows: 

configure:2289: checking for C compiler default output
configure:2292: gcc    conftest.c  >&5
/usr/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../i686-pc-linux-gnu/bin/ld: unrecognized option '--as-needed'
/usr/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../i686-pc-linux-gnu/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status

complete config.log is attached.


Reproducible: Always
Steps to Reproduce:
1. have gcc 3.4.0 installed
2. emerge gaim


Actual Results:  
Errors as mentioned above 

Expected Results:  
gaim should have emerged successfuly. 

emerge info: 
 
System uname: 2.6.6-rc3-mm1 i686 Intel(R) Pentium(R) M processor 1300MHz 
Gentoo Base System version 1.4.3.13 
Autoconf: sys-devel/autoconf-2.58-r1 
Automake: sys-devel/automake-1.8.3 
ACCEPT_KEYWORDS="x86" 
AUTOCLEAN="yes" 
CFLAGS="-march=pentium3 -O3 -pipe -msse2 -mfpmath=sse" 
CHOST="i686-pc-linux-gnu" 
COMPILER="gcc3" 
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/share/config /var/bind /var/qmail/control" 
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" 
CXXFLAGS="-march=pentium3 -O3 -pipe -msse2 -mfpmath=sse" 
DISTDIR="/usr/portage/distfiles" 
FEATURES="autoaddcvs ccache sandbox" 
GENTOO_MIRRORS="ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo 
http://gentoo.noved.org/ ftp://csociety-ftp.ecn.purdue.edu/pub/gentoo/ 
http://mirrors.tds.net/gentoo 
http://212.219.247.15/sites/www.ibiblio.org/gentoo/" 
MAKEOPTS="-j2" 
PKGDIR="/usr/portage/packages" 
PORTAGE_TMPDIR="/var/tmp" 
PORTDIR="/usr/portage" 
PORTDIR_OVERLAY="" 
SYNC="rsync://rsync.gentoo.org/gentoo-portage" 
USE="X aalib alsa apm arts avi berkdb cdr crypt cups encode esd foomaticdb gdbm 
gif gnome gpm gtk gtk2 imlib java jpeg kde libg++ libwww mad mikmod motif mpeg 
mysql ncurses nls oggvorbis opengl oss pam pdflib perl png python qt quicktime 
readline sdl slang spell ssl svga tcltk tcpd truetype video_cards_radeon x86 
xml2 xmms xv zlib"
Comment 1 Jory A. Pratt 2004-05-03 06:29:45 UTC
Something tells me you didnt rebuild glibc since you have update gcc. If this is the case it would explain the break in the linker. Try updating glibc and then rebuild gaim it should compile fine I have tested it on my box wich uses harsh cflags compared to what you have and builds fine.
Comment 2 Kit Fenderson-Peters 2004-05-03 08:55:28 UTC
It was recommended to me that I rebuild glibc.  I attempted to emerge glibc, using gcc-3.4.0, and was unsuccessful.  I had the same error. (i.e. 
/usr/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../i686-pc-linux-gnu/bin/ld: unrecognized option '--as-needed')

Attempting to re-emerge binutils produced the same result.



Comment 3 Jory A. Pratt 2004-05-03 09:01:17 UTC
Kit when did you build gcc 3.4 and if it is over a week old try to rebuild it ... it is most likely gonna give you the same error about not being able to find the linker.
Comment 4 Kit Fenderson-Peters 2004-05-03 10:48:30 UTC
in response to questions on when I built GCC 3.4.0 - I emerged it on 29 April 2004.
Comment 5 Don Seiler (RETIRED) gentoo-dev 2004-05-03 17:51:27 UTC
This is not a gaim problem.  The user states that he has problems with many other apps as well.  This is definitely a gcc-3.4.0 issue.
Comment 6 Robert Moss (RETIRED) gentoo-dev 2004-05-03 19:37:04 UTC
What about if you drop back to gcc-3.3.3 (assuming you didn't unmerge it) and attempt to recompile binutils, glibc and then gcc-3.4.0 - does that help?

Note that if you've compiled binutils with gcc-3.4.0 with "-O3" at any point, errors showing up all over the place are at best unsurprising...
Comment 7 Kit Fenderson-Peters 2004-05-03 22:19:11 UTC
I switched to gcc 3.3.3 and re-emerged binutils.  I then attempted to re-emerge glibc, which failed.

relevant portion of config.log:

onfigure:5434: gcc -march=pentium3 -pipe -O2 -freorder-blocks   -pie -fpie
                              -o conftest conftest.c 1>&5
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/../../../../i686-pc-linux-gnu/bin/ld: unreco
gnized option '--as-needed'
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/../../../../i686-pc-linux-gnu/bin/ld: use th
e --help option for usage information
collect2: ld returned 1 exit status


I have also modified my make.conf:

CFLAGS="-march=pentium3 -O2 -pipe -msse2 -mfpmath=sse"
CXXFLAGS="-march=pentium3 -O2 -pipe -msse2 -mfpmath=sse"
Comment 8 Jory A. Pratt 2004-05-04 06:00:55 UTC
there is no major problem when using -03 anywhere when your using gcc-3.4 I have rebuild over 400 packages using 3.4 without problem. Kit you are gonna have problems no matter what you try now that you rolled gcc back to 3.3.3 best thing you can do is find a binary of gcc and glibc and install them then rebuild using your optimization settings.
Comment 9 Jory A. Pratt 2004-05-04 08:42:38 UTC
I have gone threw many forums and found where your problem lies
binutils is your problem find a way to upgrade  to 2.15 and your compiler will be working again. hope that helps ya.
Comment 10 Brian G. Peterson 2004-05-11 08:25:51 UTC
Previous comment recommends upgrading to binutils 2.15.  The installed version of binutils on my system is binutils 2.14.90.0.8-r1, which is the latest available via emerge synce as I write this.

The original bug report lists gcc-3.4.0 but gcc-3.3.3-r3 is the current version in emerge sync and is also affected.

I am having the same problem across basically any emerge command.  I did an 'emerge -U world' on 8 May, and all other attempts to emerge since have failed.

the emerge command will generally fail with one of two errors, either the previously mentioned:

ld: unrecognized option '--as-needed'

error and the error in configure of:

checking for C compiler default output... configure: error: C compiler cannot create executables

If anyone has information on binutils 2.15, or other information on characterizing and resolving this problem, I'd certainly appreciate it.

It also seems that the severity of this bug should probably be higher than 'normal', given that it breaks the entire compile system...
Comment 11 Kit Fenderson-Peters 2004-05-11 08:43:19 UTC
I successfully resolved this problem by emerging binutils 2.15.  I used the ebuild:

/usr/portage/sys-devel/binutils/binutils-2.15.90.0.3-r1.ebuild

Date on this file is 4 May.

I have had no further problems emerging anything.
Comment 12 Brian G. Peterson 2004-05-11 09:01:36 UTC
binutils-2.15.90.0.3-r1 has been hard masked.

There are additional comments on this issue in the Forum at:

http://forums.gentoo.org/viewtopic.php?t=166696

It appears that the forced *downgrade* to binutils 2.14 after rebuilding gcc using binutils 2.15 is what is causing the problem.

It appears that this bug is actually a duplicate of bugs: 
Bug 49363
Bug 50441
Bug 50211 
Comment 13 Kit Fenderson-Peters 2004-05-13 13:48:25 UTC
Emerging binutils-2.15.90.0.3-r1 has resolved my problem.  I have successfully emerged gcc-3.4.0-r2 and gaim-0.77-r2.
Comment 14 Martin Holzer (RETIRED) gentoo-dev 2004-05-18 23:43:19 UTC
wrong solution closed
Comment 15 Martin Holzer (RETIRED) gentoo-dev 2004-05-18 23:43:29 UTC

*** This bug has been marked as a duplicate of 50211 ***