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)
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>

No differences found
This page took 0.02591 seconds and 4 git commands to generate.