Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 193042 - ld from binutils 2.18 doesn't support -Wl
Summary: ld from binutils 2.18 doesn't support -Wl
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Highest blocker (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-19 10:31 UTC by Radoslaw Szkodzinski
Modified: 2007-09-20 02:08 UTC (History)
0 users

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 Radoslaw Szkodzinski 2007-09-19 10:31:13 UTC
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
Comment 1 SpanKY gentoo-dev 2007-09-19 14:01:54 UTC
ld has *never* supported -Wl

-Wl is a flag for the compiler driver (aka gcc), not a flag for ld
Comment 2 Radoslaw Szkodzinski 2007-09-19 17:09:47 UTC
Yeah right, except it worked. Please be more informed.
Other than that - why so many programs catenate $LDFLAGS to $CFLAGS?
Comment 3 Radoslaw Szkodzinski 2007-09-19 17:10:14 UTC
Sorry for additional spam - check man ld too.
Comment 4 Radoslaw Szkodzinski 2007-09-19 17:33:23 UTC
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'

Comment 5 Radoslaw Szkodzinski 2007-09-19 17:41:22 UTC
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
Comment 6 SpanKY gentoo-dev 2007-09-20 02:08:21 UTC
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