From: Mark Wielaard Date: Mon, 9 Sep 2024 08:24:07 +0000 (+0200) Subject: srcfiles: Fix compile with --disable-libdebuginfod X-Git-Tag: elfutils-0.192~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1ccbd384375d4c84aecc6dc382d372f5979a1f0c;p=thirdparty%2Felfutils.git srcfiles: Fix compile with --disable-libdebuginfod The eu-srcfiles --no-backup option is only valid when build with libdebuginfod support. Adjust the ENABLE_LIBDEBUGINFOD conditional to not use no_backup anywhere. Also only run the run-srcfiles-self.sh test when debuginfod is enabled. * src/srcfiles.cxx (zip_files): Move endif ENABLE_LIBDEBUGINFOD after no_backup check. * tests/Makefile.am (TESTS): Only add run-srcfiles-self.sh if DEBUGINFOD and !DUMMY_LIBDEBUGINFOD. * tests/run-srcfiles.self.sh: Use local DEBUGINFOD_CACHE_PATH. https://sourceware.org/bugzilla/show_bug.cgi?id=32155 Signed-off-by: Mark Wielaard --- diff --git a/src/srcfiles.cxx b/src/srcfiles.cxx index 09d50f8d..c466b307 100644 --- a/src/srcfiles.cxx +++ b/src/srcfiles.cxx @@ -349,9 +349,9 @@ void zip_files() else cerr << "Error: Invalid build ID length (" << bits_length << ")." << endl; } - #endif if (!no_backup) + #endif /* ENABLE_LIBDEBUGINFOD */ /* Files could not be located using debuginfod, search locally */ if (fd < 0) fd = open(file_path.c_str(), O_RDONLY); diff --git a/tests/Makefile.am b/tests/Makefile.am index cdb2d405..424c184b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -132,7 +132,6 @@ TESTS = run-arextract.sh run-arsymtest.sh run-ar.sh newfile test-nlist \ run-find-prologues.sh run-allregs.sh run-addrcfi.sh \ run-dwarfcfi.sh run-nm-syms.sh \ run-nm-self.sh run-readelf-self.sh run-readelf-info-plus.sh \ - run-srcfiles-self.sh \ run-readelf-compressed.sh \ run-readelf-const-values.sh \ run-varlocs-self.sh run-exprlocs-self.sh \ @@ -246,7 +245,8 @@ if DEBUGINFOD check_PROGRAMS += debuginfod_build_id_find # With the dummy delegation doesn't work if !DUMMY_LIBDEBUGINFOD -TESTS += run-debuginfod-dlopen.sh \ +TESTS += run-srcfiles-self.sh \ + run-debuginfod-dlopen.sh \ run-debuginfod-artifact-running.sh \ run-debuginfod-fd-prefetch-caches.sh \ run-debuginfod-regex.sh \ diff --git a/tests/run-srcfiles-self.sh b/tests/run-srcfiles-self.sh index 515cc47a..c9dbbc09 100755 --- a/tests/run-srcfiles-self.sh +++ b/tests/run-srcfiles-self.sh @@ -85,6 +85,7 @@ if [ -x ${abs_builddir}/../debuginfod/debuginfod ] && $zip; then export DEBUGINFOD_URLS="http://localhost:${PORT1}/" export DEBUGINFOD_VERBOSE=1 + export DEBUGINFOD_CACHE_PATH=${PWD}/.client_cache testrun $ET_EXEC -z -b -e $ET_EXEC > test.zip tempfiles test.zip