From d7a4278d29fe2ca976ae3db3d12705cdc9dd01be Mon Sep 17 00:00:00 2001 From: Felipe Sateler Date: Sun, 3 Jul 2016 11:17:13 -0400 Subject: [PATCH 1/4] tests: follow RUNPATH when installing missing libraries Fixes #3630 --- test/test-functions | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/test-functions b/test/test-functions index 4583c02f97..08a5c65555 100644 --- a/test/test-functions +++ b/test/test-functions @@ -275,10 +275,15 @@ install_systemd() { echo LogLevel=debug >> $initdir/etc/systemd/system.conf } +get_ldpath() { + local _bin="$1" + objdump -p "$_bin" 2>/dev/null | awk "/R(UN)?PATH/ { print \"$initdir\" \$2 }" | paste -sd : +} + install_missing_libraries() { # install possible missing libraries for i in $initdir/{sbin,bin}/* $initdir/lib/systemd/*; do - inst_libs $i + LD_LIBRARY_PATH=$(get_ldpath $i) inst_libs $i done } From 0bd179ffcd501ae84ec11a3b81b47836a1c0fdc0 Mon Sep 17 00:00:00 2001 From: Felipe Sateler Date: Sun, 3 Jul 2016 11:19:38 -0400 Subject: [PATCH 2/4] tests: run file via libtool to determine shell scripts The actual output file might be a wrapper script, so lets follow the indirection Fixes: #3644 --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 0ec407520b..fa81400bd2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6417,7 +6417,7 @@ install-tree: all .PHONY: valgrind-tests valgrind-tests: $(TESTS) $(AM_V_GEN)for f in $(filter-out %.pl %.py, $^); do \ - if file $$f | grep -q shell; then \ + if $(LIBTOOL) --mode=execute file $$f | grep -q shell; then \ echo -e "$${x}Skipping non-binary $$f"; else \ echo -e "$${x}Running $$f"; \ $(LIBTOOL) --mode=execute valgrind -q --leak-check=full --max-stackframe=5242880 --error-exitcode=55 $(builddir)/$$f ; fi; \ From 65e15f402fab9a496ed74f86d5fbe35ba661ea65 Mon Sep 17 00:00:00 2001 From: Felipe Sateler Date: Sun, 3 Jul 2016 18:32:48 -0400 Subject: [PATCH 3/4] build-sys: link test-keymap-util against libsystemd-shared --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index fa81400bd2..f71ce848ee 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4861,7 +4861,7 @@ test_keymap_util_SOURCES = \ src/locale/keymap-util.h test_keymap_util_LDADD = \ - libshared.la \ + libsystemd-shared.la \ -ldl tests += \ From 11ea3431265f4b20e18997e5b27187ab4db77e87 Mon Sep 17 00:00:00 2001 From: Felipe Sateler Date: Sun, 3 Jul 2016 18:56:54 -0400 Subject: [PATCH 4/4] tests: Install missing libraries for things installed in /usr too --- test/test-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test-functions b/test/test-functions index 08a5c65555..567a000b8d 100644 --- a/test/test-functions +++ b/test/test-functions @@ -282,7 +282,7 @@ get_ldpath() { install_missing_libraries() { # install possible missing libraries - for i in $initdir/{sbin,bin}/* $initdir/lib/systemd/*; do + for i in $initdir{,/usr}/{sbin,bin}/* $initdir{,/usr}/lib/systemd/*; do LD_LIBRARY_PATH=$(get_ldpath $i) inst_libs $i done }