From aef096c6896ed50e4df03361c3b049df91b3f6f0 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Wed, 28 Jun 2006 05:18:38 +0000 Subject: [PATCH] implement symbol export restrictions for Solaris * lib.in (solaris.versions): New target. Currently no version id, just a symbol list. * libnover.in (solaris.versions): New target. (clean-libs): Delete it. * shlib.conf (*-*-solaris*): Use solaris.versions as map file. (clean-libs): Delete it. ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18245 dc483132-0cff-0310-8789-dd5450dbe970 --- src/config/lib.in | 7 ++++++- src/config/libnover.in | 7 ++++++- src/config/shlib.conf | 4 +++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/config/lib.in b/src/config/lib.in index 5d362743d..b3e612810 100644 --- a/src/config/lib.in +++ b/src/config/lib.in @@ -59,6 +59,11 @@ binutils.versions: $(SHLIB_EXPORT_FILE) Makefile echo >> binutils.versions "};" echo >> binutils.versions "HIDDEN { local: __*; _rest*; _save*; *; };" +solaris.versions: $(SHLIB_EXPORT_FILE) Makefile + echo > solaris.versions "{ global:" + sed >> solaris.versions < $(SHLIB_EXPORT_FILE) "s/$$/;/" + echo >> solaris.versions " local: *; };" + darwin.exports: $(SHLIB_EXPORT_FILE) Makefile sed > darwin-exports.tmp < $(SHLIB_EXPORT_FILE) "s/^/_/" $(MV) darwin-exports.tmp darwin.exports @@ -124,7 +129,7 @@ clean-libs: $(RM) lib$(LIBBASE)$(SHLIBSEXT) $(RM) lib$(LIBBASE)$(SHLIBEXT) $(RM) lib$(LIBBASE)$(PFLIBEXT) - $(RM) binutils.versions osf1.exports + $(RM) binutils.versions osf1.exports solaris.versions clean-liblinks: $(RM) $(TOPLIBD)/lib$(LIBBASE)$(STLIBEXT) diff --git a/src/config/libnover.in b/src/config/libnover.in index 09c42dcc8..a9685136a 100644 --- a/src/config/libnover.in +++ b/src/config/libnover.in @@ -48,6 +48,11 @@ binutils.versions: $(SHLIB_EXPORT_FILE) Makefile sed >> binutils.versions < $(SHLIB_EXPORT_FILE) "s/$$/;/" echo >> binutils.versions "};" +solaris.versions: $(SHLIB_EXPORT_FILE) Makefile + echo > solaris.versions "{ global:" + sed >> solaris.versions < $(SHLIB_EXPORT_FILE) "s/$$/;/" + echo >> solaris.versions " local: *; };" + osf1.exports: $(SHLIB_EXPORT_FILE) Makefile $(RM) osf1.tmp osf1.exports sed "s/^/-exported_symbol /" < $(SHLIB_EXPORT_FILE) > osf1.tmp @@ -88,7 +93,7 @@ all-libs: $(LIBBASE)$(DYNOBJEXT) # $(LIBLIST) clean-libs: $(RM) $(LIBBASE)$(SHLIBEXT) - $(RM) binutils.versions osf1.exports + $(RM) binutils.versions osf1.exports solaris.versions install-libs: $(LIBINSTLIST) install-shared: diff --git a/src/config/shlib.conf b/src/config/shlib.conf index fbd93393a..8c3391636 100644 --- a/src/config/shlib.conf +++ b/src/config/shlib.conf @@ -297,10 +297,12 @@ mips-*-netbsd*) if test "$krb5_cv_prog_gcc" = yes; then PICFLAGS=-fPIC LDCOMBINE='$(CC) $(CFLAGS) -shared -h $(LIBPREFIX)$(LIBBASE)$(SHLIBSEXT)' + LDCOMBINE_TAIL='$(LDFLAGS) -Wl,-M,solaris.versions' else PICFLAGS=-KPIC # Solaris cc doesn't default to stuffing the SONAME field... LDCOMBINE='$(CC) $(CFLAGS) -dy -G -z text -h $(LIBPREFIX)$(LIBBASE)$(SHLIBSEXT) $$initfini' + LDCOMBINE_TAIL='$(LDFLAGS) -M solaris.versions' # case $krb5_cv_host in *-*-solaris2.[1-7] | *-*-solaris2.[1-7].*) @@ -313,7 +315,7 @@ mips-*-netbsd*) ;; esac fi - LDCOMBINE_TAIL='$(LDFLAGS)' + SHLIB_EXPORT_FILE_DEP=solaris.versions SHLIBVEXT='.so.$(LIBMAJOR).$(LIBMINOR)' SHLIBSEXT='.so.$(LIBMAJOR)' SHLIBEXT=.so -- 2.26.2