From cb0e38446b26c5bb3ee8b10360669165287c6faa Mon Sep 17 00:00:00 2001 From: agc Date: Wed, 4 Sep 2002 14:47:32 +0000 Subject: Apply patches from Lubomir Sedlacik in PR 18115 to generalise the linker flags used to export symbols by setting them on a per-OS basis. > many packages force -Wl,-export-dynamic which is not portable outside GNU ld > and cause problems e.g. on Solaris. some of these packages use if > conditionals either only for NetBSD or except SunOS, but the state is not > coherent and it may complicate later when support for new OS is added to > pkgsrc (e.g. ongoing work on HP-UX support). > > jlam proposed the following framework in discussion on tech-pkg: > > http://mail-index.netbsd.org/tech-pkg/2002/06/21/0009.html > > now, ${EXPORT_SYMBOLS_LDFLAGS} is used instead of directly defining > -Wl,-export-dynamic which is set in appropriate defs.*.mk to reasonable > values. packages should be converted to this framework by: > > 1) replacing LDFLAGS+= -Wl,-export-dynamic and LIBS+= -export-dynamic with: > > LDFLAGS+= ${EXPORT_SYMBOLS_LDFLAGS} > > 2) for use in patchfiles, add this variable to MAKE_ENV if needed: > > MAKE_ENV+= EXPORT_SYMBOLS_LDFLAGS=${EXPORT_SYMBOLS_LDFLAGS} > > 3) replace occurances of -Wl,-export-dynamic and -export-dynamic in patch > files with: > > $(EXPORT_SYMBOLS_LDFLAGS) --- mk/defs.NetBSD.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'mk/defs.NetBSD.mk') diff --git a/mk/defs.NetBSD.mk b/mk/defs.NetBSD.mk index eb8ff210eb5..e89fbe45b68 100644 --- a/mk/defs.NetBSD.mk +++ b/mk/defs.NetBSD.mk @@ -1,4 +1,4 @@ -# $NetBSD: defs.NetBSD.mk,v 1.27 2002/08/28 11:06:19 seb Exp $ +# $NetBSD: defs.NetBSD.mk,v 1.28 2002/09/04 14:47:33 agc Exp $ # # Variable definitions for the NetBSD operating system. @@ -68,6 +68,11 @@ DEPENDS+= user>=20000313:../../sysutils/user CPP_PRECOMP_FLAGS?= # unset DEF_UMASK?= 0022 +.if ${OBJECT_FMT} == "ELF" +EXPORT_SYMBOLS_LDFLAGS?=-Wl,-E # add symbols to the dynamic symbol table +.else +EXPORT_SYMBOLS_LDFLAGS?=-Wl,--export-dynamic +.endif MOTIF_TYPE_DEFAULT?= openmotif # default 2.0 compatible libs type MOTIF12_TYPE_DEFAULT?= lesstif12 # default 1.2 compatible libs type NOLOGIN?= /sbin/nologin -- cgit v1.2.3