summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobert <robert@openbsd.org>2017-04-27 17:41:47 +0000
committerrobert <robert@openbsd.org>2017-04-27 17:41:47 +0000
commit7497ffa48723a49e7706aa2b608173d84357957a (patch)
tree4f6c46ccabbec3be84f7c22dc411db21cef2f3da
parenttrack size of pss allocation, so that length can be passed to free(9) (diff)
downloadwireguard-openbsd-7497ffa48723a49e7706aa2b608173d84357957a.tar.xz
wireguard-openbsd-7497ffa48723a49e7706aa2b608173d84357957a.zip
syspatch needs to create shared libs with the same object sequence instead
of randomizing the order so let's read the libs on the system and link the same way in case a syspatch is being built
-rw-r--r--share/mk/bsd.lib.mk8
1 files changed, 7 insertions, 1 deletions
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index aced31fcfb0..78077c72e43 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -1,4 +1,4 @@
-# $OpenBSD: bsd.lib.mk,v 1.80 2017/03/26 18:50:37 guenther Exp $
+# $OpenBSD: bsd.lib.mk,v 1.81 2017/04/27 17:41:47 robert Exp $
# $NetBSD: bsd.lib.mk,v 1.67 1996/01/17 20:39:26 mycroft Exp $
# @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91
@@ -183,8 +183,14 @@ SOBJS+= ${OBJS:.o=.so}
${FULLSHLIBNAME}: ${SOBJS} ${DPADD}
@echo building shared ${LIB} library \(version ${SHLIB_MAJOR}.${SHLIB_MINOR}\)
@rm -f ${.TARGET}
+.if defined(SYSPATCH)
+ ${CC} -shared ${PICFLAG} -o ${.TARGET} \
+ `readelf -Ws ${LIBDIR}/${.TARGET} | awk '/ FILE/{gsub(/\..*/, ".so", $$NF); sub(".*/", "", $$NF); print $$NF}' | \
+ grep -v unwind-dw2` ${LDADD}
+.else
${CC} -shared ${PICFLAG} -o ${.TARGET} \
`echo ${SOBJS} | tr ' ' '\n' | sort -R` ${LDADD}
+.endif
${FULLSHLIBNAME}.a: ${SOBJS}
@echo building shared ${LIB} library \(version ${SHLIB_MAJOR}.${SHLIB_MINOR}\) ar