<div>Hi,<div dir="auto"><br></div><div dir="auto"><font style="color:rgb(49,49,49)"><span style="word-spacing:1px">I have an application where I want to statically link both babeltrace2 library including the built in plugins as well as lttng ctl library. I couldn’t find much documentation regarding that. I know you can configure babeltrace with —enable-built-in-plugins but that seems to just link the eventual binary tool with the plugins.</span></font></div><div dir="auto"><div style="font-size:1rem;word-spacing:1px;color:rgb(49,49,49)" dir="auto"> </div><div style="font-size:1rem;word-spacing:1px;color:rgb(49,49,49)" dir="auto">I tried to statically link the individual plugin archives (ctf, text, utils) using —whole-archive but I am getting an error message saying some of the functions have multiple definitions in liblttng-ctl archive. E.g., </div><div style="font-size:1rem;word-spacing:1px;color:rgb(49,49,49)" dir="auto"><br></div><div style="font-size:1rem;word-spacing:1px;color:rgb(49,49,49)" dir="auto">“babeltrace-plugin-ctf.a (libctf_parser_la-lexer.o) : in function ‘yyrestart’: lexer.c:1875: multiple definition of ‘yyrestart’ liblttng-ctl.a (libfilter_la-filter-lexer.o):filter-lexer.c:(.text+0x17e5): first defined here.</div><div style="font-size:1rem;word-spacing:1px;color:rgb(49,49,49)" dir="auto"><br></div><div style="font-size:1rem;word-spacing:1px;color:rgb(49,49,49)" dir="auto">Without —whole-archive the build succeeds (I am using cmake) but the plugins are missing in my app (when trying to use bt_plugin_find with static).</div><div style="font-size:1rem;word-spacing:1px;color:rgb(49,49,49)" dir="auto"><br></div><div style="font-size:1rem;word-spacing:1px;color:rgb(49,49,49)" dir="auto">I am using lttng-tools stable-2.12 and babeltrace2 stable-2.0 from GitHub.</div><div style="font-size:1rem;word-spacing:1px;color:rgb(49,49,49)" dir="auto"><br></div><div style="font-size:1rem;word-spacing:1px;color:rgb(49,49,49)" dir="auto">What do I need to do to properly link lttng-ctl, babeltrace2 and the built in plugins?</div><div style="font-size:1rem;word-spacing:1px;color:rgb(49,49,49)" dir="auto"><br></div><div style="font-size:1rem;word-spacing:1px;color:rgb(49,49,49)" dir="auto">Thanks,</div><div style="font-size:1rem;word-spacing:1px;color:rgb(49,49,49)" dir="auto">Eqbal</div></div><div dir="auto"><br></div><div dir="auto"><br></div>
</div>