[SERVER-72324] Toolchain v4 GCC uses system lld when building with -fuse-ld=lld Created: 07/Dec/22  Updated: 29/Oct/23  Resolved: 30/Dec/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.3.0-rc0

Type: Bug Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Daniel Moody
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
duplicates SERVER-49515 Re-enable lld for dynamic builds Closed
Problem/Incident
Backwards Compatibility: Fully Compatible
Participants:
Linked BF Score: 135

 Description   

$ strace -f -o trace /opt/mongodbtoolchain/v4/bin/g++ -gno-record-gcc-switches -g2 -gdwarf-5 -gdwarf32 ./hello_world.cpp -o a.out.32 -fuse-ld=lld
 
$ grep execve trace | grep /ld.lld
62763 execve("/usr/bin/ld.lld", ["/usr/bin/ld.lld", "-plugin", "/opt/mongodbtoolchain/revisions/"..., "-plugin-opt=/opt/mongodbtoolchai"..., "-plugin-opt=-fresolution=/tmp/cc"..., "-plugin-opt=-pass-through=-lgcc_"..., "-plugin-opt=-pass-through=-lgcc", "-plugin-opt=-pass-through=-lc", "-plugin-opt=-pass-through=-lgcc_"..., "-plugin-opt=-pass-through=-lgcc", "--build-id", "--eh-frame-hdr", "--hash-style=gnu", "-m", "elf_x86_64", "-dynamic-linker", "/lib64/ld-linux-x86-64.so.2", "-o", "a.out.32", "/lib/x86_64-linux-gnu/crt1.o", "/lib/x86_64-linux-gnu/crti.o", "/opt/mongodbtoolchain/revisions/"..., "-L/opt/mongodbtoolchain/revision"..., "-L/opt/mongodbtoolchain/revision"..., "-L/lib/x86_64-linux-gnu", "-L/lib/../lib64", "-L/usr/lib/x86_64-linux-gnu", "-L/usr/lib/../lib64", "-L/opt/mongodbtoolchain/revision"..., "-L/opt/mongodbtoolchain/revision"..., "/tmp/cc2riUHv.o", "-lstdc++", ...], 0x7fff3374d448 /* 31 vars */ <unfinished ...>

If there is no system ld.lld, the build fails.



 Comments   
Comment by Githook User [ 29/Dec/22 ]

Author:

{'name': 'Daniel Moody', 'email': 'daniel.moody@mongodb.com', 'username': 'dmoody256'}

Message: SERVER-72324 switch to toolchain lld linker.
Branch: master
https://github.com/mongodb/mongo/commit/258f77aba1e7c76f7f665e6b07d83ba6978dea09

Generated at Thu Feb 08 06:21:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.