]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
build: fix overlinking to libdw
authorMichal Schmidt <mschmidt@redhat.com>
Tue, 13 Oct 2015 14:52:53 +0000 (16:52 +0200)
committerMichal Schmidt <mschmidt@redhat.com>
Wed, 14 Oct 2015 12:43:38 +0000 (14:43 +0200)
We have two AC_CHECK_LIB checks for libdw. The first one has an empty
action-if-found, so it defaults to adding "-ldw" to LIBS. LIBS are
applied to everything we build. But only systemd-coredump needs libdw.
It already links to ELFUTILS_LIBS correctly in Makefile.am.

Drop the first AC_CHECK_LIB check. The second check is sufficient.

Q: Don't we already use "-Wl,--as-needed" to eliminate overlinking?
A: We do, but it is effective only for executables, not for shared
   libraries. This is due to a libtool bug:
   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=347650

configure.ac

index c658c7fca3ed8a337a4bc692b5c3c74a00b8fccb..8f273c69905f7838cf9edbe81631f82a28e9f041 100644 (file)
@@ -788,14 +788,6 @@ if test "x${have_elfutils}" != xno ; then
                         AC_MSG_ERROR([*** ELFUTILS headers not found.])
                 fi])
 
-        AC_CHECK_LIB(
-                [dw],
-                [dwfl_begin],
-                [],
-                [if test "x$have_elfutils" = xyes ; then
-                        AC_MSG_ERROR([*** ELFUTILS libs not found.])
-                fi])
-
         AC_CHECK_LIB(
                 [dw],
                 [dwfl_core_file_attach],