Page MenuHomeFreeBSD

Add LLD_UNSAFE to force use of ld.bfd when ld is lld
ClosedPublic

Authored by emaste on Aug 17 2017, 1:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 30, 6:10 PM
Unknown Object (File)
Fri, May 24, 8:35 AM
Unknown Object (File)
Wed, May 22, 5:44 PM
Unknown Object (File)
May 16 2024, 1:32 AM
Unknown Object (File)
May 13 2024, 11:34 AM
Unknown Object (File)
May 9 2024, 9:28 PM
Unknown Object (File)
May 8 2024, 12:34 AM
Unknown Object (File)
May 6 2024, 3:14 PM
Subscribers
None

Details

Summary

By default the compiler will find /usr/bin/ld for the linker. If the port sets LLD_UNSAFE and /usr/bin/ld is ld.lld, then add -fuse-ld=bfd to force the use of the binutils BFD linker (from the base system, if available, or by setting USE_BINUTILS).

Based on an earlier, similar patch from bapt.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

For reference, the reason devel/libunwind does not work with LLD:

devel/libunwind: mark as LLD_UNSAFE

libunwind.so has symbols with ELF protected visibility which various
test applications attempt to preempt. Both GNU gold and LLVM's lld
fail to link this case, with errors like

lld:
/usr/bin/ld: error: cannot preempt symbol: _ULx86_64_init_local
>>> defined in ../src/.libs/libunwind.so
>>> referenced by Lperf-trace.c
>>>               Lperf-trace.o:(main)

gold:
/usr/local/bin/ld.gold: error: Gperf-simple.o: cannot make copy relocation
    for protected symbol '_Ux86_64_local_addr_space', defined in
    ../src/.libs/libunwind-x86_64.so

looks good to me as it is based on my own patch :)

This revision is now accepted and ready to land.Aug 17 2017, 1:53 PM
This revision was automatically updated to reflect the committed changes.