srcfiles: Fix compile with --disable-libdebuginfod
Commit Message
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 | 2 +-
tests/Makefile.am | 4 ++--
tests/run-srcfiles-self.sh | 1 +
3 files changed, 4 insertions(+), 3 deletions(-)
@@ -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);
@@ -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 \
@@ -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