Fix builds with built-in plugins
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 26 May 2017 23:24:13 +0000 (19:24 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 9 Jun 2017 20:58:11 +0000 (16:58 -0400)
commitc3ddb532606565c9526c20703b5c70171031c558
tree762c9f7511e06318b6f034a2ad8925dfa7b08f39
parentdbd7f7e926de30eb6a84b947cb6a4ff3044fd5fb
Fix builds with built-in plugins

The recent convenience libraries are an issue for built-in plugins
because they lead to multiple definitions of the same symbols. This is
because we have to use --whole-archive when embedding the plugin
archives (.a), so the linker wants to embed all the symbols found. If
the same symbol is found twice, the linker is not happy.

For example: the `ctf` plugin's archive includes the symbols of
libbabeltrace-common.a. The CLI also includes the symbols of
libbabeltrace-common.a. When adding the `ctf` archive to the CLI with
--whole-archive, the symbols of libbabeltrace-common.a already exist in
the CLI, so we get the multiple definition error.

My solution here is to avoid adding the convenience libraries to the
individual plugins and to the library itself when BUILT_IN_PLUGINS is
true. The convenience libraries are added only one time to the CLI (in
cli/Makefile.am directly). When BUILT_IN_PLUGINS is false, it is
important to include the convenience library functions in each plugin
because they could be loaded outside the CLI, where those functions do
not exist.

There's also a fix to properly embed the Python plugin provider into the
library, and to print an error at configure time when
BUILT_IN_PYTHON_PLUGIN_SUPPORT=1 is used without
--enable-python-plugins.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
13 files changed:
Makefile.am
cli/Makefile.am
configure.ac
lib/Makefile.am
plugins/ctf/Makefile.am
plugins/ctf/common/metadata/Makefile.am
plugins/ctf/fs-sink/Makefile.am
plugins/ctf/fs-src/Makefile.am
plugins/lttng-utils/Makefile.am
plugins/text/Makefile.am
plugins/text/pretty/Makefile.am
plugins/utils/Makefile.am
plugins/utils/trimmer/Makefile.am
This page took 0.025293 seconds and 4 git commands to generate.