View Issue Details

IDProjectCategoryView StatusLast Update
0006419GNUnetbuild processpublic2020-07-09 09:17
Reporterbeberking Assigned ToChristian Grothoff  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version0.12.2 
Fixed in Version0.13.0 
Summary0006419: Fail to relink libgnunet_plugin_block_test.la with $DESTDIR
DescriptionSince --unresolved-symbols=report-all was introduced in 45deaaedad922fe114df9f5bb0e23fbec7c64f02, gnunet FTBFS when built with a $DESTDIR installation path prepended to the $PREFIX. It fails when installing and relinking libgnunet_plugin_block_test.la. Please find below the relevant log.

The issue is that $DESTDIR is not the final installation path, so libgnunetblock*.so are not yet where they are going to be installed, and cannot be found by the linker there. Libtool finds the first dependency (libgnunetblockgroup.so), but then cannot find the indirect dependency of libgnunetblockgroup.so against libgnunetblock.so.

I tried to add something around $(GN_LIBINTL) and -Wl,-rpath-link -Wl,${DESTDIR}$(libdir) in src/block/Makefile.am, without success.

Making install in block
make[4] : on entre dans le répertoire « /home/bbk/linux/gnunet/src/block »
make[5] : on entre dans le répertoire « /home/bbk/linux/gnunet/src/block »
 /usr/bin/mkdir -p '/home/bbk/linux/gnunet/debian/tmp/usr/lib/x86_64-linux-gnu'
 /bin/bash ../../libtool --mode=install /usr/bin/install -c libgnunetblock.la libgnunetblockgroup.la '/home/bbk/linux/gnunet/debian/tmp/usr/lib/x86_64-linux-gnu'
