Re: [PATCH] perf: Ensure symbols for plugins are exported

From: Mathias Krause
Date: Wed Apr 22 2015 - 16:12:34 EST


On 18 April 2015 at 17:46, Jiri Olsa <jolsa@xxxxxxxxxx> wrote:
> On Fri, Apr 17, 2015 at 11:01:07PM +0200, Mathias Krause wrote:
>> On 17 April 2015 at 17:34, Jiri Olsa <jolsa@xxxxxxxxxx> wrote:
>> > On Sun, Apr 12, 2015 at 06:00:51PM +0200, Mathias Krause wrote:
>> >> When building perf with perl or python support it implicitly gets linked
>> >> with the -export-dynamic linker option through the additional linker
>> >> flags, namely with -Wl,-E via perl or -Xlinker -export-dynamic via
>> >> python. That flag is essential for the traceevent plugin support so we
>> >> shouldn't rely on adding it implicitly.
>
> I dont see the -E flag being added for perl on my setup,
> but I guess that could be different on each distro

Yeah, seems so. On Debian I get the following:

$ perl -MExtUtils::Embed -e ldopts
-Wl,-E -fstack-protector -L/usr/local/lib
-L/usr/lib/x86_64-linux-gnu/perl/5.20/CORE -lperl -ldl -lm -lpthread
-lc -lcrypt

$ python-config --ldflags
-L/usr/lib/python2.7/config-x86_64-linux-gnu -L/usr/lib -lpython2.7
-lpthread -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1
-Wl,-Bsymbolic-functions

So, the -export-dynamic linker flag gets added by both -- perl and python.

However on CentOS 7 I don't see the -Wl,-E for perl either. But python
still adds it. So the patch is even more needed as leaving out perf
python support on such a distro would make it miss the flag, too.

> maybe we should look for proper fix and export only
> needed symbols

Well, that would require maintaining a symbol file. Don't know if it's
worth it :/

> , anyway for this bugfix:
>
> Acked-by: Jiri Olsa <jolsa@xxxxxxxxxx>

Thanks,
Mathias
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/