Link statically to internal libraries
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 23 Feb 2012 18:25:05 +0000 (13:25 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 23 Feb 2012 18:25:05 +0000 (13:25 -0500)
Previously, we installed all "internal" libs as .so, because static
linking a static lib into a dynamic lib did remove the unused objects.
Use the -Wl,--no-as-needed linker flag to fix this issue, allowing us to
entirely privatize private libs.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
converter/Makefile.am
formats/bt-dummy/Makefile.am
formats/ctf-text/Makefile.am
formats/ctf-text/types/Makefile.am
formats/ctf/Makefile.am
formats/ctf/metadata/Makefile.am
formats/ctf/types/Makefile.am

index 9443c2148848d681d1817ba462f11ac1c9b2f44a..389a9d98a84c8fe4e851334533266b443693f448 100644 (file)
@@ -7,19 +7,16 @@ babeltrace_SOURCES = \
 
 # -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.
+# side-effects as dead code.
 babeltrace_LDFLAGS = -Wl,--no-as-needed
 babeltrace_LDADD = \
        $(top_builddir)/lib/libbabeltrace.la \
-       $(top_builddir)/formats/ctf/libctf.la \
-       $(top_builddir)/formats/ctf/metadata/libctf-ast.la \
-       $(top_builddir)/formats/ctf-text/libctf-text.la \
-       $(top_builddir)/formats/bt-dummy/libbt-dummy.la
+       $(top_builddir)/formats/ctf/libbabeltrace-ctf.la \
+       $(top_builddir)/formats/ctf-text/libbabeltrace-ctf-text.la \
+       $(top_builddir)/formats/bt-dummy/libbabeltrace-dummy.la
 
 babeltrace_log_SOURCES = babeltrace-log.c
 
 babeltrace_log_LDADD = \
        $(top_builddir)/lib/libbabeltrace.la \
-       $(top_builddir)/formats/ctf/libctf.la
+       $(top_builddir)/formats/ctf/libbabeltrace-ctf.la
index 016ffad9983716124ae33128153d4b7639588f86..96775df4c37938169b781adbf24445b259b2d1ce 100644 (file)
@@ -1,9 +1,9 @@
 AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include
 
-lib_LTLIBRARIES = libbt-dummy.la
+lib_LTLIBRARIES = libbabeltrace-dummy.la
 
-libbt_dummy_la_SOURCES = \
+libbabeltrace_dummy_la_SOURCES = \
        bt-dummy.c
 
-libbt_dummy_la_LIBADD = \
+libbabeltrace_dummy_la_LIBADD = \
        $(top_builddir)/lib/libbabeltrace.la
index ca033e058b31f1ed6dd6451130a1c6ad9a5519e2..4d84d928a3704c0b1370bf890db5daff4bfd4b84 100644 (file)
@@ -2,11 +2,14 @@ AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include
 
 SUBDIRS = types .
 
-lib_LTLIBRARIES = libctf-text.la
+lib_LTLIBRARIES = libbabeltrace-ctf-text.la
 
-libctf_text_la_SOURCES = \
+libbabeltrace_ctf_text_la_SOURCES = \
        ctf-text.c
 
-libctf_text_la_LIBADD = \
-       types/libctf-text-types.la \
+libbabeltrace_ctf_text_la_LDFLAGS = \
+       -Wl,--no-as-needed \
+       types/libctf-text-types.la
+
+libbabeltrace_ctf_text_la_LIBADD = \
        $(top_builddir)/lib/libbabeltrace.la
index 604293e69947b74f54f9bb33e856d3b27aed1cca..f688e1f5094640df4d1b6118f5da4f8b54f533bb 100644 (file)
@@ -1,6 +1,6 @@
 AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include
 
-lib_LTLIBRARIES = libctf-text-types.la
+noinst_LTLIBRARIES = libctf-text-types.la
 
 libctf_text_types_la_SOURCES = \
        array.c \
index a85e7d3eed0871f0d6679183e497e26541e99983..8d2ee192bc5442d06608ee63c72d2c45ba51f6e6 100644 (file)
@@ -2,16 +2,20 @@ AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include
 
 SUBDIRS = types metadata .
 
-lib_LTLIBRARIES = libctf.la
+lib_LTLIBRARIES = libbabeltrace-ctf.la
 
-libctf_la_SOURCES = \
+libbabeltrace_ctf_la_SOURCES = \
        ctf.c \
        events.c \
        callbacks.c \
        events-private.h
 
-libctf_la_LIBADD = \
+# Request that the linker keeps all static libraries objects.
+libbabeltrace_ctf_la_LDFLAGS = \
+       -Wl,--no-as-needed \
        types/libctf-types.la \
        metadata/libctf-parser.la \
-       metadata/libctf-ast.la \
+       metadata/libctf-ast.la
+       
+libbabeltrace_ctf_la_LIBADD = \
        $(top_builddir)/lib/libbabeltrace.la
index a7d6c98ac676bc5fa017d342fc81083b94f80dd5..0725dce3d826bfba62a1249d790570b059907391 100644 (file)
@@ -2,7 +2,7 @@ AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include
 BUILT_SOURCES = ctf-parser.h
 AM_YFLAGS = -t -d -v
 
-lib_LTLIBRARIES = libctf-parser.la libctf-ast.la
+noinst_LTLIBRARIES = libctf-parser.la libctf-ast.la
 
 noinst_HEADERS = \
        ctf-scanner.h \
index a2861dcade9c81bb03f452a169e58f0d3fac0f59..76544b3c8f323f0a8b9db500a804e56798b1399d 100644 (file)
@@ -1,6 +1,6 @@
 AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include
 
-lib_LTLIBRARIES = libctf-types.la
+noinst_LTLIBRARIES = libctf-types.la
 
 libctf_types_la_SOURCES = \
        array.c \
This page took 0.039825 seconds and 4 git commands to generate.