NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: toolchain/60000: split debug data rules broke ${.TARGET}-dependent flags



Attached patch aims to fix this.  I searched for `.${.TARGET}' and
this is the only one that came up, so maybe we're already otherwise
clean of this problem.
# HG changeset patch
# User Taylor R Campbell <riastradh%NetBSD.org@localhost>
# Date 1770970107 0
#      Fri Feb 13 08:08:27 2026 +0000
# Branch trunk
# Node ID f083a332526e1831201892f13204a6af0aabba6c
# Parent  1b592182187334d0db950753ee819bfab9e74ed8
# EXP-Topic riastradh-pr60000-bsdprogmkldstaticpie
bsd.prog.mk: Respect LDSTATIC.${PROG}, not LDSTATIC.${PROG}.link.

PR toolchain/60000: split debug data rules broke ${.TARGET}-dependent
flags

diff -r 1b5921821873 -r f083a332526e share/mk/bsd.prog.mk
--- a/share/mk/bsd.prog.mk	Fri Feb 13 05:26:10 2026 +0000
+++ b/share/mk/bsd.prog.mk	Fri Feb 13 08:08:27 2026 +0000
@@ -38,7 +38,7 @@ CLEANFILES+= a.out [Ee]rrs mklog core *.
 .if defined(MKPIE) && (${MKPIE} != "no") && !defined(NOPIE)
 CFLAGS+=	${PIE_CFLAGS}
 AFLAGS+=	${PIE_AFLAGS}
-LDFLAGS+=	${"${LDSTATIC.${.TARGET}}" == "-static" :? : ${PIE_LDFLAGS}}
+# PIE_LDFLAGS added on a per-PROG basis below depending on LDSTATIC.${PROG}
 .endif
 
 CFLAGS+=	${COPTS}
@@ -470,6 +470,7 @@ PAXCTL_FLAGS.${_P}= +a
 _DPADD.${_P}=		${DPADD}    ${DPADD.${_P}}
 _LDADD.${_P}=		${LDADD}    ${LDADD.${_P}}
 _LDFLAGS.${_P}=		${LDFLAGS}  ${LDFLAGS.${_P}}
+_LDFLAGS.${_P}+=	${"${LDSTATIC.${_P}}" == "-static" :? : ${PIE_LDFLAGS}}
 .if ${MKSANITIZER} != "yes"
 # Sanitizers don't support static build.
 _LDSTATIC.${_P}=	${LDSTATIC} ${LDSTATIC.${_P}}


Home | Main Index | Thread Index | Old Index