From aa0ebcc3246c6f10c0c90e9e75fa01902e7163bb Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Tue, 23 Aug 2016 13:42:13 +0200 Subject: [PATCH] tests: try to resolve the .so file symbols At some point, linker on ppc64le would throw away useful symbols along with the garbage: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1c9177d9a5c3e06d3344347c8068acfb7d8ecc8b Add a post-build check so that the distributors running broken binutils would catch this early and fix their toolchain (or disable the garbage collecting at the expense of larger and slower binaries). (cherry picked from commit 680b3d1037059e57f538c24c1b8b26c15d33906a) --- src/devices/adsl/Makefile.am | 1 + src/devices/bluetooth/Makefile.am | 1 + src/devices/team/Makefile.am | 1 + src/devices/wifi/Makefile.am | 1 + src/devices/wwan/Makefile.am | 2 ++ src/settings/plugins/ibft/tests/Makefile.am | 3 +++ src/settings/plugins/ifcfg-rh/tests/Makefile.am | 3 +++ src/settings/plugins/ifnet/tests/Makefile.am | 3 +++ src/settings/plugins/ifupdown/tests/Makefile.am | 3 +++ 9 files changed, 18 insertions(+) diff --git a/src/devices/adsl/Makefile.am b/src/devices/adsl/Makefile.am index 5f981740a..9075021c3 100644 --- a/src/devices/adsl/Makefile.am +++ b/src/devices/adsl/Makefile.am @@ -40,6 +40,7 @@ if ENABLE_TESTS check-local: $(top_srcdir)/tools/check-exports.sh $(builddir)/.libs/libnm-device-plugin-adsl.so $(SYMBOL_VIS_FILE) + LD_BIND_NOW=1 LD_PRELOAD=$(builddir)/.libs/libnm-device-plugin-adsl.so $(top_builddir)/src/NetworkManager --version >/dev/null endif diff --git a/src/devices/bluetooth/Makefile.am b/src/devices/bluetooth/Makefile.am index 2ff9a5724..8454702e5 100644 --- a/src/devices/bluetooth/Makefile.am +++ b/src/devices/bluetooth/Makefile.am @@ -76,6 +76,7 @@ if ENABLE_TESTS check-local: $(top_srcdir)/tools/check-exports.sh $(builddir)/.libs/libnm-device-plugin-bluetooth.so $(SYMBOL_VIS_FILE) + LD_BIND_NOW=1 LD_PRELOAD=$(builddir)/.libs/libnm-device-plugin-bluetooth.so $(top_builddir)/src/NetworkManager --version >/dev/null endif diff --git a/src/devices/team/Makefile.am b/src/devices/team/Makefile.am index 3609ace42..db756b4c6 100644 --- a/src/devices/team/Makefile.am +++ b/src/devices/team/Makefile.am @@ -49,6 +49,7 @@ if ENABLE_TESTS check-local: $(top_srcdir)/tools/check-exports.sh $(builddir)/.libs/libnm-device-plugin-team.so $(SYMBOL_VIS_FILE) + LD_BIND_NOW=1 LD_PRELOAD=$(builddir)/.libs/libnm-device-plugin-team.so $(top_builddir)/src/NetworkManager --version >/dev/null endif diff --git a/src/devices/wifi/Makefile.am b/src/devices/wifi/Makefile.am index e35a84b43..add0a007c 100644 --- a/src/devices/wifi/Makefile.am +++ b/src/devices/wifi/Makefile.am @@ -52,6 +52,7 @@ if ENABLE_TESTS check-local: $(top_srcdir)/tools/check-exports.sh $(builddir)/.libs/libnm-device-plugin-wifi.so $(SYMBOL_VIS_FILE) + LD_BIND_NOW=1 LD_PRELOAD=$(builddir)/.libs/libnm-device-plugin-wifi.so $(top_builddir)/src/NetworkManager --version >/dev/null endif diff --git a/src/devices/wwan/Makefile.am b/src/devices/wwan/Makefile.am index 44d0f1e24..0d061a792 100644 --- a/src/devices/wwan/Makefile.am +++ b/src/devices/wwan/Makefile.am @@ -88,7 +88,9 @@ if ENABLE_TESTS check-local: $(top_srcdir)/tools/check-exports.sh $(builddir)/.libs/libnm-device-plugin-wwan.so $(SYMBOL_VIS_FILE) + LD_BIND_NOW=1 LD_PRELOAD=$(builddir)/.libs/libnm-device-plugin-wwan.so $(top_builddir)/src/NetworkManager --version >/dev/null $(top_srcdir)/tools/check-exports.sh $(builddir)/.libs/libnm-wwan.so $(WWAN_SYMBOL_VIS_FILE) + LD_BIND_NOW=1 LD_PRELOAD=$(builddir)/.libs/libnm-wwan.so $(top_builddir)/src/NetworkManager --version >/dev/null endif diff --git a/src/settings/plugins/ibft/tests/Makefile.am b/src/settings/plugins/ibft/tests/Makefile.am index 939947ca5..e5cff73f5 100644 --- a/src/settings/plugins/ibft/tests/Makefile.am +++ b/src/settings/plugins/ibft/tests/Makefile.am @@ -34,6 +34,9 @@ test_ibft_LDADD = \ @VALGRIND_RULES@ TESTS = test-ibft +check-local: + LD_BIND_NOW=1 LD_PRELOAD=$(builddir)/../.libs/libnm-settings-plugin-ibft.so $(top_builddir)/src/NetworkManager --version >/dev/null + endif EXTRA_DIST = \ diff --git a/src/settings/plugins/ifcfg-rh/tests/Makefile.am b/src/settings/plugins/ifcfg-rh/tests/Makefile.am index 73ddfeefd..fedbd93fa 100644 --- a/src/settings/plugins/ifcfg-rh/tests/Makefile.am +++ b/src/settings/plugins/ifcfg-rh/tests/Makefile.am @@ -49,5 +49,8 @@ test_ifcfg_rh_utils_LDADD = \ @VALGRIND_RULES@ TESTS = test-ifcfg-rh-utils test-ifcfg-rh +check-local: + LD_BIND_NOW=1 LD_PRELOAD=$(builddir)/../.libs/libnm-settings-plugin-ifcfg-rh.so $(top_builddir)/src/NetworkManager --version >/dev/null + endif diff --git a/src/settings/plugins/ifnet/tests/Makefile.am b/src/settings/plugins/ifnet/tests/Makefile.am index eb813ab29..8ece14c64 100644 --- a/src/settings/plugins/ifnet/tests/Makefile.am +++ b/src/settings/plugins/ifnet/tests/Makefile.am @@ -37,6 +37,9 @@ test_ifnet_LDADD = $(top_builddir)/src/libNetworkManager.la @VALGRIND_RULES@ TESTS = test-ifnet +check-local: + LD_BIND_NOW=1 LD_PRELOAD=$(builddir)/../.libs/libnm-settings-plugin-ifnet.so $(top_builddir)/src/NetworkManager --version >/dev/null + endif EXTRA_DIST = \ diff --git a/src/settings/plugins/ifupdown/tests/Makefile.am b/src/settings/plugins/ifupdown/tests/Makefile.am index 4f01fc0c9..1287a7167 100644 --- a/src/settings/plugins/ifupdown/tests/Makefile.am +++ b/src/settings/plugins/ifupdown/tests/Makefile.am @@ -26,6 +26,9 @@ test_ifupdown_LDADD = \ @VALGRIND_RULES@ TESTS = test-ifupdown +check-local: + LD_BIND_NOW=1 LD_PRELOAD=$(builddir)/../.libs/libnm-settings-plugin-ifupdown.so $(top_builddir)/src/NetworkManager --version >/dev/null + endif EXTRA_DIST = \