From e7c058b4112fd7120ed4e63d7cd2033a98eead1d Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 12 Aug 2011 20:00:58 -0400 Subject: [PATCH] Fix support for gold linker: inappropriate dep removal of plugins Signed-off-by: Mathieu Desnoyers --- converter/Makefile.am | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/converter/Makefile.am b/converter/Makefile.am index a47a18dc..b836d248 100644 --- a/converter/Makefile.am +++ b/converter/Makefile.am @@ -9,17 +9,23 @@ libbabeltrace_la_SOURCES = \ libbabeltrace_la_LIBADD = \ $(top_builddir)/types/libbabeltrace_types.la \ - $(top_builddir)/formats/ctf/libctf.la \ - $(top_builddir)/formats/ctf-text/libctf-text.la \ - $(top_builddir)/formats/bt-dummy/libbt-dummy.la \ $(top_builddir)/lib/libprio_heap.la babeltrace_SOURCES = \ babeltrace.c +# -Wl,--no-as-needed is needed for recent gold linker who seems to think +# it knows better and considers libraries with constructors having +# side-effects as dead code. Note: we put plugin dependencies on the +# executable rather than the library because libtool does not seem to +# issue the LDFLAGS before the rpaths, which makes it useless. +babeltrace_LDFLAGS = -Wl,--no-as-needed babeltrace_LDADD = \ libbabeltrace.la \ - $(top_builddir)/formats/libbabeltrace_registry.la + $(top_builddir)/formats/libbabeltrace_registry.la \ + $(top_builddir)/formats/ctf/libctf.la \ + $(top_builddir)/formats/ctf-text/libctf-text.la \ + $(top_builddir)/formats/bt-dummy/libbt-dummy.la babeltrace_log_SOURCES = babeltrace-log.c -- 2.34.1