summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schanda <schanda@itestra.de>2013-08-22 16:08:54 +0200
committerJohannes Schanda <schanda@itestra.de>2013-08-22 17:06:44 +0200
commitf31bc4a63f1e84fb9aaf0cab006ab55e3fbc5be7 (patch)
treead6b92b5e6b9a47ab4741b6e8048dbbeb4b9d0eb
parent68d93c907847976251da0b16f1e4aa5be41b990b (diff)
downloadgenivi-common-api-dbus-runtime-f31bc4a63f1e84fb9aaf0cab006ab55e3fbc5be7.tar.gz
Linker flags in pkgconfig ensure all symbols
Change-Id: Idc938f91b1ad33fee21f3cfa03896990327be213
-rw-r--r--CommonAPI-DBus-uninstalled.pc.in2
-rw-r--r--CommonAPI-DBus.pc.in2
-rw-r--r--README20
3 files changed, 22 insertions, 2 deletions
diff --git a/CommonAPI-DBus-uninstalled.pc.in b/CommonAPI-DBus-uninstalled.pc.in
index 4d522e6..bbe158d 100644
--- a/CommonAPI-DBus-uninstalled.pc.in
+++ b/CommonAPI-DBus-uninstalled.pc.in
@@ -7,5 +7,5 @@ Name: Common API C++ D-Bus Middleware
Description: GENIVI Common API C++ D-Bus Middleware (uninstalled copy)
Version: @PACKAGE_VERSION@
Requires: CommonAPI dbus-1
-Libs: ${abs_top_builddir}/libCommonAPI-DBus.la
+Libs: -Wl,--whole-archive ${abs_top_builddir}/libCommonAPI-DBus.la -Wl,--no-whole-archive
Cflags: -I${abs_top_srcdir}/src \ No newline at end of file
diff --git a/CommonAPI-DBus.pc.in b/CommonAPI-DBus.pc.in
index d59dfd4..4abc5a3 100644
--- a/CommonAPI-DBus.pc.in
+++ b/CommonAPI-DBus.pc.in
@@ -7,5 +7,5 @@ Name: Common API C++ D-Bus Middleware
Description: GENIVI Common API C++ D-Bus Middleware
Version: @PACKAGE_VERSION@
Requires: CommonAPI dbus-1
-Libs: -L${libdir} -lCommonAPI-DBus
+Libs: -L${libdir} -Wl,--no-as-needed -lCommonAPI-DBus -Wl,--as-needed
Cflags: -I${includedir}/CommonAPI-@PACKAGE_VERSION@ \ No newline at end of file
diff --git a/README b/README
index 98529d3..8dbd27a 100644
--- a/README
+++ b/README
@@ -82,6 +82,26 @@ Use autotools to build this package withthe above requirements available through
# sudo make install (or alternative install process, eg. checkinstall on debian-based distributions, such as Ubuntu)
----
+== Linking against CommonAPI-D-Bus
+
+CommonAPI-D-Bus requires successful activation of all static initialization code on library load. Therefore it is necessary to
+activate certain linker flags to ensure this is always the case. These are specified in the pkg-config files, but are also
+listed here. In case of dynamic linking (.so) --no-as-needed must be specified for the CommonAPI-D-Bus library:
+----
+-Wl,--no-as-needed -lCommonAPI-DBus -Wl,--as-needed
+----
+
+In case of static linking --whole-archive must be specified:
+----
+-Wl,--whole-archive libCommonAPI-DBus.a -Wl,--no-whole-archive
+----
+
+=== Linking generated proxies & stubs
+
+Generated proxies and stubs also require successful activation of all static initialization code on load.
+If they are provided in either a static or dynamic library to the application they must also be linked wrapped in the
+flags described above.
+
=== Building and executing the Unit Tests
----
# export GTEST_CONFIG=/path/to/gtest-1.6.0/scripts/gtest-config