Loading ...
Sorry, an error occurred while loading the content.

301015Proposed patch: (underlinking? ld.gold)

Expand Messages
  • Viktor Dukhovni
    Jul 14, 2014
    • 0 Attachment
      On Mon, Jul 14, 2014 at 07:16:30PM +0000, Eray Aslan wrote:

      > $ ./bin/postconf mail_version
      > ./bin/postconf: error while loading shared libraries:
      > libpostfix-global.so: cannot open shared object file: No such file or
      > directory

      This is expected. You need to run:

      LD_LIBRARY_PATH=$(pwd)/lib ./bin/postconf -d mail_version

      > [ would have been nice to run commands in the build tree ]
      >
      > $ LD_LIBRARY_PATH="./lib"./bin/postconf mail_version
      > mail_version = 2.12-20140713

      Which you figured out.

      > with gold:
      >
      > same make statements as above resulting in a successful build again but:
      >
      > $ LD_LIBRARY_PATH="./lib" ./bin/postconf mail_version
      > ./bin/postconf: symbol lookup error: ./lib/libpostfix-util.so: undefined
      > symbol: pcre_malloc

      Right, you're building with dynamicmaps=no, but SHLIB_SYSLIBS
      variable was not set quite right, see patch below. I also took
      the liberty of adding the RPATH to the shared library and plugin
      build command-lines.

      diff --git a/makedefs b/makedefs
      index 7f83b32..4828d06 100644
      --- a/makedefs
      +++ b/makedefs
      @@ -990,7 +990,7 @@ esac

      case "$shared" in
      yes) SHLIB_SYSLIBS=`${AWK} '
      - BEGIN { wc = split("'"$SYSLIBS"'", words)
      + BEGIN { wc = split("'"$SYSLIBS $AUXLIBS"'", words)
      for (n = 1; n <= wc; n++)
      if (words[n] !~ /\.a$/)
      printf(" %s", words[n])
      diff --git a/src/dns/Makefile.in b/src/dns/Makefile.in
      index b06966c..1f67499 100644
      --- a/src/dns/Makefile.in
      +++ b/src/dns/Makefile.in
      @@ -33,7 +33,7 @@ root_tests:
      $(LIB): $(OBJS)
      $(AR) $(ARFL) $(LIB) $?
      $(RANLIB) $(LIB)
      - $(SHLIB_LD) -o $(LIB) $(OBJS) $(SHLIB_SYSLIBS)
      + $(SHLIB_LD) $(SHLIB_RPATH) -o $(LIB) $(OBJS) $(SHLIB_SYSLIBS)

      $(LIB_DIR)/$(LIB): $(LIB)
      cp $(LIB) $(LIB_DIR)
      diff --git a/src/global/Makefile.in b/src/global/Makefile.in
      index 2498f4f..14f35c8 100644
      --- a/src/global/Makefile.in
      +++ b/src/global/Makefile.in
      @@ -138,7 +138,7 @@ test: $(TESTPROG)
      $(LIB): $(OBJS)
      $(AR) $(ARFL) $(LIB) $?
      $(RANLIB) $(LIB)
      - $(SHLIB_LD) -o $(LIB) $(OBJS) $(SHLIB_SYSLIBS)
      + $(SHLIB_LD) $(SHLIB_RPATH) -o $(LIB) $(OBJS) $(SHLIB_SYSLIBS)

      $(LIB_DIR)/$(LIB): $(LIB)
      cp $(LIB) $(LIB_DIR)
      @@ -147,27 +147,29 @@ $(LIB_DIR)/$(LIB): $(LIB)
      plugin_map_so_make: $(PLUGIN_MAP_SO)

      $(LIB_PREFIX)ldap$(LIB_SUFFIX): dict_ldap.o
      - $(PLUGIN_LD) -o $@ dict_ldap.o $(AUXLIBS_LDAP)
      + $(PLUGIN_LD) $(SHLIB_RPATH) -o $@ dict_ldap.o $(AUXLIBS_LDAP)

      $(LIB_PREFIX)mysql$(LIB_SUFFIX): dict_mysql.o
      - $(PLUGIN_LD) -o $@ dict_mysql.o $(AUXLIBS_MYSQL)
      + $(PLUGIN_LD) $(SHLIB_RPATH) -o $@ dict_mysql.o $(AUXLIBS_MYSQL)

      $(LIB_PREFIX)pgsql$(LIB_SUFFIX): dict_pgsql.o
      - $(PLUGIN_LD) -o $@ dict_pgsql.o $(AUXLIBS_PGSQL)
      + $(PLUGIN_LD) $(SHLIB_RPATH) -o $@ dict_pgsql.o $(AUXLIBS_PGSQL)

      $(LIB_PREFIX)sqlite$(LIB_SUFFIX): dict_sqlite.o
      - $(PLUGIN_LD) -o $@ dict_sqlite.o $(AUXLIBS_SQLITE)
      + $(PLUGIN_LD) $(SHLIB_RPATH) -o $@ dict_sqlite.o $(AUXLIBS_SQLITE)

      $(LIB_PREFIX)cdb$(LIB_SUFFIX): mkmap_cdb.o $(LIB_DIR)/dict_cdb.o
      - $(PLUGIN_LD) -o $@ mkmap_cdb.o $(LIB_DIR)/dict_cdb.o $(AUXLIBS_CDB)
      + $(PLUGIN_LD) $(SHLIB_RPATH) -o $@ mkmap_cdb.o \
      + $(LIB_DIR)/dict_cdb.o $(AUXLIBS_CDB)

      $(LIB_PREFIX)lmdb$(LIB_SUFFIX): mkmap_lmdb.o $(LIB_DIR)/dict_lmdb.o \
      $(LIB_DIR)/slmdb.o
      - $(PLUGIN_LD) -o $@ mkmap_lmdb.o $(LIB_DIR)/dict_lmdb.o \
      + $(PLUGIN_LD) $(SHLIB_RPATH) -o $@ mkmap_lmdb.o $(LIB_DIR)/dict_lmdb.o \
      $(LIB_DIR)/slmdb.o $(AUXLIBS_LMDB)

      $(LIB_PREFIX)sdbm$(LIB_SUFFIX): mkmap_sdbm.o $(LIB_DIR)/dict_sdbm.o
      - $(PLUGIN_LD) -o $@ mkmap_sdbm.o $(LIB_DIR)/dict_sdbm.o $(AUXLIBS_SDBM)
      + $(PLUGIN_LD) $(SHLIB_RPATH) -o $@ mkmap_sdbm.o \
      + $(LIB_DIR)/dict_sdbm.o $(AUXLIBS_SDBM)

      update: $(LIB_DIR)/$(LIB) $(HDRS) $(PLUGIN_MAP_SO_UPDATE)
      -for i in $(HDRS); \
      diff --git a/src/master/Makefile.in b/src/master/Makefile.in
      index 5d3bacc..4c6b607 100644
      --- a/src/master/Makefile.in
      +++ b/src/master/Makefile.in
      @@ -44,7 +44,7 @@ root_tests:
      $(LIB): $(LIB_OBJ)
      $(AR) $(ARFL) $(LIB) $?
      $(RANLIB) $(LIB)
      - $(SHLIB_LD) -o $(LIB) $(LIB_OBJ) $(SHLIB_SYSLIBS)
      + $(SHLIB_LD) $(SHLIB_RPATH) -o $(LIB) $(LIB_OBJ) $(SHLIB_SYSLIBS)

      $(LIB_DIR)/$(LIB): $(LIB)
      cp $(LIB) $(LIB_DIR)/$(LIB)
      diff --git a/src/tls/Makefile.in b/src/tls/Makefile.in
      index 814ba38..896df5e 100644
      --- a/src/tls/Makefile.in
      +++ b/src/tls/Makefile.in
      @@ -44,7 +44,7 @@ root_tests:
      $(LIB): $(OBJS)
      $(AR) $(ARFL) $(LIB) $?
      $(RANLIB) $(LIB)
      - $(SHLIB_LD) -o $(LIB) $(OBJS) $(SHLIB_SYSLIBS)
      + $(SHLIB_LD) $(SHLIB_RPATH) -o $(LIB) $(OBJS) $(SHLIB_SYSLIBS)

      $(LIB_DIR)/$(LIB): $(LIB)
      cp $(LIB) $(LIB_DIR)
      diff --git a/src/util/Makefile.in b/src/util/Makefile.in
      index 5a03a52..29ce751 100644
      --- a/src/util/Makefile.in
      +++ b/src/util/Makefile.in
      @@ -143,7 +143,7 @@ test: $(TESTPROG)
      $(LIB): $(OBJS)
      $(AR) $(ARFL) $(LIB) $?
      $(RANLIB) $(LIB)
      - $(SHLIB_LD) -o $(LIB) $(OBJS) $(SHLIB_SYSLIBS)
      + $(SHLIB_LD) $(SHLIB_RPATH) -o $(LIB) $(OBJS) $(SHLIB_SYSLIBS)

      $(LIB_DIR)/$(LIB): $(LIB)
      cp $(LIB) $(LIB_DIR)
      @@ -152,7 +152,7 @@ $(LIB_DIR)/$(LIB): $(LIB)
      plugin_map_so_make: $(PLUGIN_MAP_SO)

      $(LIB_PREFIX)pcre$(LIB_SUFFIX): dict_pcre.o
      - $(PLUGIN_LD) -o $@ dict_pcre.o $(AUXLIBS_PCRE)
      + $(PLUGIN_LD) $(SHLIB_RPATH) -o $@ dict_pcre.o $(AUXLIBS_PCRE)

      update: $(LIB_DIR)/$(LIB) $(HDRS) $(PLUGIN_MAP_SO_UPDATE) \
      $(PLUGIN_MAP_OBJ_UPDATE)

      --
      Viktor.
    • Show all 13 messages in this topic