[PATCH] tests: Add -ldl to dwfl_proc_attach_LDFLAGS
Mark Wielaard
mark@klomp.org
Thu Nov 18 21:23:41 GMT 2021
dwfl-proc-attach uses (overrides) dlopen (so it does nothing). This
seems to cause a versioned dlopen symbol to be pulled in when building
with LTO. Resulting in a link failure (when dlopen isn't integrated
into libc):
/usr/bin/ld: dwfl-proc-attach.o (symbol from plugin): undefined
reference to symbol 'dlopen@@GLIBC_2.2.5'
/usr/bin/ld: /usr/lib64/libdl.so.2: error adding symbols: DSO missing
from command line collect2: error: ld returned 1 exit status
So simply explicitly add -ldl to the LDFLAGS.
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
tests/ChangeLog | 4 ++++
tests/Makefile.am | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/tests/ChangeLog b/tests/ChangeLog
index a59cdd51..97cb3fa3 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,7 @@
+2021-11-18 Mark Wielaard <mark@klomp.org>
+
+ * Makefile.am (dwfl_proc_attach_LDFLAGS): Add -ldl.
+
2021-11-05 Frank Ch. Eigler <fche@redhat.com>
PR28430
diff --git a/tests/Makefile.am b/tests/Makefile.am
index bfb8b13a..f212f9fb 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -717,7 +717,7 @@ strptr_LDADD = $(libelf)
newdata_LDADD = $(libelf)
elfstrtab_LDADD = $(libelf)
dwfl_proc_attach_LDADD = $(libdw)
-dwfl_proc_attach_LDFLAGS = -pthread $(AM_LDFLAGS)
+dwfl_proc_attach_LDFLAGS = -pthread -ldl $(AM_LDFLAGS)
elfshphehdr_LDADD =$(libelf)
elfstrmerge_LDADD = $(libdw) $(libelf)
dwelfgnucompressed_LDADD = $(libelf) $(libdw)
--
2.30.2
More information about the Elfutils-devel
mailing list