]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
srcfiles: Fix compile with --disable-libdebuginfod
authorMark Wielaard <mark@klomp.org>
Mon, 9 Sep 2024 08:24:07 +0000 (10:24 +0200)
committerMark Wielaard <mark@klomp.org>
Tue, 10 Sep 2024 13:42:53 +0000 (15:42 +0200)
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 <mark@klomp.org>
src/srcfiles.cxx
tests/Makefile.am
tests/run-srcfiles-self.sh

index 09d50f8d234a1274c545a77fb37cdea4b4ebed7e..c466b3076593705f23b208c537d9703d8bf02bbb 100644 (file)
@@ -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);
index cdb2d405d2121b752555e5629525c79df538511b..424c184bc200a7a1a5832391dbfe624e2f465735 100644 (file)
@@ -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 \
index 515cc47a5169b42df3ff2de624dbf1822d2bdf12..c9dbbc096bf1898005b504ed677f31091f111113 100755 (executable)
@@ -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