Binutils 2.18's ld doesn't support -Wl,* flag. This makes multiple critical applications fail (e.g. udev). Also, removing -Wl prefixes from LDFLAGS makes other apps fail, even binutils' own configure script. This version of binutils is marked ~ on many architectures. Example: localhost / # ld --as-needed ld: no input files localhost / # ld -Wl,--as-needed ld: unrecognized option '-Wl,--as-needed' ld: use the --help option for usage information
ld has *never* supported -Wl -Wl is a flag for the compiler driver (aka gcc), not a flag for ld
Yeah right, except it worked. Please be more informed. Other than that - why so many programs catenate $LDFLAGS to $CFLAGS?
Sorry for additional spam - check man ld too.
Other than that, please somehow resolve the situation, either by fixing zillion configure scripts and make files (great idea), including binutils', udev, gcc, or masking this worthless thing. Every wondered why nobody posted it for binutils 2.17? Because it was supported. Example of failure mode: configure:3129: checking for C compiler default output file name configure:3132: x86_64-pc-linux-gnu-gcc -mtune=generic -O2 -pipe --as-needed - -sort-common -zcombreloc -O1 -zrelro --hash-style=both conftest.c >&5 x86_64-pc-linux-gnu-gcc: unrecognized option '-zcombreloc' x86_64-pc-linux-gnu-gcc: unrecognized option '-zrelro' cc1: error: unrecognized command line option "-fas-needed" cc1: error: unrecognized command line option "-fsort-common" cc1: error: unrecognized command line option "-fhash-style=both" configure:3135: $? = 1 This is from binutils 2.18 build config.log - similar failure on _all_ packages using configure scripts. LDFLAGS='--as-needed --sort-common -zcombreloc -O1 -zrelro --hash-style=both'
Another failure mode, sys-fs/udev-115-r1: <snip> make[1]: Opuszczenie katalogu `/tmp/portage/sys-fs/udev-115-r1/work/udev-115/extras/ata_id' make[1]: Wejście do katalogu `/tmp/portage/sys-fs/udev-115-r1/work/udev-115/extras/cdrom_id' make[1]: Wejście do katalogu `/tmp/portage/sys-fs/udev-115-r1/work/udev-115/extras/cdrom_id' LD cdrom_id make[1]: Wejście do katalogu `/tmp/portage/sys-fs/udev-115-r1/work/udev-115/extras/ata_id' install -c -m 644 -D ata_id.8 /tmp/portage/sys-fs/udev-115-r1/image//usr/share/man/man8/ata_id.8 no config file to install make[1]: Opuszczenie katalogu `/tmp/portage/sys-fs/udev-115-r1/work/udev-115/extras/cdrom_id' make[1]: Opuszczenie katalogu `/tmp/portage/sys-fs/udev-115-r1/work/udev-115/extras/ata_id' make[1]: Wejście do katalogu `/tmp/portage/sys-fs/udev-115-r1/work/udev-115/extras/edd_id' make[1]: Wejście do katalogu `/tmp/portage/sys-fs/udev-115-r1/work/udev-115/extras/cdrom_id' install -c -m 644 -D cdrom_id.8 /tmp/portage/sys-fs/udev-115-r1/image//usr/share/man/man8/cdrom_id.8 no config file to install make[1]: Opuszczenie katalogu `/tmp/portage/sys-fs/udev-115-r1/work/udev-115/extras/edd_id' ld: unrecognized option '-Wl,-warn-common,--as-needed' ld: use the --help option for usage information make[1]: *** [cdrom_id] Błąd 1 make[1]: Opuszczenie katalogu `/tmp/portage/sys-fs/udev-115-r1/work/udev-115/extras/cdrom_id' make: *** [install-bin] Błąd 1
you're confusing things LDFLAGS are the linker flags as seen by the compiler driver ... that means you need to use the -Wl form the linker itself has never supported -Wl as the compiler driver strips that and expands the comma options