| Link dbus' binaries dynamically |
| |
| dbus binaries are linked statically to a private library. The dbus .so contains |
| most of this private library but does not export the symbols. |
| This CL exports the private symbols in the shared library and link dynamically |
| dbus-daemon and dbus-daemon-launch-helper. |
| diff --git a/bus/Makefile.am b/bus/Makefile.am |
| index 6cbc09a..6924d06 100644 |
| --- a/bus/Makefile.am |
| +++ b/bus/Makefile.am |
| @@ -106,7 +106,7 @@ dbus_daemon_SOURCES= \ |
| main.c |
| |
| dbus_daemon_LDADD= \ |
| - $(top_builddir)/dbus/libdbus-internal.la \ |
| + $(top_builddir)/dbus/libdbus-1.la \ |
| $(EFENCE) \ |
| $(DBUS_BUS_LIBS) |
| |
| @@ -130,7 +130,7 @@ dbus_daemon_launch_helper_SOURCES= \ |
| $(LAUNCH_HELPER_SOURCES) |
| |
| dbus_daemon_launch_helper_LDADD= \ |
| - $(top_builddir)/dbus/libdbus-internal.la \ |
| + $(top_builddir)/dbus/libdbus-1.la \ |
| $(DBUS_LAUNCHER_LIBS) |
| |
| ## we build another binary so we can do the launch testing without root privs. |
| @@ -140,7 +140,7 @@ dbus_daemon_launch_helper_test_SOURCES= \ |
| $(LAUNCH_HELPER_SOURCES) |
| |
| dbus_daemon_launch_helper_test_LDADD= \ |
| - $(top_builddir)/dbus/libdbus-internal.la \ |
| + $(top_builddir)/dbus/libdbus-1.la \ |
| $(DBUS_LAUNCHER_LIBS) |
| |
| dbus_daemon_launch_helper_test_CPPFLAGS = \ |
| @@ -154,7 +154,7 @@ bus_test_launch_helper_SOURCES= \ |
| $(LAUNCH_HELPER_SOURCES) |
| |
| bus_test_launch_helper_LDADD= \ |
| - $(top_builddir)/dbus/libdbus-internal.la \ |
| + $(top_builddir)/dbus/libdbus-1.la \ |
| $(DBUS_LAUNCHER_LIBS) |
| |
| bus_test_launch_helper_CPPFLAGS = \ |
| @@ -199,13 +199,13 @@ bus_test_system_SOURCES= \ |
| utils.h \ |
| test-system.c |
| |
| -bus_test_system_LDADD=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS) |
| +bus_test_system_LDADD=$(top_builddir)/dbus/libdbus-1.la $(DBUS_BUS_LIBS) |
| |
| bus_test_SOURCES= \ |
| $(BUS_SOURCES) \ |
| test-main.c |
| |
| -bus_test_LDADD=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS) |
| +bus_test_LDADD=$(top_builddir)/dbus/libdbus-1.la $(DBUS_BUS_LIBS) |
| |
| ## mop up the gcov files |
| clean-local: |
| diff --git a/configure.ac b/configure.ac |
| index 24fcc9e..20e8370 100644 |
| --- a/configure.ac |
| +++ b/configure.ac |
| @@ -1700,6 +1700,7 @@ fi |
| |
| AC_CONFIG_FILES([ |
| Doxyfile |
| +dbus/Version |
| dbus/versioninfo.rc |
| dbus/dbus-arch-deps.h |
| bus/system.conf |
| diff --git a/dbus/Makefile.am b/dbus/Makefile.am |
| index bb5ccca..4a0ca18 100644 |
| --- a/dbus/Makefile.am |
| +++ b/dbus/Makefile.am |
| @@ -33,7 +33,6 @@ SUFFIXES = rc |
| dbus_res = versioninfo.o |
| dbus_res_ldflag = -Wl,$(dbus_res) |
| no_undefined = -no-undefined |
| -export_symbols = |
| |
| libdbus_1_la_DEPENDENCIES = $(dbus_res) |
| intllibs = |
| @@ -42,9 +41,6 @@ else |
| dbus_res = |
| dbus_res_ldflag = |
| no_undefined = |
| -## don't export symbols that start with "_" (we use this |
| -## convention for internal symbols) |
| -export_symbols = -export-symbols-regex "^[^_].*" |
| |
| intllibs = @LTLIBINTL@ |
| |
| @@ -259,38 +255,24 @@ DBUS_UTIL_SOURCES= \ |
| |
| libdbus_1_la_SOURCES= \ |
| $(DBUS_LIB_SOURCES) \ |
| - $(DBUS_SHARED_SOURCES) |
| - |
| -libdbus_internal_la_SOURCES= \ |
| - $(DBUS_LIB_SOURCES) \ |
| $(DBUS_SHARED_SOURCES) \ |
| $(DBUS_UTIL_SOURCES) |
| |
| BUILT_SOURCES=$(nodist_dbusarchinclude_HEADERS) |
| EXTRA_DIST=dbus-arch-deps.h.in |
| - |
| -## this library is the same as libdbus, but exports all the symbols |
| -## and is only used for static linking within the dbus package. |
| -noinst_LTLIBRARIES=libdbus-internal.la |
| - |
| libdbus_1_la_CPPFLAGS = \ |
| $(AM_CPPFLAGS) \ |
| -Ddbus_1_EXPORTS \ |
| $(NULL) |
| + |
| libdbus_1_la_LIBADD= $(LIBDBUS_LIBS) |
| libdbus_1_la_LDFLAGS = \ |
| $(AM_LDFLAGS) \ |
| - $(export_symbols) \ |
| -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ |
| + -Wl,--version-script=Version \ |
| -no-undefined \ |
| $(NULL) |
| |
| -libdbus_internal_la_CPPFLAGS = \ |
| - $(AM_CPPFLAGS) \ |
| - -DDBUS_STATIC_BUILD \ |
| - $(NULL) |
| -libdbus_internal_la_LIBADD=$(LIBDBUS_LIBS) $(SYSTEMD_LIBS) |
| - |
| noinst_PROGRAMS = |
| |
| if DBUS_BUILD_TESTS |
| @@ -301,7 +283,7 @@ endif |
| dbus_test_SOURCES= \ |
| dbus-test-main.c |
| |
| -dbus_test_LDADD = libdbus-internal.la |
| +dbus_test_LDADD = libdbus-1.la |
| |
| ## mop up the gcov files |
| clean-local: |
| diff --git a/dbus/Version.in b/dbus/Version.in |
| new file mode 100644 |
| index 0000000..577a895 |
| --- /dev/null |
| +++ b/dbus/Version.in |
| @@ -0,0 +1,10 @@ |
| +Base { |
| + global: |
| + dbus_*; |
| + local: |
| + *; |
| +}; |
| +PRIVATE_@DBUS_VERSION@ { |
| + global: |
| + _dbus_*; |
| +}; |
| diff --git a/test/Makefile.am b/test/Makefile.am |
| index e944899..07a9ad2 100644 |
| --- a/test/Makefile.am |
| +++ b/test/Makefile.am |
| @@ -7,7 +7,6 @@ DIST_SUBDIRS=name-test |
| # CPPFLAGS for binaries that are normally dynamic |
| AM_CPPFLAGS = \ |
| -I$(top_srcdir) \ |
| - $(DBUS_STATIC_BUILD_CPPFLAGS) \ |
| $(GLIB_CFLAGS) \ |
| $(DBUS_GLIB_CFLAGS) \ |
| $(NULL) |
| @@ -15,20 +14,12 @@ AM_CPPFLAGS = \ |
| # improve backtraces from test stuff |
| AM_LDFLAGS = @R_DYNAMIC_LDFLAG@ |
| |
| -# CPPFLAGS for binaries that are always static |
| -static_cppflags = \ |
| - $(AM_CPPFLAGS) \ |
| - -DDBUS_STATIC_BUILD \ |
| - $(NULL) |
| - |
| -libdbus_testutils_la_CPPFLAGS = \ |
| - $(static_cppflags) |
| libdbus_testutils_la_SOURCES = \ |
| test-utils.c \ |
| test-utils.h \ |
| $(NULL) |
| libdbus_testutils_la_LIBADD = \ |
| - $(top_builddir)/dbus/libdbus-internal.la \ |
| + $(top_builddir)/dbus/libdbus-1.la \ |
| $(NULL) |
| |
| noinst_LTLIBRARIES = libdbus-testutils.la |
| @@ -68,25 +59,17 @@ endif !DBUS_BUILD_TESTS |
| |
| noinst_PROGRAMS= $(TEST_BINARIES) |
| |
| -test_service_CPPFLAGS = $(static_cppflags) |
| test_service_LDADD = libdbus-testutils.la |
| -test_names_CPPFLAGS = $(static_cppflags) |
| test_names_LDADD = libdbus-testutils.la |
| -## break_loader_CPPFLAGS = $(static_cppflags) |
| ## break_loader_LDADD = $(top_builddir)/dbus/libdbus-internal.la |
| -test_shell_service_CPPFLAGS = $(static_cppflags) |
| test_shell_service_LDADD = libdbus-testutils.la |
| -shell_test_CPPFLAGS = $(static_cppflags) |
| shell_test_LDADD = libdbus-testutils.la |
| -spawn_test_CPPFLAGS = $(static_cppflags) |
| -spawn_test_LDADD = $(top_builddir)/dbus/libdbus-internal.la |
| +spawn_test_LDADD = $(top_builddir)/dbus/libdbus-1.la |
| |
| test_refs_SOURCES = internals/refs.c |
| -test_refs_CPPFLAGS = $(static_cppflags) |
| test_refs_LDADD = libdbus-testutils.la $(GLIB_LIBS) |
| |
| test_syslog_SOURCES = internals/syslog.c |
| -test_syslog_CPPFLAGS = $(static_cppflags) |
| test_syslog_LDADD = libdbus-testutils.la $(GLIB_LIBS) |
| |
| EXTRA_DIST = dbus-test-runner |
| diff --git a/test/name-test/Makefile.am b/test/name-test/Makefile.am |
| index 6aaf178..ba23f69 100644 |
| --- a/test/name-test/Makefile.am |
| +++ b/test/name-test/Makefile.am |
| @@ -1,8 +1,6 @@ |
| -# Everything in this directory is statically-linked to libdbus-internal |
| AM_CPPFLAGS = \ |
| -I$(top_srcdir) \ |
| -DDBUS_COMPILATION \ |
| - -DDBUS_STATIC_BUILD \ |
| $(NULL) |
| |
| # if assertions are enabled, improve backtraces |
| @@ -26,10 +24,10 @@ if DBUS_BUILD_TESTS |
| ## build even when not doing "make check" |
| noinst_PROGRAMS=test-pending-call-dispatch test-pending-call-timeout test-threads-init test-ids test-shutdown test-privserver test-privserver-client test-autolaunch |
| |
| -test_pending_call_dispatch_LDADD=$(top_builddir)/dbus/libdbus-internal.la |
| -test_pending_call_timeout_LDADD=$(top_builddir)/dbus/libdbus-internal.la |
| -test_threads_init_LDADD=$(top_builddir)/dbus/libdbus-internal.la |
| -test_ids_LDADD=$(top_builddir)/dbus/libdbus-internal.la |
| +test_pending_call_dispatch_LDADD=$(top_builddir)/dbus/libdbus-1.la |
| +test_pending_call_timeout_LDADD=$(top_builddir)/dbus/libdbus-1.la |
| +test_threads_init_LDADD=$(top_builddir)/dbus/libdbus-1.la |
| +test_ids_LDADD=$(top_builddir)/dbus/libdbus-1.la |
| |
| test_shutdown_LDADD=../libdbus-testutils.la |
| test_privserver_LDADD=../libdbus-testutils.la |