Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 487696 - toolchain-funcs: gen_usr_ldscript doesn't write OUTPUT_FORMAT when using ld.gold
Summary: toolchain-funcs: gen_usr_ldscript doesn't write OUTPUT_FORMAT when using ld.gold
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: systemwide-gold 487138
  Show dependency tree
 
Reported: 2013-10-11 20:33 UTC by Michał Górny
Modified: 2021-03-06 05:29 UTC (History)
5 users (show)

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 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-11 20:33:18 UTC
When ld.gold is used as the linker, -Wl,--verbose doesn't output the OUTPUT_FORMAT line. As a result, gen_usr_ldscript doesn't write that in the linker script and the scripts confuse the linker w/ multilib.
Comment 1 SpanKY gentoo-dev 2013-10-12 19:53:31 UTC
i don't think there's a way to tease out the info from gold.  i'm also not sure how much effort we want to expend on this when bug 479448 is coming.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-12 20:31:01 UTC
(In reply to SpanKY from comment #1)
> i don't think there's a way to tease out the info from gold.  i'm also not
> sure how much effort we want to expend on this when bug 479448 is coming.

It will still affect the packages afte 479448 is fixed. The underlying issue was that 'gcc -m32' found /usr/lib64/libfoo.la with no OUTPUT_FORMAT and assumed it is fine.

By the way, I think this function should actually read the output format from the library being wrapped rather than an unrelated linker invocation.
Comment 3 SpanKY gentoo-dev 2013-10-12 21:32:17 UTC
(In reply to Michał Górny from comment #2)

i think the underlying issue there is that people are using bad -L flags.  i added this hack way back when really only to mitigate things (and clearly it's been working, but maybe too well).

reading the output format from the wrapped lib does make a lot of sense.  i'd have to play around with binutils though to see if they support such a thing.

i remembered that glibc has similar code to auto use ld.bfd when gold is active, so i just cribbed that logic:
http://sources.gentoo.org/eclass/toolchain-funcs.eclass?r1=1.122&r2=1.123

i'll leave this open though as a reminder to investigate the lib probing angle.