Closed Bug 1453444 Opened 7 years ago Closed 6 years ago

Add support for versioned lld binaries

Categories

(Firefox Build System :: General, enhancement)

enhancement
Not set
normal

Tracking

(firefox62 fixed)

RESOLVED FIXED
mozilla62
Tracking Status
firefox62 --- fixed

People

(Reporter: francois, Assigned: Sylvestre)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

I installed the lld-6.0 package on Debian stretch from this repo: deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch main Unfortunately, it doesn't come with an `lld` symlink. My .mozconfig: export CC=clang-6.0 export CXX=clang++-6.0 #ac_add_options --enable-linker=lld-6.0 That last line doesn't currently work but it would be great if it did.
deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch main Should provide the meta package lld [1] which should create a symlink from /usr/bin/lld to /usr/bin/lld-6.0 It should fix your problem. However, I agree that being able to pass lld-6.0 would be great but currently, the --enable-linker is expecting a category of linker, not a binary name. Now, the good news is that fuse-ld in clang can accept a binary: $ clang-6.0 -fuse-ld=lld-6.0 -O2 foo.c main.c -o foo But this isn't the case of gcc: $ g++-7 -fuse-ld=lld-6.0 -O2 foo.c main.c -o foo g++-7: error: unrecognized command line option ‘-fuse-ld=lld-6.0’; did you mean ‘-fuse-ld=lld’? [1] http://apt.llvm.org/stretch/pool/main/l/llvm-defaults/lld_7-42~exp3%2b0~20180419084638.15~1.gbpb7f8c9_amd64.deb
Assignee: nobody → sledru
(In reply to Sylvestre Ledru [:sylvestre] from comment #1) > deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch main > Should provide the meta package lld [1] which should create a symlink from > /usr/bin/lld to /usr/bin/lld-6.0 Sadly it depends on llvm-7 (7~svn330642-1~exp1+0~20180423203234).
Version: Version 3 → Trunk
Mike, as it seems that choices=() in the python configure cannot take syntax like "lld-*" Would you r+ an explicit list of version like lld-6.0, lld-7 ? Thanks
Flags: needinfo?(mh+mozilla)
Just don't use choices, and validate the value in the function itself?
Flags: needinfo?(mh+mozilla)
Depends on: 1455767
Blocks: linker-lld
Comment on attachment 8973525 [details] Bug 1453444 - Add support for versioned lld binaries https://reviewboard.mozilla.org/r/241880/#review248094 ::: build/moz.configure/toolchain.configure:1528 (Diff revision 1) > @imports('os') > @imports('shutil') > def select_linker(linker, c_compiler, developer_options, build_env, toolchain_flags): > linker = linker[0] if linker else 'other' > + > + if linker not in ('bfd', 'gold', 'other') and not linker.startswith("lld"): you may want to add 'lld' to the tuple, and check startswith('lld-') ::: build/moz.configure/toolchain.configure:1579 (Diff revision 1) > return namespace( > KIND='lld', > LINKER_FLAG=lld, > ) > else: > die("Could not use lld as linker") this should say the exact string that was passed in instead of "lld"
Attachment #8973525 - Flags: review?(mh+mozilla)
Comment on attachment 8973525 [details] Bug 1453444 - Add support for versioned lld binaries https://reviewboard.mozilla.org/r/241880/#review248144 ::: build/moz.configure/toolchain.configure:1504 (Diff revision 2) > when=is_linker_option_enabled) > > imply_option('--enable-linker', 'gold', when='--enable-gold') > > js_option('--enable-linker', nargs=1, > - choices=('bfd', 'gold', 'lld', 'other'), > + help='Select the linker {bfd, gold, lld, lld-X, other}', maybe replace X with *
Attachment #8973525 - Flags: review?(mh+mozilla) → review+
Pushed by sledru@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c79c482d50a3 Add support for versioned lld binaries r=glandium
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: