Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 269459

Summary: sys-devel/binutils: gold linker does not support -pie
Product: Gentoo Linux Reporter: Alec Meyers <alecm_88>
Component: [OLD] Core systemAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 269315    

Description Alec Meyers 2009-05-11 20:17:25 UTC
sys-apps/dbus-1.2.12 fails with the following error:

i686-pc-linux-gnu-gcc -O2 -march=native -pipe -fomit-frame-pointer -fno-ident -rdynamic -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpo
inter-arith -Wcast-align -Wdeclaration-after-statement -fno-common -Wno-unused -Wno-sign-compare -Wno-pointer-sign -Wno-format -fno-strict-aliasing -Wl,-O1 -Wl,--as-needed -o db
us-daemon-launch-helper activation-helper-bin.o config-loader-expat.o config-parser-common.o config-parser-trivial.o desktop-file.o utils.o activation-helper.o  /usr/lib/libexpa
t.so ../dbus/.libs/libdbus-convenience.a
/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/../../../../i686-pc-linux-gnu/bin/ld: -pie: unknown option
/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/../../../../i686-pc-linux-gnu/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status
make[2]: *** [dbus-daemon] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/var/tmp/portage/sys-apps/dbus-1.2.12/work/dbus-1.2.12/bus'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/sys-apps/dbus-1.2.12/work/dbus-1.2.12'
make: *** [all] Error 2


Reproducible: Always

Steps to Reproduce:
1. # USE=gold" emerge =binutils-2.19.51.0.4
2. # emerge =sys-apps/dbus-1.2.12

Actual Results:  
dbus fails to emerge.

Expected Results:  
A. dbus should build successfully

-or-

B. binutils should come with a big warning that "gold" USE flag might cause problems.
Comment 1 Gilles Dartiguelongue (RETIRED) gentoo-dev 2009-05-11 20:29:38 UTC
are we seriously working towards supporting gold linker ?
Comment 2 Peter Alfredsen (RETIRED) gentoo-dev 2009-05-11 20:39:30 UTC
(In reply to comment #1)
> are we seriously working towards supporting gold linker ?

Currently only the "patches accepted" kind of "working towards".
Comment 3 Steev Klimaszewski (RETIRED) gentoo-dev 2009-05-14 13:12:04 UTC
Ryan added <flag name='gold'>Use the new gold linker (written in C++) rather than the standard linker (this _will_ break things)</flag> to the metadata.xml for binutils sometime today.  Seriously though, did you really expect everything to "just work(tm)" with the new experimental linker?  You have to actively enable it, and one would hope you don't just arbitrarily turn on use flags because they sound shiny (oooh gold, must be good.)

I'm not trying to be snarky - if you are enabling experimental features, you should know what you are doing.  I am not suggesting you don't, I am just making a general observation.

Ideally, this bug would have looked like this:

When using the gold linker from binutils, sys-apps/dbus-1.2.12 fails with the following error:

i686-pc-linux-gnu-gcc -O2 -march=native -pipe -fomit-frame-pointer -fno-ident
-rdynamic -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes
-Wnested-externs -Wpo
inter-arith -Wcast-align -Wdeclaration-after-statement -fno-common -Wno-unused
-Wno-sign-compare -Wno-pointer-sign -Wno-format -fno-strict-aliasing -Wl,-O1
-Wl,--as-needed -o db
us-daemon-launch-helper activation-helper-bin.o config-loader-expat.o
config-parser-common.o config-parser-trivial.o desktop-file.o utils.o
activation-helper.o  /usr/lib/libexpa
t.so ../dbus/.libs/libdbus-convenience.a
/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/../../../../i686-pc-linux-gnu/bin/ld:
-pie: unknown option
/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/../../../../i686-pc-linux-gnu/bin/ld: use
the --help option for usage information
collect2: ld returned 1 exit status

Attached is the patch and a patch to the ebuild.

Patch has been submitted upstream at http://fdobugs/bugid
Comment 4 Ryan Hill (RETIRED) gentoo-dev 2009-05-14 22:57:47 UTC
no, it's not packages that need fixing, it's the linker.  there is no "patch" that can be provided.
Comment 5 Ryan Hill (RETIRED) gentoo-dev 2009-05-14 23:04:30 UTC
...to dbus that is.  you know what i mean. :P
Comment 6 Alec Meyers 2009-05-15 00:21:55 UTC
(In reply to comment #3)
> Ryan added <flag name='gold'>Use the new gold linker (written in C++) rather
> than the standard linker (this _will_ break things)</flag> to the metadata.xml
> for binutils sometime today.

Thanks! 

> Seriously though, did you really expect
> everything to "just work(tm)" with the new experimental linker?  You have to
> actively enable it, and one would hope you don't just arbitrarily turn on use
> flags because they sound shiny (oooh gold, must be good.)

Actually, Steev, I did do some research. The only thing I was surprised about was that considering that it was released little more than a month ago, there was nothing in the USE-flag description saying that it was experimental.

Am I upset that dbus does not build? No.

Did I expect things to break? I did. I've considered the outcomes: Best case - I save a few minutes from my 300-package update; worst case - everything breaks and I reinstall as amd64. I built around 50 packages with the new linker until I hit something that I did not want to skip, and then I switched back to ld.

> I'm not trying to be snarky - if you are enabling experimental features, you
> should know what you are doing.  I am not suggesting you don't, I am just
> making a general observation.
> 
> Ideally, this bug would have looked like this:
> 
> When using the gold linker from binutils, sys-apps/dbus-1.2.12 fails with the
> following error:
>
> ...
>
> Attached is the patch and a patch to the ebuild.
> 
> Patch has been submitted upstream at http://fdobugs/bugid

Ideally, yes, that would be great. However, I am not am neither a Gentoo nor a Binutils developer, I do not intend to become one anytime soon. As a user, I encountered problems, and reported them. (I reported 4 related to the gold linker.) If you feel you can find them all by yourself, then feel free to ignore my reports.
Comment 7 SpanKY gentoo-dev 2009-10-14 05:49:15 UTC
upstream has added support for -pie.  it'll trickle down into newer versions of binutils over time.