ld.gold

649 views
Skip to first unread message

Thiago Farina

unread,
Feb 16, 2015, 11:20:00 AM2/16/15
to Chromium-dev
What could be causing the following?

/usr/bin/ld.gold: warning: ignoring --threads: /usr/bin/ld.gold was compiled without thread support

Somehow it seems to be using ld.gold rather than my /usr/bin/gold.

Has anyone encountered this too?

-- 
Thiago Farina

Mostyn Bramley-Moore

unread,
Feb 16, 2015, 1:27:50 PM2/16/15
to chromi...@chromium.org, Thiago Farina
On 02/16/2015 05:19 PM, Thiago Farina wrote:
> What could be causing the following?
>
> /usr/bin/ld.gold: warning: ignoring --threads: /usr/bin/ld.gold was
> compiled without thread support
>
> Somehow it seems to be using ld.gold rather than my /usr/bin/gold.

On many linux systems, /usr/bin/gold is just a symlink to
/usr/bin/ld.gold (or ld.bfd). And for some reason, threaded support for
gold is off by default last time I checked.

> Has anyone encountered this too?

Not for a while. Is this the gyp build or gn? Can you paste the
failing link command? (I suspect gyp, since it looks like the gn build
doesn't use gold's --threads flag yet.)

IIRC the compiler has a default linker name and set of paths to find it
compiled in, and that can be modified with -fuse-ld=gold or -fuse-ld=bfd
to pick one of the predefined linkers, or -B<path to binutils dir> to
use a custom ld executable inside.

There are a few gyp settings to play with: linux_use_bundled_gold and
linux_use_bundled_binutils to use the included binutils or just gold. I
would recommend this unless you're cross compiling and need to use a
specific toolchain.

linux_use_gold_flags will toggle whether or not to use gold-specific
flags like --threads. I would recommend this if you specifically want
to use your system's native linker.


-Mostyn.
--
Mostyn Bramley-Moore
TV and Connected Devices
Opera Software ASA
mos...@opera.com

Thiago Farina

unread,
Feb 16, 2015, 1:44:29 PM2/16/15
to Mostyn Bramley-Moore, Chromium-dev
I was using GYP.

I have this in my GYP_DEFINES:

linux_use_gold_binary=1
linux_use_gold_flags=1

Looks like setting these variables might be causing this. And hey, looks like linux_use_gold_binary is gone!

I will try removing those and see how it goes.

--
Thiago Farina

Mostyn Bramley-Moore

unread,
Feb 16, 2015, 2:03:39 PM2/16/15
to Thiago Farina, Chromium-dev
That should work.

Otherwise just change the first setting to linux_use_bundled_gold=1
(which might link slightly faster, but last time I checked it was not a
significant improvement).

Egor Pasko

unread,
Feb 23, 2015, 3:58:41 AM2/23/15
to Thiago Farina, Mostyn Bramley-Moore, Chromium-dev
If you sync to tip of the tree, you'll probably stop seeing the warning. There were experiments in enabling threaded linking, but the gold linker was not configured properly everywhere:
Reply all
Reply to author
Forward
0 new messages