summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2021-07-21 22:18:32 +0200
committerThomas Haller <thaller@redhat.com>2021-07-26 15:30:10 +0200
commit684f2acffea3ed5704330bff05b87acbf371ccdd (patch)
treeb3f9661972edbb3934692b1d897b7ef76021c75d /Makefile.am
parent641f4473b7cf221b00c38dcce76cd3ba6496c763 (diff)
downloadNetworkManager-684f2acffea3ed5704330bff05b87acbf371ccdd.tar.gz
build: add way to keep unused symbols when linking NetworkManager
NetworkManager (and NetworkManager-all-sym) must not only contain symbols that are used by itself. Also the device and settings plugin are dlopen'd by NetworkManager and use symobls form the binary. That means, if a symbols is only used by a plugin, then we must make sure that the linker keeps it in the binary. Add a mechanism for that.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am8
1 files changed, 8 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 659dc054f1..af327de094 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2656,6 +2656,12 @@ $(src_core_libNetworkManagerTest_la_OBJECTS): $(src_libnm_core_public_mkenums_h)
###############################################################################
+# NetworkManager binary also must contain symbols that are not used by the binary
+# itself, but by the plugins (that are dlopened). We need to explicitly include
+# them during linking.
+networkmanager_undefined_symbols = \
+ $(NULL)
+
noinst_PROGRAMS += src/core/NetworkManager-all-sym
src_core_NetworkManager_all_sym_CPPFLAGS = $(src_core_cppflags)
@@ -2670,6 +2676,7 @@ src_core_NetworkManager_all_sym_LDADD = \
src_core_NetworkManager_all_sym_LDFLAGS = \
-rdynamic \
+ $(networkmanager_undefined_symbols:%=-u %) \
$(SANITIZER_EXEC_LDFLAGS) \
$(NULL)
@@ -2696,6 +2703,7 @@ src_core_NetworkManager_LDADD = \
src_core_NetworkManager_LDFLAGS = \
-rdynamic \
-Wl,--version-script="src/core/NetworkManager.ver" \
+ $(networkmanager_undefined_symbols:%=-u %) \
$(SANITIZER_EXEC_LDFLAGS) \
$(NULL)