libtool: warning: relinking 'libgnunetblock.la'
libtool: install: (cd /home/bbk/linux/gnunet/src/block; /bin/bash "/home/bbk/linux/gnunet/libtool" --tag CC --mode=relink gcc -fno-strict-aliasing -Wall -g -O2 -fdebug-prefix-map=/home/bbk/linux/gnunet=. -fstack-protector-strong -Wformat -Werror=format-security -Wno-address-of-packed-member -export-dynamic -no-undefined -version-info 0:0:0 -Wl,-z,relro -Wl,--unresolved-symbols=report-all -o libgnunetblock.la -rpath /usr/lib/x86_64-linux-gnu block.lo ../../src/util/libgnunetutil.la -lm -inst-prefix-dir /home/bbk/linux/gnunet/debian/tmp)
libtool: relink: gcc -shared -fPIC -DPIC .libs/block.o -L/home/bbk/linux/gnunet/debian/tmp/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -lgnunetutil -lm -g -O2 -fstack-protector-strong -Wl,-z -Wl,relro -Wl,--unresolved-symbols=report-all -Wl,-soname -Wl,libgnunetblock.so.0 -o .libs/libgnunetblock.so.0.0.0
libtool: install: /usr/bin/install -c .libs/libgnunetblock.so.0.0.0T /home/bbk/linux/gnunet/debian/tmp/usr/lib/x86_64-linux-gnu/libgnunetblock.so.0.0.0
libtool: install: (cd /home/bbk/linux/gnunet/debian/tmp/usr/lib/x86_64-linux-gnu && { ln -s -f libgnunetblock.so.0.0.0 libgnunetblock.so.0 || { rm -f libgnunetblock.so.0 && ln -s libgnunetblock.so.0.0.0 libgnunetblock.so.0; }; })
libtool: install: (cd /home/bbk/linux/gnunet/debian/tmp/usr/lib/x86_64-linux-gnu && { ln -s -f libgnunetblock.so.0.0.0 libgnunetblock.so || { rm -f libgnunetblock.so && ln -s libgnunetblock.so.0.0.0 libgnunetblock.so; }; })
libtool: install: /usr/bin/install -c .libs/libgnunetblock.lai /home/bbk/linux/gnunet/debian/tmp/usr/lib/x86_64-linux-gnu/libgnunetblock.la
libtool: warning: relinking 'libgnunetblockgroup.la'
libtool: install: (cd /home/bbk/linux/gnunet/src/block; /bin/bash "/home/bbk/linux/gnunet/libtool" --tag CC --mode=relink gcc -fno-strict-aliasing -Wall -g -O2 -fdebug-prefix-map=/home/bbk/linux/gnunet=. -fstack-protector-strong -Wformat -Werror=format-security -Wno-address-of-packed-member -export-dynamic -no-undefined -version-info 0:0:0 -Wl,-z,relro -Wl,--unresolved-symbols=report-all -o libgnunetblockgroup.la -rpath /usr/lib/x86_64-linux-gnu bg_bf.lo libgnunetblock.la ../../src/util/libgnunetutil.la -lm -inst-prefix-dir /home/bbk/linux/gnunet/debian/tmp)
libtool: relink: gcc -shared -fPIC -DPIC .libs/bg_bf.o -L/home/bbk/linux/gnunet/debian/tmp/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -lgnunetblock -lgnunetutil -lm -g -O2 -fstack-protector-strong -Wl,-z -Wl,relro -Wl,--unresolved-symbols=report-all -Wl,-soname -Wl,libgnunetblockgroup.so.0 -o .libs/libgnunetblockgroup.so.0.0.0
libtool: install: /usr/bin/install -c .libs/libgnunetblockgroup.so.0.0.0T /home/bbk/linux/gnunet/debian/tmp/usr/lib/x86_64-linux-gnu/libgnunetblockgroup.so.0.0.0
libtool: install: (cd /home/bbk/linux/gnunet/debian/tmp/usr/lib/x86_64-linux-gnu && { ln -s -f libgnunetblockgroup.so.0.0.0 libgnunetblockgroup.so.0 || { rm -f libgnunetblockgroup.so.0 && ln -s libgnunetblockgroup.so.0.0.0 libgnunetblockgroup.so.0; }; })
libtool: install: (cd /home/bbk/linux/gnunet/debian/tmp/usr/lib/x86_64-linux-gnu && { ln -s -f libgnunetblockgroup.so.0.0.0 libgnunetblockgroup.so || { rm -f libgnunetblockgroup.so && ln -s libgnunetblockgroup.so.0.0.0 libgnunetblockgroup.so; }; })
libtool: install: /usr/bin/install -c .libs/libgnunetblockgroup.lai /home/bbk/linux/gnunet/debian/tmp/usr/lib/x86_64-linux-gnu/libgnunetblockgroup.la
libtool: warning: remember to run 'libtool --finish /usr/lib/x86_64-linux-gnu'
 /usr/bin/mkdir -p '/home/bbk/linux/gnunet/debian/tmp/usr/lib/x86_64-linux-gnu/gnunet'
 /bin/bash ../../libtool --mode=install /usr/bin/install -c libgnunet_plugin_block_test.la '/home/bbk/linux/gnunet/debian/tmp/usr/lib/x86_64-linux-gnu/gnunet'
