Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752069AbbDLQBH (ORCPT ); Sun, 12 Apr 2015 12:01:07 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:35992 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751519AbbDLQBB (ORCPT ); Sun, 12 Apr 2015 12:01:01 -0400 From: Mathias Krause To: linux-kernel@vger.kernel.org Cc: Mathias Krause , Arnaldo Carvalho de Melo , Ingo Molnar , Jiri Olsa , Paul Mackerras , Peter Zijlstra Subject: [PATCH] perf: Ensure symbols for plugins are exported Date: Sun, 12 Apr 2015 18:00:51 +0200 Message-Id: <1428854451-28361-1-git-send-email-minipli@googlemail.com> X-Mailer: git-send-email 1.7.10.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2292 Lines: 54 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. Ensure perf's exported symbols can be used by dlopen()ed plugins by unconditionally adding this flag when linking perf. Otherwise plugins won't be able to access symbols in the perf binary. This fixes the following warning / bug when trying to load plugins: Warning: could not load plugin '/home/minipli/.traceevent/plugins/plugin_xen.so' /home/minipli/.traceevent/plugins/plugin_xen.so: undefined symbol: trace_seq_printf Warning: could not load plugin '/home/minipli/.traceevent/plugins/plugin_function.so' /home/minipli/.traceevent/plugins/plugin_function.so: undefined symbol: warning Warning: could not load plugin '/home/minipli/.traceevent/plugins/plugin_sched_switch.so' /home/minipli/.traceevent/plugins/plugin_sched_switch.so: undefined symbol: pevent_unregister_event_handler [...] Cc: Arnaldo Carvalho de Melo Cc: Ingo Molnar Cc: Jiri Olsa Cc: Paul Mackerras Cc: Peter Zijlstra Signed-off-by: Mathias Krause --- This patch should go on top of tip.git#perf/core tools/perf/Makefile.perf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index c43a20517591..2ab8525f366b 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -250,7 +250,8 @@ ifdef ASCIIDOC8 export ASCIIDOC8 endif -LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group +LIBS = -Wl,--export-dynamic -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive +LIBS += -Wl,--start-group $(EXTLIBS) -Wl,--end-group export INSTALL SHELL_PATH -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/