[Bug 221808] archivers/lua51-zlib: port passes $LDFLAGS to direct linker invocation, not compiler driver

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Aug 29 17:27:32 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221808

--- Comment #2 from Ed Maste <emaste at freebsd.org> ---
(In reply to Sir l33tname from comment #1)
Thanks for the patch - I will review and test it here.

For the majority of ports that invoke the compiler driver (${CC}) to link the
easiest way to test with lld is to add -fuse-ld=lld to LDFLAGS. For ports that
invoke the linker directly (as this one appears to) setting LD=ld.lld in the
environment is probably sufficient.

You can also make /usr/bin/ld a link to one of ld.bfd and ld.lld to select the
default linker. In -current /usr/bin/ld is a hard link to ld.bfd by default, or
a symlink to ld.lld if WITH_LLD_IS_LD is set.

You can verify that lld was used for linking by checking the .comment section.
lld inserts a "Linker: ' comment with a version string. For example:

nuc% readelf --string-dump=.comment /bin/ls

String dump of section '.comment':
  [     1]  $FreeBSD$
  [     b]  FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based
on LLVM 4.0.0)
  [    5d]  FreeBSD clang version 5.0.0 (trunk 306956) (based on LLVM 5.0.0svn)
  [    a1]  Linker: LLD 5.0.0 (FreeBSD 311606)

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list