Skip to content

Commit fa9d93a

Browse files
committed
Revert previous. It breaks non-PIE platforms.
1 parent 0d926f4 commit fa9d93a

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

share/mk/bsd.prog.mk

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $NetBSD: bsd.prog.mk,v 1.362 2026/02/13 15:59:51 skrll Exp $
1+
# $NetBSD: bsd.prog.mk,v 1.363 2026/02/14 08:12:27 skrll Exp $
22
# @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
33

44
.ifndef HOSTPROG
@@ -38,7 +38,7 @@ CLEANFILES+= a.out [Ee]rrs mklog core *.core .gdbinit
3838
.if defined(MKPIE) && (${MKPIE} != "no") && !defined(NOPIE)
3939
CFLAGS+= ${PIE_CFLAGS}
4040
AFLAGS+= ${PIE_AFLAGS}
41-
# PIE_LDFLAGS added on a per-PROG basis below depending on LDSTATIC.${PROG}
41+
LDFLAGS+= ${"${LDSTATIC.${.TARGET}}" == "-static" :? : ${PIE_LDFLAGS}}
4242
.endif
4343

4444
CFLAGS+= ${COPTS}
@@ -470,7 +470,6 @@ PAXCTL_FLAGS.${_P}= +a
470470
_DPADD.${_P}= ${DPADD} ${DPADD.${_P}}
471471
_LDADD.${_P}= ${LDADD} ${LDADD.${_P}}
472472
_LDFLAGS.${_P}= ${LDFLAGS} ${LDFLAGS.${_P}}
473-
_LDFLAGS.${_P}+= ${"${LDSTATIC.${_P}}" == "-static" :? : ${PIE_LDFLAGS}}
474473
.if ${MKSANITIZER} != "yes"
475474
# Sanitizers don't support static build.
476475
_LDSTATIC.${_P}= ${LDSTATIC} ${LDSTATIC.${_P}}

0 commit comments

Comments
 (0)