This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: GCC errors: unrecognized option '--as-needed'
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: Amish C++ <amishcplusplus at yahoo dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 09 Dec 2004 11:19:58 -0500
- Subject: Re: GCC errors: unrecognized option '--as-needed'
- References: <20041209160839.28404.qmail@web61310.mail.yahoo.com>
Amish C++ <amishcplusplus@yahoo.com> writes:
> I am getting the following error when I try to compile
> a simple 'hello world' program. :
> /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../../i486-slackware-linux/bin/ld:
> unrecognized option '--as-needed'
> It's looking for the assembler program but for some
> reason can't find it and I don't know where to look
> for it. What happened was that I upgraded GCC from 3.2
> to 3.3.4. GCC was working fine before but now it gives
> me this error. Can anybody help me fix this?
You need a newer version of the linker. The --as-needed option was
added in binutils 2.15.
Normally if you build the compiler yourself it will determine whether
the system linker supports the --as-needed option, and decide whether
to use it based on that. I'm guessing that you did not build the
compiler yourself, and that whoever did build it built it on a system
with binutils 2.15 installed.
Ian