]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Fix static build when zstd is enabled for libelf
authorMark Wielaard <mark@klomp.org>
Fri, 3 Mar 2023 16:10:30 +0000 (17:10 +0100)
committerMark Wielaard <mark@klomp.org>
Fri, 3 Mar 2023 16:10:30 +0000 (17:10 +0100)
When doing a static build (as with --enable-gcov) the build fails
because the executables aren't linked with -lzstd. Also the
run-debuginfod-query-retry.sh test relies on libdebuginfod.so.1 which
isn't there.

Fix by adding $(zstd_LIBS) to the static libelf lines and using the
debuginfod-find executable itself in the testcase.

    * src/Makefile.am (libelf): When BUILD_STATIC add $(zstd_LIBS)
    * tests/Makefile.am (libelf): Likewise.
    * tests/run-debuginfod-query-retry.sh: Use debuginfod-find instead
      of libdebuginfod.so.1

Signed-off-by: Mark Wielaard <mark@klomp.org>
src/Makefile.am
tests/Makefile.am
tests/run-debuginfod-query-retry.sh

index 6cc019da0856c39ee84ebad9480a643bba26cd25..10d59a48386d0165185691581e40811238c3f0a1 100644 (file)
@@ -42,7 +42,7 @@ CLEANFILES += make-debug-archive
 if BUILD_STATIC
 libasm = ../libasm/libasm.a
 libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) -ldl -lpthread
-libelf = ../libelf/libelf.a -lz
+libelf = ../libelf/libelf.a -lz $(zstd_LIBS)
 else
 libasm = ../libasm/libasm.so
 libdw = ../libdw/libdw.so
index fd58bf849fe11f8825c7a36e5b8a92d7c4381870..7e32f1170c1bfd7543e303f7ea7d987bd3cad397 100644 (file)
@@ -664,7 +664,7 @@ installcheck-local:
 
 if BUILD_STATIC
 libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread
-libelf = ../libelf/libelf.a -lz
+libelf = ../libelf/libelf.a -lz $(zstd_LIBS)
 libasm = ../libasm/libasm.a
 else
 libdw = ../libdw/libdw.so
index 2f551ffbf1f3e585d7d51e6e0dd48386bd8f9ce8..d2cdfd6593d48f867596bcd51fbce720b602d713 100755 (executable)
@@ -26,7 +26,7 @@ unset VALGRIND_CMD
 # set up tests for retrying failed queries.
 retry_attempts=`(testrun env DEBUGINFOD_URLS=http://255.255.255.255/JUNKJUNK DEBUGINFOD_RETRY_LIMIT=10 DEBUGINFOD_VERBOSE=1 DEBUGINFOD_CACHE_PATH=${PWD}/.client_cache \
     ${abs_top_builddir}/debuginfod/debuginfod-find debuginfo \
-    ${abs_top_builddir}/debuginfod/libdebuginfod.so.1 || true) \
+    ${abs_top_builddir}/debuginfod/debuginfod-find || true) \
     2>&1 >/dev/null | grep -c 'Retry failed query'`
 if [ $retry_attempts -ne 10 ]; then
     echo "retry mechanism failed."