Page MenuHomeFreeBSD

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

Authored by emaste on Aug 17 2017, 1:30 PM.



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

rP FreeBSD ports repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

emaste created this revision.Aug 17 2017, 1:30 PM

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

devel/libunwind: mark as LLD_UNSAFE 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

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

/usr/local/bin/ error: Gperf-simple.o: cannot make copy relocation
    for protected symbol '_Ux86_64_local_addr_space', defined in
bapt accepted this revision.Aug 17 2017, 1:53 PM

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.