From: Benjamin Kaduk Date: Fri, 19 Sep 2014 01:35:30 +0000 (-0400) Subject: Fix LT_LDLIB_shlib_missing X-Git-Tag: upstream/1.8.0_pre1^2~550 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=efe449adbb8994e6333bfb018be225b46d9f4ba6;p=packages%2Fo%2Fopenafs.git Fix LT_LDLIB_shlib_missing Libtool's -symbols-file argument is taken as an exact match of symbols that this library claims to export. It does not filter based on what symbols are actually present in the objects comprising the library. Instead, if there are symbols in the file which are not implemented by the library, there is an implicit assumption that some other library will provide those symbols, which must be linked into a consumer of this library alongside this library. These are not the semantics we want (at present, only for roken), wherein a library will implement some (but probably not all) of a given list of symbols, and we want the export list to reflect only those symbols which are implemented. Instead, use the symbols file to build a regex that will only match symbols listed in the file (and no other symbols), and only export the subset which is present. Change-Id: Id81f7a35089ae7f760fe643680f9bfb9c81521aa Reviewed-on: http://gerrit.openafs.org/11475 Reviewed-by: Benjamin Kaduk Reviewed-by: D Brashear Tested-by: D Brashear --- diff --git a/src/config/Makefile.config.in b/src/config/Makefile.config.in index b9ca6f13d..4da95599c 100644 --- a/src/config/Makefile.config.in +++ b/src/config/Makefile.config.in @@ -247,14 +247,17 @@ LT_revision=0 LT_age=0 # Basic rule to link a shared library. -LT_LDLIB_shlib_missing=$(LIBTOOL) --quiet --mode=link --tag=CC \ - $(MT_CC) -rpath $(libdir) \ - $(PTH_LDFLAGS) $(PTH_CFLAGS) $(LDFLAGS_$(@)) \ - -o $@ \ - -export-symbols ${srcdir}/$@.sym \ - -version-info $(LT_current):$(LT_revision):$(LT_age) - -LT_LDLIB_shlib=$(LT_LDLIB_shlib_missing) -no-undefined +LT_LDLIB_shlib_common=$(LIBTOOL) --quiet --mode=link --tag=CC \ + $(MT_CC) -rpath $(libdir) \ + $(PTH_LDFLAGS) $(PTH_CFLAGS) $(LDFLAGS_$(@)) \ + -o $@ \ + -version-info $(LT_current):$(LT_revision):$(LT_age) + +LT_LDLIB_shlib=$(LT_LDLIB_shlib_common) -export-symbols $(srcdir)/$@.sym + +LT_LDLIB_shlib_missing=$(LT_LDLIB_shlib_common) -export-symbols-regex \ + "($$(sed -e 's/^/^/' -e 's/$$/$$/' $(srcdir)/$@.sym | tr '\n' '|' | \ + sed -e 's/|$$//'))" # Link a static convenience library (contains no PIC code) LT_LDLIB_static=$(LIBTOOL) --quiet --mode=link --tag=CC \