libtool: warning: relinking 'libgnunet_plugin_block_test.la'
libtool: install: (cd /home/bbk/linux/gnunet/src/block; /bin/bash "/home/bbk/linux/gnunet/libtool" --tag CC --mode=relink gcc -fno-strict-aliasing -Wall -g -O2 -fdebug-prefix-map=/home/bbk/linux/gnunet=. -fstack-protector-strong -Wformat -Werror=format-security -Wno-address-of-packed-member -export-dynamic -avoid-version -module -no-undefined -Wl,-z,relro -Wl,--unresolved-symbols=report-all -o libgnunet_plugin_block_test.la -rpath /usr/lib/x86_64-linux-gnu/gnunet plugin_block_test.lo libgnunetblockgroup.la ../../src/util/libgnunetutil.la -lm -inst-prefix-dir /home/bbk/linux/gnunet/debian/tmp)
libtool: relink: gcc -shared -fPIC -DPIC .libs/plugin_block_test.o -L/home/bbk/linux/gnunet/debian/tmp/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -lgnunetblockgroup -lgnunetutil -lm -g -O2 -fstack-protector-strong -Wl,-z -Wl,relro -Wl,--unresolved-symbols=report-all -Wl,-soname -Wl,libgnunet_plugin_block_test.so -o .libs/libgnunet_plugin_block_test.so
/usr/bin/ld: warning: libgnunetblock.so.0, needed by /home/bbk/linux/gnunet/debian/tmp/usr/lib/x86_64-linux-gnu/libgnunetblockgroup.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: /home/bbk/linux/gnunet/debian/tmp/usr/lib/x86_64-linux-gnu/libgnunetblockgroup.so: undefined reference to `GNUNET_BLOCK_mingle_hash'
collect2: error: ld returned 1 exit status
libtool: error: error: relink 'libgnunet_plugin_block_test.la' with the above command before installing it
make[5]: *** [Makefile:639: install-pluginLTLIBRARIES] Error 1
make[5] : on quitte le répertoire « /home/bbk/linux/gnunet/src/block »
make[4]: *** [Makefile:826: install-am] Error 2
make[4] : on quitte le répertoire « /home/bbk/linux/gnunet/src/block »
make[3]: *** [Makefile:573: install-recursive] Error 1
make[3] : on quitte le répertoire « /home/bbk/linux/gnunet/src »
make[2]: *** [Makefile:638: install-recursive] Error 1
make[2] : on quitte le répertoire « /home/bbk/linux/gnunet »
TagsNo tags attached.
Attached Files

Activities

Christian Grothoff

2020-07-02 20:21

manager   ~0016381

I've tried to fix this in Git 406e2ee88..789989239 by modifying the explicit dependencies in Makefile.am and also making the dependency on libgnunetblock more explicit.

However, as I didn't get a build failure before, I would appreciate your feedback as to whether this helped...

beberking

2020-07-05 16:51

developer   ~0016384

Hi Christian,

Thanks for the fix, it works well, although I find it strange to manually add indirect dependencies. Libtool should be aware of these, shouldn't it?

However, this only fixed relinking libgnunet_plugin_block_test.la but the same problem appeared in several cases, and I add to apply the attached patch to have gnunet finally build fine.

Cheers,
Bertrand
0001-Fix_build_dependencies.patch (8,803 bytes)   
From 27ea9c1da8358fd93cdf6911099ceb3e0251c37d Mon Sep 17 00:00:00 2001
From: Bertrand Marc <bmarc@debian.org>
Date: Sat, 4 Jul 2020 19:06:49 +0200
Subject: [PATCH 1/2] Fix_build_dependencies

---
 src/ats-tests/Makefile.am     |  2 ++
 src/dns/Makefile.am           |  5 +++++
 src/fs/Makefile.am            |  5 +++++
 src/json/Makefile.am          |  4 ++++
 src/peerinfo-tool/Makefile.am |  9 +++++++++
 src/reclaim/Makefile.am       | 10 ++++++++++
 src/revocation/Makefile.am    |  6 ++++++
 src/testbed/Makefile.am       |  6 ++++++
 src/testing/Makefile.am       |  3 +++
 src/transport/Makefile.am     | 12 ++++++++++++
 10 files changed, 62 insertions(+)

diff --git a/src/ats-tests/Makefile.am b/src/ats-tests/Makefile.am
index 1375d1505..cc30f660a 100644
--- a/src/ats-tests/Makefile.am
+++ b/src/ats-tests/Makefile.am
@@ -41,8 +41,10 @@ libgnunetatstesting_la_SOURCES = \
   ats-testing-experiment.c ats-testing-preferences.c
 libgnunetatstesting_la_LIBADD = \
   $(top_builddir)/src/testbed/libgnunettestbed.la \
+  $(top_builddir)/src/statistics/libgnunetstatistics.la \
   $(top_builddir)/src/core/libgnunetcore.la \
   $(top_builddir)/src/transport/libgnunettransport.la \
+  $(top_builddir)/src/hello/libgnunethello.la \
   $(top_builddir)/src/ats/libgnunetats.la \
   $(top_builddir)/src/util/libgnunetutil.la \
   $(GN_LIBINTL)
diff --git a/src/dns/Makefile.am b/src/dns/Makefile.am
index 17be841f5..45107304b 100644
--- a/src/dns/Makefile.am
+++ b/src/dns/Makefile.am
@@ -81,6 +81,11 @@ libgnunet_plugin_block_dns_la_SOURCES = \
   plugin_block_dns.c
 libgnunet_plugin_block_dns_la_LIBADD = \
   $(top_builddir)/src/block/libgnunetblockgroup.la \
+  $(top_builddir)/src/block/libgnunetblock.la \
+  $(top_builddir)/src/util/libgnunetutil.la
+libgnunet_plugin_block_dns_la_DEPENDENCIES = \
+  $(top_builddir)/src/block/libgnunetblockgroup.la \
+  $(top_builddir)/src/block/libgnunetblock.la \
   $(top_builddir)/src/util/libgnunetutil.la
 libgnunet_plugin_block_dns_la_LDFLAGS = \
   $(GN_LIBINTL) \
diff --git a/src/fs/Makefile.am b/src/fs/Makefile.am
index b1555be60..25590c6f7 100644
--- a/src/fs/Makefile.am
+++ b/src/fs/Makefile.am
@@ -46,8 +46,13 @@ libgnunetfs_la_SOURCES = \
 
 libgnunetfs_la_LIBADD = \
   $(top_builddir)/src/datastore/libgnunetdatastore.la \
+  $(top_builddir)/src/statistics/libgnunetstatistics.la \
   $(top_builddir)/src/util/libgnunetutil.la \
   $(GN_LIBINTL) $(XLIB) $(LIBGCRYPT_LIBS) -lunistring
+libgnunetfs_la_DEPENDENCIES = \
+  $(top_builddir)/src/datastore/libgnunetdatastore.la \
+  $(top_builddir)/src/statistics/libgnunetstatistics.la \
+  $(top_builddir)/src/util/libgnunetutil.la
 
 if HAVE_LIBEXTRACTOR
 libgnunetfs_la_LIBADD += \
diff --git a/src/json/Makefile.am b/src/json/Makefile.am
index 5968a3596..221ad033d 100644
--- a/src/json/Makefile.am
+++ b/src/json/Makefile.am
@@ -27,6 +27,10 @@ libgnunetjson_la_LIBADD = \
   $(MHD_LIBS) \
   $(XLIB) \
   $(Z_LIBS)
+libgnunetjson_la_DEPENDENCIES = \
+  $(top_builddir)/src/util/libgnunetutil.la \
+  $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la
+
 
 check_PROGRAMS = \
   test_json \
diff --git a/src/peerinfo-tool/Makefile.am b/src/peerinfo-tool/Makefile.am
index 05173d551..9002608a1 100644
--- a/src/peerinfo-tool/Makefile.am
+++ b/src/peerinfo-tool/Makefile.am
@@ -25,10 +25,19 @@ libgnunet_plugin_rest_peerinfo_la_LIBADD = \
   $(top_builddir)/src/hello/libgnunethello.la \
   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
   $(top_builddir)/src/transport/libgnunettransport.la \
+  $(top_builddir)/src/ats/libgnunetats.la \
   $(top_builddir)/src/rest/libgnunetrest.la \
   $(top_builddir)/src/json/libgnunetjson.la \
   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
   $(LTLIBINTL) -ljansson $(MHD_LIBS)
+libgnunet_plugin_rest_peerinfo_la_DEPENDENCIES = \
+  $(top_builddir)/src/hello/libgnunethello.la \
+  $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
+  $(top_builddir)/src/transport/libgnunettransport.la \
+  $(top_builddir)/src/ats/libgnunetats.la \
+  $(top_builddir)/src/rest/libgnunetrest.la \
+  $(top_builddir)/src/json/libgnunetjson.la \
+  $(top_builddir)/src/util/libgnunetutil.la
 libgnunet_plugin_rest_peerinfo_la_LDFLAGS = \
  $(GN_PLUGIN_LDFLAGS)
 libgnunet_plugin_rest_peerinfo_la_CFLAGS = $(MHD_CFLAGS) $(AM_CFLAGS)
diff --git a/src/reclaim/Makefile.am b/src/reclaim/Makefile.am
index 51b9b9c5b..4c5ba4137 100644
--- a/src/reclaim/Makefile.am
+++ b/src/reclaim/Makefile.am
@@ -50,11 +50,21 @@ libgnunet_plugin_rest_reclaim_la_LIBADD = \
   $(top_builddir)/src/identity/libgnunetidentity.la \
   libgnunetreclaim.la \
   $(top_builddir)/src/json/libgnunetjson.la \
+  $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
   $(top_builddir)/src/rest/libgnunetrest.la \
   $(top_builddir)/src/reclaim-attribute/libgnunetreclaimattribute.la \
   $(top_builddir)/src/namestore/libgnunetnamestore.la \
   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
   $(LTLIBINTL) -ljansson $(MHD_LIBS)
+libgnunet_plugin_rest_reclaim_la_DEPENDENCIES = \
+  $(top_builddir)/src/identity/libgnunetidentity.la \
+  libgnunetreclaim.la \
+  $(top_builddir)/src/json/libgnunetjson.la \
+  $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
+  $(top_builddir)/src/rest/libgnunetrest.la \
+  $(top_builddir)/src/reclaim-attribute/libgnunetreclaimattribute.la \
+  $(top_builddir)/src/namestore/libgnunetnamestore.la \
+  $(top_builddir)/src/util/libgnunetutil.la
 libgnunet_plugin_rest_reclaim_la_LDFLAGS = \
   $(GN_PLUGIN_LDFLAGS)
 libgnunet_plugin_rest_reclaim_la_CFLAGS = $(MHD_CFLAGS) $(AM_CFLAGS)
diff --git a/src/revocation/Makefile.am b/src/revocation/Makefile.am
index b3b2877ca..e78812002 100644
--- a/src/revocation/Makefile.am
+++ b/src/revocation/Makefile.am
@@ -27,8 +27,14 @@ libgnunet_plugin_block_revocation_la_SOURCES = \
 libgnunet_plugin_block_revocation_la_LIBADD = \
   libgnunetrevocation.la \
   $(top_builddir)/src/block/libgnunetblockgroup.la \
+  $(top_builddir)/src/block/libgnunetblock.la \
   $(top_builddir)/src/util/libgnunetutil.la  \
   $(LTLIBINTL)
+libgnunet_plugin_block_revocation_la_DEPENDENCIES = \
+  libgnunetrevocation.la \
+  $(top_builddir)/src/block/libgnunetblockgroup.la \
+  $(top_builddir)/src/block/libgnunetblock.la \
+  $(top_builddir)/src/util/libgnunetutil.la
 libgnunet_plugin_block_revocation_la_LDFLAGS = \
  $(GN_PLUGIN_LDFLAGS)
 
diff --git a/src/testbed/Makefile.am b/src/testbed/Makefile.am
index 62b49af78..7c1e217bb 100644
--- a/src/testbed/Makefile.am
+++ b/src/testbed/Makefile.am
@@ -111,6 +111,12 @@ libgnunettestbed_la_LIBADD = $(XLIB) \
  $(top_builddir)/src/util/libgnunetutil.la \
  $(top_builddir)/src/testing/libgnunettesting.la \
  $(LTLIBINTL)
+libgnunettestbed_la_DEPENDENCIES = \
+ $(top_builddir)/src/statistics/libgnunetstatistics.la \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/hello/libgnunethello.la \
+ $(top_builddir)/src/util/libgnunetutil.la \
+ $(top_builddir)/src/testing/libgnunettesting.la
 libgnunettestbed_la_LDFLAGS = \
  $(GN_LIB_LDFLAGS) \
  -version-info 0:0:0
diff --git a/src/testing/Makefile.am b/src/testing/Makefile.am
index 9c6357455..2b599f55b 100644
--- a/src/testing/Makefile.am
+++ b/src/testing/Makefile.am
@@ -20,6 +20,9 @@ libgnunettesting_la_LIBADD = \
  $(top_builddir)/src/arm/libgnunetarm.la \
  $(top_builddir)/src/util/libgnunetutil.la \
  $(LTLIBINTL)
+libgnunettesting_la_DEPENDENCIES = \
+ $(top_builddir)/src/arm/libgnunetarm.la \
+ $(top_builddir)/src/util/libgnunetutil.la
 libgnunettesting_la_LDFLAGS = \
  $(GN_LIB_LDFLAGS) \
  -version-info 2:0:1
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am
index 077c0409a..bb6d12fed 100644
--- a/src/transport/Makefile.am
+++ b/src/transport/Makefile.am
@@ -159,7 +159,15 @@ libgnunettransporttesting_la_LIBADD = \
   $(top_builddir)/src/ats/libgnunetats.la \
   $(top_builddir)/src/util/libgnunetutil.la \
   $(top_builddir)/src/testing/libgnunettesting.la \
+  $(top_builddir)/src/arm/libgnunetarm.la \
   $(GN_LIBINTL)
+libgnunettransporttesting_la_DEPENDENCIES = \
+  libgnunettransport.la \
+  $(top_builddir)/src/hello/libgnunethello.la \
+  $(top_builddir)/src/ats/libgnunetats.la \
+  $(top_builddir)/src/util/libgnunetutil.la \
+  $(top_builddir)/src/testing/libgnunettesting.la \
+  $(top_builddir)/src/arm/libgnunetarm.la
 libgnunettransporttesting_la_LDFLAGS = \
  $(GN_LIB_LDFLAGS)
 
@@ -189,6 +197,10 @@ libgnunettransport_la_LIBADD = \
   $(top_builddir)/src/ats/libgnunetats.la \
   $(top_builddir)/src/util/libgnunetutil.la \
   $(GN_LIBINTL)
+libgnunettransport_la_DEPENDENCIES = \
+  $(top_builddir)/src/hello/libgnunethello.la \
+  $(top_builddir)/src/ats/libgnunetats.la \
+  $(top_builddir)/src/util/libgnunetutil.la
 libgnunettransport_la_LDFLAGS = \
   $(GN_LIB_LDFLAGS)  \
   -version-info 4:0:2
-- 
2.27.0

schanzen

2020-07-05 17:26

administrator   ~0016385

Applied in e31c1d4a9..1d417dcd0

schanzen

2020-07-09 09:17

administrator   ~0016409

0.13.0 released

Issue History

Date Modified Username Field Change
2020-06-28 09:52 beberking New Issue
2020-07-02 20:21 Christian Grothoff Note Added: 0016381
2020-07-02 20:21 Christian Grothoff Assigned To => Christian Grothoff
2020-07-02 20:21 Christian Grothoff Status new => feedback
2020-07-05 16:51 beberking File Added: 0001-Fix_build_dependencies.patch
2020-07-05 16:51 beberking Note Added: 0016384
2020-07-05 16:51 beberking Status feedback => assigned
2020-07-05 17:26 schanzen Status assigned => resolved
2020-07-05 17:26 schanzen Resolution open => fixed
2020-07-05 17:26 schanzen Fixed in Version => 0.13.0
2020-07-05 17:26 schanzen Note Added: 0016385
2020-07-09 09:17 schanzen Note Added: 0016409
2020-07-09 09:17 schanzen Status resolved => closed