* lib.in (binutils.versions, osf1.exports): New file targets.
authorKen Raeburn <raeburn@mit.edu>
Thu, 23 Sep 2004 00:25:30 +0000 (00:25 +0000)
committerKen Raeburn <raeburn@mit.edu>
Thu, 23 Sep 2004 00:25:30 +0000 (00:25 +0000)
(clean-libs): Delete them.
* pre.in (SHLIB_EXPORT_FILE_DEP): Use @SHLIB_EXPORT_FILE_DEP@.
* shlib.conf: Set it to $(SHLIB_EXPORT_FILE) by default.
(alpha*-dec-osf*): Use osf1.exports instead of adding commands to generate a
temporary file.
(*-*-linux*, *-*-gnu*, *-*-k*bsd*-gnu): Use binutils.versions.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16779 dc483132-0cff-0310-8789-dd5450dbe970

src/config/ChangeLog
src/config/lib.in
src/config/pre.in
src/config/shlib.conf

index af06a5f828c7bf49a19543a69333c173a67a0856..0f4d6199376debe3d1a96bc699e09cb1620d1c14 100644 (file)
@@ -1,3 +1,13 @@
+2004-09-22  Ken Raeburn  <raeburn@mit.edu>
+
+       * lib.in (binutils.versions, osf1.exports): New file targets.
+       (clean-libs): Delete them.
+       * pre.in (SHLIB_EXPORT_FILE_DEP): Use @SHLIB_EXPORT_FILE_DEP@.
+       * shlib.conf: Set it to $(SHLIB_EXPORT_FILE) by default.
+       (alpha*-dec-osf*): Use osf1.exports instead of adding commands to
+       generate a temporary file.
+       (*-*-linux*, *-*-gnu*, *-*-k*bsd*-gnu): Use binutils.versions.
+
 2004-09-22  Tom Yu  <tlyu@mit.edu>
 
        * pre.in (UTIL_LIB): Set if we need libutil.
index 6818d4a328a53040285322ac53d25b64fdd58e97..7ebdb3ff325864cad7c29e4170aeae5ff7500ad6 100644 (file)
@@ -50,6 +50,15 @@ lib$(LIBBASE)$(SHLIBEXT): lib$(LIBBASE)$(SHLIBVEXT)
        $(RM) $@
        $(LN_S) lib$(LIBBASE)$(SHLIBVEXT) $@
 
+binutils.versions: $(SHLIB_EXPORT_FILE) Makefile
+       echo >  binutils.versions "HIDDEN { local: __*; _rest*; _save*; *; };"
+       echo >> binutils.versions "$(LIBBASE)_$(LIBMAJOR)_MIT {"
+       sed  >> binutils.versions < $(SHLIB_EXPORT_FILE) "s/$$/;/"
+       echo >> binutils.versions "};"
+
+osf1.exports: $(SHLIB_EXPORT_FILE) Makefile
+       sed "s/^/-exported_symbol /" < $(SHLIB_EXPORT_FILE) > osf1.exports
+
 lib$(LIBBASE)$(PFLIBEXT): $(PFOBJLISTS)
        $(RM) $@
        @echo "building profiled $(LIBBASE) library"
@@ -81,6 +90,7 @@ clean-libs:
        $(RM) lib$(LIBBASE)$(SHLIBSEXT)
        $(RM) lib$(LIBBASE)$(SHLIBEXT)
        $(RM) lib$(LIBBASE)$(PFLIBEXT)
+       $(RM) binutils.versions osf1.exports
 
 clean-liblinks:
        $(RM) $(TOPLIBD)/lib$(LIBBASE)$(STLIBEXT)
index 93a1520aee2c071a4c414b105336e0059027f4f7..db4e0582ff19e7326a31508230f87dc4ca2e4348 100644 (file)
@@ -497,7 +497,7 @@ SHLIB_EXPORT_FILE=$(srcdir)/lib$(LIBBASE).exports
 # File that needs to be current for building the shared library,
 # usually SHLIB_EXPORT_FILE, but not always, if we have to convert
 # it to another, intermediate form for the linker.
-SHLIB_EXPORT_FILE_DEP=$(SHLIB_EXPORT_FILE)
+SHLIB_EXPORT_FILE_DEP=@SHLIB_EXPORT_FILE_DEP@
 
 # Command to run to build a shared library.
 # In systems that require multiple commands, like AIX, it may need
index ccff18731487f0d835bc640b3bc25e46b3a126c1..3205bb34857899f5d2b11bca552d5e5b7342860a 100644 (file)
@@ -19,6 +19,8 @@ SHOBJEXT=.so
 PFOBJEXT=.po
 # Default for systems w/o shared libraries
 CC_LINK_STATIC='$(CC) $(PROG_LIBPATH) $(CFLAGS) $(LDFLAGS)'
+#
+SHLIB_EXPORT_FILE_DEP='$(SHLIB_EXPORT_FILE)'
 # This will do for most platforms, and we'll substitute for
 # LDCOMBINE, SHLIB_EXPFLAGS, and LDCOMBINE_TAIL below.
 MAKE_SHLIB_COMMAND=x
@@ -37,7 +39,8 @@ alpha*-dec-osf*)
        # Alpha OSF/1 doesn't need separate PIC objects
        SHOBJEXT=.o
        INIT_FINI_PREP='if test -z "$(LIBINITFUNC)"; then initfini=""; else initfini="-Wl,-init,$(LIBINITFUNC)__auxinit"; fi; if test -z "$(LIBFINIFUNC)";then :;else initfini="$$initfini -Wl,-fini,$(LIBFINIFUNC)"; fi'
-       LDCOMBINE='sed "s/^/-exported_symbol /" < $(SHLIB_EXPORT_FILE) > export && $(CC) $(PTHREAD_CFLAGS) -shared -Wl,-expect_unresolved -Wl,\* -Wl,-update_registry -Wl,$(BUILDTOP)/so_locations -Wl,-soname -Wl,lib$(LIBBASE)$(SHLIBSEXT) -Wl,-hidden -Wl,-input,export $$initfini'
+       LDCOMBINE='$(CC) $(PTHREAD_CFLAGS) -shared -Wl,-expect_unresolved -Wl,\* -Wl,-update_registry -Wl,$(BUILDTOP)/so_locations -Wl,-soname -Wl,lib$(LIBBASE)$(SHLIBSEXT) -Wl,-hidden -Wl,-input,osf1.exports $$initfini'
+       SHLIB_EXPORT_FILE_DEP=osf1.exports
        use_linker_init_option=yes
        use_linker_fini_option=yes
        EXTRA_FILES="$EXTRA_FILES export"
@@ -317,7 +320,8 @@ mips-*-netbsd*)
        # Use objdump -x to examine the fields of the library
        LDCOMBINE='$(CC) -shared -fPIC -Wl,-h,lib$(LIBBASE)$(SHLIBSEXT)'
        # 
-       LDCOMBINE_TAIL=''
+       LDCOMBINE_TAIL='-Wl,--version-script binutils.versions'
+       SHLIB_EXPORT_FILE_DEP=binutils.versions
        # For cases where we do have dependencies on other libraries
        # built in this tree...
        SHLIB_EXPFLAGS='-Wl,-R$(SHLIB_RDIRS) $(SHLIB_DIRS) $(SHLIB_EXPLIBS)'