On Wed, Jul 09, 2014 at 03:00:45PM +0000, Viktor Dukhovni wrote:

> > -   $(SHLIB_LD) -o $(LIB) $(OBJS)
> > +   $(SHLIB_LD) -o $(LIB) $(OBJS) $(SYSLIBS)
> > ...
> 
> In my test on Ralf's system the above fixes the problem.  Not
> surprising, since with versioned symbols the shared objects need
> to record the right symbol names at link time.
> 
> Shared objects generally need to record their dependencies explicitly,
> rather than attempt to inherit them from the program they are linked
> with.

The complete patch is below my signature.  I also noticed that on
Linux systems "-Wl,-rpath,..." sets the RPATH property in the ELF
object, which cannot be preempted via LD_LIBRARY_PATH.  This is
deprecated, and one is encourated to use the new RUNPATH property
instead which has lower precedence than LD_LIBRARY_PATH.  Since
Postfix uses the build-tree libraries during the build, we need
LD_LIBRARY_PATH to work.  Therefore, for Linux 3 systems (likely
more similar systems also need this) I added -Wl,--enable-new-dtags
to SHLIB_LD.

Anyone know which version of the toolchain introduces --enable-new-dtags?

-- 
        Viktor.

diff -ru postfix-2.12-20140703/makedefs postfix-2.12-20140703.new/makedefs
--- postfix-2.12-20140703/makedefs      2014-07-01 23:37:17.000000000 +0200
+++ postfix-2.12-20140703.new/makedefs  2014-07-09 17:30:55.068379514 +0200
@@ -464,7 +464,7 @@
                : ${SHLIB_SUFFIX=.so}
                : ${SHLIB_CFLAGS=-fPIC}
                : ${SHLIB_LD='gcc -shared -Wl,-soname,${LIB}'}
-               : ${SHLIB_RPATH='-Wl,-rpath,${SHLIB_DIR}'}
+               : ${SHLIB_RPATH='-Wl,--enable-new-dtags 
-Wl,-rpath,${SHLIB_DIR}'}
                : ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"}
                : ${PLUGIN_LD='gcc -shared'}
                ;;
diff -ru postfix-2.12-20140703/src/dns/Makefile.in 
postfix-2.12-20140703.new/src/dns/Makefile.in
--- postfix-2.12-20140703/src/dns/Makefile.in   2014-04-18 22:22:33.000000000 
+0200
+++ postfix-2.12-20140703.new/src/dns/Makefile.in       2014-07-09 
17:04:47.203895745 +0200
@@ -33,7 +33,7 @@
 $(LIB):        $(OBJS)
        $(AR) $(ARFL) $(LIB) $?
        $(RANLIB) $(LIB)
-       $(SHLIB_LD) -o $(LIB) $(OBJS)
+       $(SHLIB_LD) -o $(LIB) $(OBJS) $(SYSLIBS)
 
 $(LIB_DIR)/$(LIB): $(LIB)
        cp $(LIB) $(LIB_DIR)
diff -ru postfix-2.12-20140703/src/global/Makefile.in 
postfix-2.12-20140703.new/src/global/Makefile.in
--- postfix-2.12-20140703/src/global/Makefile.in        2014-06-22 
03:03:52.000000000 +0200
+++ postfix-2.12-20140703.new/src/global/Makefile.in    2014-07-09 
17:04:54.496028425 +0200
@@ -138,7 +138,7 @@
 $(LIB):        $(OBJS)
        $(AR) $(ARFL) $(LIB) $?
        $(RANLIB) $(LIB)
-       $(SHLIB_LD) -o $(LIB) $(OBJS)
+       $(SHLIB_LD) -o $(LIB) $(OBJS) $(SYSLIBS)
 
 $(LIB_DIR)/$(LIB): $(LIB)
        cp $(LIB) $(LIB_DIR)
diff -ru postfix-2.12-20140703/src/master/Makefile.in 
postfix-2.12-20140703.new/src/master/Makefile.in
--- postfix-2.12-20140703/src/master/Makefile.in        2014-05-24 
03:16:32.000000000 +0200
+++ postfix-2.12-20140703.new/src/master/Makefile.in    2014-07-09 
17:04:59.584121001 +0200
@@ -44,7 +44,7 @@
 $(LIB):        $(LIB_OBJ)
        $(AR) $(ARFL) $(LIB) $?
        $(RANLIB) $(LIB)
-       $(SHLIB_LD) -o $(LIB) $(LIB_OBJ)
+       $(SHLIB_LD) -o $(LIB) $(LIB_OBJ) $(SYSLIBS)
 
 $(LIB_DIR)/$(LIB): $(LIB)
        cp $(LIB) $(LIB_DIR)/$(LIB)
diff -ru postfix-2.12-20140703/src/tls/Makefile.in 
postfix-2.12-20140703.new/src/tls/Makefile.in
--- postfix-2.12-20140703/src/tls/Makefile.in   2014-04-18 16:08:22.000000000 
+0200
+++ postfix-2.12-20140703.new/src/tls/Makefile.in       2014-07-09 
17:05:11.908345231 +0200
@@ -44,7 +44,7 @@
 $(LIB):        $(OBJS)
        $(AR) $(ARFL) $(LIB) $?
        $(RANLIB) $(LIB)
-       $(SHLIB_LD) -o $(LIB) $(OBJS)
+       $(SHLIB_LD) -o $(LIB) $(OBJS) $(SYSLIBS)
 
 $(LIB_DIR)/$(LIB): $(LIB)
        cp $(LIB) $(LIB_DIR)
diff -ru postfix-2.12-20140703/src/util/Makefile.in 
postfix-2.12-20140703.new/src/util/Makefile.in
--- postfix-2.12-20140703/src/util/Makefile.in  2014-06-22 03:03:36.000000000 
+0200
+++ postfix-2.12-20140703.new/src/util/Makefile.in      2014-07-09 
17:05:20.108494423 +0200
@@ -143,7 +143,7 @@
 $(LIB):        $(OBJS)
        $(AR) $(ARFL) $(LIB) $?
        $(RANLIB) $(LIB)
-       $(SHLIB_LD) -o $(LIB) $(OBJS)
+       $(SHLIB_LD) -o $(LIB) $(OBJS) $(SYSLIBS)
 
 $(LIB_DIR)/$(LIB): $(LIB)
        cp $(LIB) $(LIB_DIR)

Reply via email to