[uClibc] gcc and ld

Ned Ludd solar at gentoo.org
Sun Sep 19 02:13:46 UTC 2004


On Sat, 2004-09-18 at 17:05, Frank Kujawski wrote:
> I ran make out of the build directory:
> 
> [root at bear buildroot]# ls toolchain_build_i386/
> binutils-2.14.90.0.6  ccache-2.3  gcc-3.3-final    linux
> binutils-build        gcc-3.3.4   gcc-3.3-initial  uClibc_dev
> [root at bear buildroot]#
> 
> and these are the only changes I made to the make file:
>         #BUILD_WITH_LARGEFILE:=true
>         #INSTALL_LIBSTDCPP:=true
>         JLEVEL=-j3
>         TARGETS+=dropbear_sshd
>         TARGETS+=coreutils findutils bash make diffutils patch sed
>         TARGETS+=ed flex bison file gawk tar grep bzip2
>         #TARGETS+=ext2root
> 
>     Frank
> 
> 
> On Sat, 2004-09-18 at 16:59, Manuel Novoa III wrote:
> > Hello,
> > 
> > On Sat, Sep 18, 2004 at 04:58:23PM -0400, Frank Kujawski wrote:
> > > Perhaps if I included all my thoughts, the replies would be of more
> > > use.  Sorry,
> > > 	Frank
> > > 
> > > where/why does the '--as-needed' come from? and how do I get gcc not to
> > > call ld with this option.

Starting with binutils-2.15 the as-needed was added. When building gcc
if it detects the option it will add it to the shared section of your
gcc specs. This is really not ideal as it locks your gcc/binutils
versions together for the first time in history.

The simple fix for me and gentoo was to disable that from being
automatic in gcc and only use --as-needed when needed which I've never
needed it yet.

sed -i -e s/HAVE_LD_AS_NEEDED/USE_LD_AS_NEEDED/g gcc/config.in

If you don't want to rebuild gcc just edit the specs and yank the
offending flag. gcc -print-file-name=specs

more info on as-needed can be found here. 
http://gcc.gnu.org/ml/gcc-bugs/2004-04/msg01420.html

good luck.


> > > 
> > > 
> > > sh-2.05b# gcc -Wall  -D__USE_FIXED_PROTOTYPES__  -o sgu sgu.c
> > > /usr/bin/ld: unrecognized option '--as-needed'
> > > /usr/bin/ld: use the --help option for usage information
> > > collect2: ld returned 1 exit status
> > > sh-2.05b#
> > 
> > How did you build your toolchain?  What versions of gcc and binutils?
> > 
> > Manuel
> 
> 
> ______________________________________________________________________
> _______________________________________________
> uClibc mailing list
> uClibc at uclibc.org
> http://uclibc.org/mailman/listinfo/uclibc
-- 
Ned Ludd <solar at gentoo.org>
Gentoo (hardened,security,infrastructure,embedded,toolchain) Developer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20040918/f403f006/attachment-0002.pgp 


More information about the uClibc mailing list