Open Bug 1384434 (linker-lld) Opened 7 years ago Updated 2 years ago

[meta] Link with LLD

Categories

(Firefox Build System :: General, enhancement)

enhancement

Tracking

(firefox57 wontfix)

Tracking Status
firefox57 --- wontfix

People

(Reporter: Sylvestre, Unassigned)

References

(Depends on 2 open bugs)

Details

(Keywords: meta)

Attachments

(2 files)

On an old workstation (8 cpu, 32g of RAM and SSD)
linker libxul.so with LD:
real	0m22,170s
user	0m19,660s
sys	0m1,976s

with LLD:
real	0m3,147s
user	0m4,904s
sys	0m1,276s

I tried also with a more recent system and it is very similar: 0m17,772s / 0m2,745s
Depends on: 1385783
Depends on: 1388713
Depends on: 1391183
No longer depends on: 1341525
And we can now link without --disable-elf-hack!
Depends on: 1425692
Depends on: 1426466
Depends on: 1423822
Product: Core → Firefox Build System
Depends on: 1453444
Depends on: 1473436
Depends on: 1458109
Depends on: 1475384
Depends on: 1482268
Depends on: 1483822
Depends on: 1538724

I didn't know about ldd, until :aceman told me about it today. Instead of 4 minutes, linking takes only 15 seconds on my system.

Is there a reason this isn't enabled automatically on platforms that support it?

(In reply to Kai Engert (:kaie:) from comment #2)

I didn't know about ldd, until :aceman told me about it today. Instead of 4 minutes, linking takes only 15 seconds on my system.

Is there a reason this isn't enabled automatically on platforms that support it?

It is supposed to be the default for developer builds, what does your mozconfig look like?

Attached file mozconf-without-lld

With this config, ld is used (not lld).

Flags: needinfo?(nfroyd)
Attachment #9081709 - Attachment mime type: application/octet-stream → text/plain

What does your $OBJDIR/config.log and $OBJDIR/config.status look like?

Flags: needinfo?(nfroyd)

(In reply to Nathan Froyd [:froydnj] from comment #5)

What does your $OBJDIR/config.log and $OBJDIR/config.status look like?

attached

Flags: needinfo?(nfroyd)

Hm, unfortunately the log doesn't contain enough information to debug just by looking at it. What does $HOME/.mozbuild/clang/bin/clang -std=gnu99 -Wl,--version -fuse-ld=lld say? That is what we should be running when we get here:

https://searchfox.org/mozilla-central/source/build/moz.configure/toolchain.configure#2014-2023

and apparently that check is failing.

Flags: needinfo?(nfroyd)
$ $HOME/.mozbuild/clang/bin/clang -std=gnu99 -Wl,--version -fuse-ld=lld
LLD 8.0.0 (compatible with GNU linkers)

How can I print to the terminal from inside that script?
It seems to be python, but trying to use "print" results in errors.

It seems try_linker('lld') isn't executed.

(In reply to Kai Engert (:kaie:) from comment #10)

How can I print to the terminal from inside that script?
It seems to be python, but trying to use "print" results in errors.

It seems try_linker('lld') isn't executed.

You should be able to call log.info(...) to print.

Thanks.

The reason try_linker('lld') isn't reached: developer_options is false.

(In reply to Kai Engert (:kaie:) from comment #12)

Thanks.

The reason try_linker('lld') isn't reached: developer_options is false.

Are you compiling a beta/release version of Thunderbird?

My local build script, which I've been updating since many years, indeed contains two related symbol definitions:

export MOZILLA_OFFICIAL=1
export BUILD_OFFICIAL=1

If I remove those, then I get lld...

I don't remember why I had set those flags in the past, it was probably necessary for some local testing.

Out of topic but maybe we should show a warning at the end of the build
like
"please note that you are building an official version of Firefox. Options might be different".

Severity: normal → S3
Depends on: 1799423
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: