Bug 247990 - LLD_UNSAFE from bsd.port.mk does not work in thin jails
Summary: LLD_UNSAFE from bsd.port.mk does not work in thin jails
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks: 247983
  Show dependency treegraph
 
Reported: 2020-07-15 08:01 UTC by Michael Osipov
Modified: 2020-07-15 09:21 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Osipov 2020-07-15 08:01:30 UTC
I am using thin jails with ezjail and ran into https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247983.
The reason for this is that make's ':tA' uses realpath which leads to the symlinked basejail and results in a failed if clause. This seems to be the only spot in the Mk system (except bsd.gecko.k) for this.

Here is a patch which solves my issue:
root@bsd1srv:/usr/ports/Mk
# svn diff
Index: bsd.port.mk
===================================================================
--- bsd.port.mk (Revision 542158)
+++ bsd.port.mk (Arbeitskopie)
@@ -1851,7 +1851,7 @@
 .include "${PORTSDIR}/Mk/bsd.gcc.mk"
 .endif

-.if defined(LLD_UNSAFE) && ${/usr/bin/ld:L:tA} == /usr/bin/ld.lld
+.if defined(LLD_UNSAFE) && ( ${/usr/bin/ld:L:tA} == /usr/bin/ld.lld || ${/usr/bin/ld:L:tA} == /basejail/usr/bin/ld.lld )
 LDFLAGS+=      -fuse-ld=bfd
 BINARY_ALIAS+= ld=${LD}
 .  if ${ARCH} == powerpc64

Whether this is a suitable fix or there can be a better one, you decide.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2020-07-15 09:21:03 UTC
Patch against Mk/bsd.port.mk.