* [PATCH] perf tools: Add missing -ldl for gtk build
@ 2013-09-26 18:55 Jiri Olsa
2013-09-27 2:27 ` Namhyung Kim
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: Jiri Olsa @ 2013-09-26 18:55 UTC (permalink / raw)
To: linux-kernel
Cc: Jiri Olsa, Andi Kleen, Corey Ashford, David Ahern,
Frederic Weisbecker, Ingo Molnar, Namhyung Kim, Paul Mackerras,
Peter Zijlstra, Arnaldo Carvalho de Melo
If we build perf with NO_LIBPYTHON=1 NO_LIBPERL=1 the '-ldl'
is not added to libs build fails if we have gtk2 code in,
because it depends on it.
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/config/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 6850529..8b49a00 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -272,6 +272,7 @@ ifndef NO_GTK2
CFLAGS += -DGTK2_SUPPORT
GTK_CFLAGS += $(shell pkg-config --cflags gtk+-2.0 2>/dev/null)
GTK_LIBS := $(shell pkg-config --libs gtk+-2.0 2>/dev/null)
+ EXTLIBS += -ldl
endif
endif
--
1.7.11.7
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH] perf tools: Add missing -ldl for gtk build 2013-09-26 18:55 [PATCH] perf tools: Add missing -ldl for gtk build Jiri Olsa @ 2013-09-27 2:27 ` Namhyung Kim 2013-09-27 14:32 ` [PATCH 1/3] perf tools: Separate lbfd check out of NO_DEMANGLE condition Jiri Olsa 2013-10-15 5:28 ` [tip:perf/core] perf tools: Add missing -ldl for gtk build tip-bot for Jiri Olsa 2 siblings, 0 replies; 14+ messages in thread From: Namhyung Kim @ 2013-09-27 2:27 UTC (permalink / raw) To: Jiri Olsa Cc: linux-kernel, Andi Kleen, Corey Ashford, David Ahern, Frederic Weisbecker, Ingo Molnar, Paul Mackerras, Peter Zijlstra, Arnaldo Carvalho de Melo On Thu, 26 Sep 2013 20:55:54 +0200, Jiri Olsa wrote: > If we build perf with NO_LIBPYTHON=1 NO_LIBPERL=1 the '-ldl' > is not added to libs build fails if we have gtk2 code in, > because it depends on it. Argh... Thanks for fixing this! Acked-by: Namhyung Kim <namhyung@kernel.org> Thanks, Namhyung ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 1/3] perf tools: Separate lbfd check out of NO_DEMANGLE condition 2013-09-26 18:55 [PATCH] perf tools: Add missing -ldl for gtk build Jiri Olsa 2013-09-27 2:27 ` Namhyung Kim @ 2013-09-27 14:32 ` Jiri Olsa 2013-09-27 14:32 ` [PATCH 2/3] perf tools: Adding missing ifdef for cmd_trace call Jiri Olsa ` (2 more replies) 2013-10-15 5:28 ` [tip:perf/core] perf tools: Add missing -ldl for gtk build tip-bot for Jiri Olsa 2 siblings, 3 replies; 14+ messages in thread From: Jiri Olsa @ 2013-09-27 14:32 UTC (permalink / raw) To: linux-kernel Cc: Jiri Olsa, Corey Ashford, Ingo Molnar, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Arnaldo Carvalho de Melo, David Ahern We fail build with NO_DEMANGLE with missing -lbfd externals error. The reason is that we now use bfd code in srcline object: perf tools: Implement addr2line directly using libbfd So we need to check/add -lbfd always now. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: David Ahern <dsahern@gmail.com> --- tools/perf/config/Makefile | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index 8b49a00..40a41c6 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile @@ -360,6 +360,13 @@ else endif endif +FLAGS_BFD=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -lbfd +has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD),libbfd) +ifeq ($(has_bfd),y) + EXTLIBS += -lbfd + CFLAGS += -DLIBBFD_SUPPORT +endif + ifdef NO_DEMANGLE CFLAGS += -DNO_DEMANGLE else @@ -367,11 +374,7 @@ else EXTLIBS += -liberty CFLAGS += -DHAVE_CPLUS_DEMANGLE else - FLAGS_BFD=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -lbfd - has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD),libbfd) - ifeq ($(has_bfd),y) - EXTLIBS += -lbfd - else + ifneq ($(has_bfd),y) FLAGS_BFD_IBERTY=$(FLAGS_BFD) -liberty has_bfd_iberty := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY),liberty) ifeq ($(has_bfd_iberty),y) @@ -397,10 +400,6 @@ else endif endif -ifndef ($(filter -lbfd,$(EXTLIBS)),) - CFLAGS += -DLIBBFD_SUPPORT -endif - ifndef NO_STRLCPY ifeq ($(call try-cc,$(SOURCE_STRLCPY),,-DHAVE_STRLCPY),y) CFLAGS += -DHAVE_STRLCPY -- 1.7.11.7 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 2/3] perf tools: Adding missing ifdef for cmd_trace call 2013-09-27 14:32 ` [PATCH 1/3] perf tools: Separate lbfd check out of NO_DEMANGLE condition Jiri Olsa @ 2013-09-27 14:32 ` Jiri Olsa 2013-09-27 14:32 ` [BUG/RFC 3/3] perf tools: Add missing GTK2_SUPPORT ifdefs Jiri Olsa 2013-09-29 6:52 ` [PATCH 1/3] perf tools: Separate lbfd check out of NO_DEMANGLE condition Namhyung Kim 2 siblings, 0 replies; 14+ messages in thread From: Jiri Olsa @ 2013-09-27 14:32 UTC (permalink / raw) To: linux-kernel Cc: Jiri Olsa, Corey Ashford, Ingo Molnar, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Arnaldo Carvalho de Melo, David Ahern We're missing ifdef LIBAUDIT_SUPPORT condition check for calling cmd_trace, otherwise the NO_LIBAUDIT=1 build fails. Introduced by commit: perf trace: Add 'trace' alias to 'perf trace' Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: David Ahern <dsahern@gmail.com> --- tools/perf/perf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/perf/perf.c b/tools/perf/perf.c index 48d3be6..d8460fe 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c @@ -482,12 +482,14 @@ int main(int argc, const char **argv) goto out; } +#ifdef LIBAUDIT_SUPPORT if (!prefixcmp(cmd, "trace")) { set_buildid_dir(); setup_path(); argv[0] = "trace"; return cmd_trace(argc, argv, NULL); } +#endif /* Look for flags.. */ argv++; -- 1.7.11.7 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [BUG/RFC 3/3] perf tools: Add missing GTK2_SUPPORT ifdefs 2013-09-27 14:32 ` [PATCH 1/3] perf tools: Separate lbfd check out of NO_DEMANGLE condition Jiri Olsa 2013-09-27 14:32 ` [PATCH 2/3] perf tools: Adding missing ifdef for cmd_trace call Jiri Olsa @ 2013-09-27 14:32 ` Jiri Olsa 2013-09-27 18:54 ` Arnaldo Carvalho de Melo 2013-09-29 6:52 ` [PATCH 1/3] perf tools: Separate lbfd check out of NO_DEMANGLE condition Namhyung Kim 2 siblings, 1 reply; 14+ messages in thread From: Jiri Olsa @ 2013-09-27 14:32 UTC (permalink / raw) To: linux-kernel Cc: Jiri Olsa, Corey Ashford, Ingo Molnar, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Arnaldo Carvalho de Melo, David Ahern When building minimal perf via: NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 We dont link -ldl and that's causing error for gtk2 related code, which is disabled on command line (NO_GTK2), but not in the code (GTK2_SUPPORT). We probably need some global fix/change for this browser enabled/disable code. Tested just by building it corretly. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: David Ahern <dsahern@gmail.com> --- tools/perf/builtin-annotate.c | 6 ++++++ tools/perf/builtin-report.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 577c3a1..ddde407 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -142,6 +142,7 @@ find_next: } if (use_browser == 2) { +#ifdef GTK2_SUPPORT int ret; int (*annotate)(struct hist_entry *he, struct perf_evsel *evsel, @@ -161,6 +162,9 @@ find_next: /* skip missing symbols */ nd = rb_next(nd); } else if (use_browser == 1) { +#else + use_browser = 1; +#endif key = hist_entry__tui_annotate(he, evsel, NULL); switch (key) { case -1: @@ -258,6 +262,7 @@ static int __cmd_annotate(struct perf_annotate *ann) goto out_delete; } +#ifdef GTK2_SUPPORT if (use_browser == 2) { void (*show_annotations)(void); @@ -269,6 +274,7 @@ static int __cmd_annotate(struct perf_annotate *ann) } show_annotations(); } +#endif out_delete: /* diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 295025e..c902229 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -591,6 +591,7 @@ static int __cmd_report(struct perf_report *rep) ret = 0; } else if (use_browser == 2) { +#ifdef GTK2_SUPPORT int (*hist_browser)(struct perf_evlist *, const char *, struct hist_browser_timer *, @@ -604,6 +605,7 @@ static int __cmd_report(struct perf_report *rep) } hist_browser(session->evlist, help, NULL, rep->min_percent); +#endif } } else perf_evlist__tty_browse_hists(session->evlist, rep, help); -- 1.7.11.7 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [BUG/RFC 3/3] perf tools: Add missing GTK2_SUPPORT ifdefs 2013-09-27 14:32 ` [BUG/RFC 3/3] perf tools: Add missing GTK2_SUPPORT ifdefs Jiri Olsa @ 2013-09-27 18:54 ` Arnaldo Carvalho de Melo 2013-09-29 6:54 ` Namhyung Kim 0 siblings, 1 reply; 14+ messages in thread From: Arnaldo Carvalho de Melo @ 2013-09-27 18:54 UTC (permalink / raw) To: Jiri Olsa Cc: linux-kernel, Corey Ashford, Ingo Molnar, Namhyung Kim, Paul Mackerras, Peter Zijlstra, David Ahern Em Fri, Sep 27, 2013 at 04:32:12PM +0200, Jiri Olsa escreveu: > When building minimal perf via: > NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 > NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 > NO_LIBBIONIC=1 > > We dont link -ldl and that's causing error for gtk2 related code, > which is disabled on command line (NO_GTK2), but not in the code > (GTK2_SUPPORT). > > We probably need some global fix/change for this browser > enabled/disable code. But for now what you did is enough, since the only module that uses the dl mechanism is the GTK+ one, so I'm applying it. I should have detected this before pushing out perf/core with the changes that introduced this problem, that is what: make -C tools/perf -f tests/make was made to catch, my bad, Namhyung, please use those tests next time too :-) > Tested just by building it corretly. Yeah, now tests/make completes without problems. Thanks, - Arnaldo > Signed-off-by: Jiri Olsa <jolsa@redhat.com> > Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> > Cc: Ingo Molnar <mingo@elte.hu> > Cc: Namhyung Kim <namhyung@kernel.org> > Cc: Paul Mackerras <paulus@samba.org> > Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> > Cc: Arnaldo Carvalho de Melo <acme@redhat.com> > Cc: David Ahern <dsahern@gmail.com> > --- > tools/perf/builtin-annotate.c | 6 ++++++ > tools/perf/builtin-report.c | 2 ++ > 2 files changed, 8 insertions(+) > > diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c > index 577c3a1..ddde407 100644 > --- a/tools/perf/builtin-annotate.c > +++ b/tools/perf/builtin-annotate.c > @@ -142,6 +142,7 @@ find_next: > } > > if (use_browser == 2) { > +#ifdef GTK2_SUPPORT > int ret; > int (*annotate)(struct hist_entry *he, > struct perf_evsel *evsel, > @@ -161,6 +162,9 @@ find_next: > /* skip missing symbols */ > nd = rb_next(nd); > } else if (use_browser == 1) { > +#else > + use_browser = 1; > +#endif > key = hist_entry__tui_annotate(he, evsel, NULL); > switch (key) { > case -1: > @@ -258,6 +262,7 @@ static int __cmd_annotate(struct perf_annotate *ann) > goto out_delete; > } > > +#ifdef GTK2_SUPPORT > if (use_browser == 2) { > void (*show_annotations)(void); > > @@ -269,6 +274,7 @@ static int __cmd_annotate(struct perf_annotate *ann) > } > show_annotations(); > } > +#endif > > out_delete: > /* > diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c > index 295025e..c902229 100644 > --- a/tools/perf/builtin-report.c > +++ b/tools/perf/builtin-report.c > @@ -591,6 +591,7 @@ static int __cmd_report(struct perf_report *rep) > ret = 0; > > } else if (use_browser == 2) { > +#ifdef GTK2_SUPPORT > int (*hist_browser)(struct perf_evlist *, > const char *, > struct hist_browser_timer *, > @@ -604,6 +605,7 @@ static int __cmd_report(struct perf_report *rep) > } > hist_browser(session->evlist, help, NULL, > rep->min_percent); > +#endif > } > } else > perf_evlist__tty_browse_hists(session->evlist, rep, help); > -- > 1.7.11.7 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [BUG/RFC 3/3] perf tools: Add missing GTK2_SUPPORT ifdefs 2013-09-27 18:54 ` Arnaldo Carvalho de Melo @ 2013-09-29 6:54 ` Namhyung Kim 0 siblings, 0 replies; 14+ messages in thread From: Namhyung Kim @ 2013-09-29 6:54 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Jiri Olsa, linux-kernel, Corey Ashford, Ingo Molnar, Paul Mackerras, Peter Zijlstra, David Ahern Hi Arnaldo, 2013-09-27 (금), 15:54 -0300, Arnaldo Carvalho de Melo: > Em Fri, Sep 27, 2013 at 04:32:12PM +0200, Jiri Olsa escreveu: > > When building minimal perf via: > > NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 > > NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 > > NO_LIBBIONIC=1 > > > > We dont link -ldl and that's causing error for gtk2 related code, > > which is disabled on command line (NO_GTK2), but not in the code > > (GTK2_SUPPORT). > > > > We probably need some global fix/change for this browser > > enabled/disable code. > > But for now what you did is enough, since the only module that uses > the dl mechanism is the GTK+ one, so I'm applying it. > > I should have detected this before pushing out perf/core with the > changes that introduced this problem, that is what: > > make -C tools/perf -f tests/make > > was made to catch, my bad, Namhyung, please use those tests next time > too :-) I almost forgot about that, sorry. Will do the tests next time. Thanks, Namhyung ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/3] perf tools: Separate lbfd check out of NO_DEMANGLE condition 2013-09-27 14:32 ` [PATCH 1/3] perf tools: Separate lbfd check out of NO_DEMANGLE condition Jiri Olsa 2013-09-27 14:32 ` [PATCH 2/3] perf tools: Adding missing ifdef for cmd_trace call Jiri Olsa 2013-09-27 14:32 ` [BUG/RFC 3/3] perf tools: Add missing GTK2_SUPPORT ifdefs Jiri Olsa @ 2013-09-29 6:52 ` Namhyung Kim 2013-09-30 3:13 ` Jiri Olsa 2013-10-02 1:18 ` Namhyung Kim 2 siblings, 2 replies; 14+ messages in thread From: Namhyung Kim @ 2013-09-29 6:52 UTC (permalink / raw) To: Jiri Olsa Cc: linux-kernel, Corey Ashford, Ingo Molnar, Paul Mackerras, Peter Zijlstra, Arnaldo Carvalho de Melo, David Ahern Hi Jiri, 2013-09-27 (금), 16:32 +0200, Jiri Olsa: > We fail build with NO_DEMANGLE with missing -lbfd externals error. > The reason is that we now use bfd code in srcline object: > perf tools: Implement addr2line directly using libbfd > > So we need to check/add -lbfd always now. > > Signed-off-by: Jiri Olsa <jolsa@redhat.com> > Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> > Cc: Ingo Molnar <mingo@elte.hu> > Cc: Namhyung Kim <namhyung@kernel.org> > Cc: Paul Mackerras <paulus@samba.org> > Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> > Cc: Arnaldo Carvalho de Melo <acme@redhat.com> > Cc: David Ahern <dsahern@gmail.com> > --- > tools/perf/config/Makefile | 17 ++++++++--------- > 1 file changed, 8 insertions(+), 9 deletions(-) > > diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile > index 8b49a00..40a41c6 100644 > --- a/tools/perf/config/Makefile > +++ b/tools/perf/config/Makefile > @@ -360,6 +360,13 @@ else > endif > endif > > +FLAGS_BFD=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -lbfd > +has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD),libbfd) > +ifeq ($(has_bfd),y) > + EXTLIBS += -lbfd > + CFLAGS += -DLIBBFD_SUPPORT > +endif > + > ifdef NO_DEMANGLE > CFLAGS += -DNO_DEMANGLE > else > @@ -367,11 +374,7 @@ else > EXTLIBS += -liberty > CFLAGS += -DHAVE_CPLUS_DEMANGLE > else > - FLAGS_BFD=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -lbfd > - has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD),libbfd) > - ifeq ($(has_bfd),y) > - EXTLIBS += -lbfd > - else > + ifneq ($(has_bfd),y) > FLAGS_BFD_IBERTY=$(FLAGS_BFD) -liberty > has_bfd_iberty := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY),liberty) > ifeq ($(has_bfd_iberty),y) > @@ -397,10 +400,6 @@ else > endif > endif > > -ifndef ($(filter -lbfd,$(EXTLIBS)),) > - CFLAGS += -DLIBBFD_SUPPORT > -endif > - > ifndef NO_STRLCPY > ifeq ($(call try-cc,$(SOURCE_STRLCPY),,-DHAVE_STRLCPY),y) > CFLAGS += -DHAVE_STRLCPY Is it enough to check on -lbfd only? I guess libbfd can have additional dependencies to libiberty and libz. If so, this patch can fail to set -DLIBBFD_SUPPORT, right? Thanks, Namhyung ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/3] perf tools: Separate lbfd check out of NO_DEMANGLE condition 2013-09-29 6:52 ` [PATCH 1/3] perf tools: Separate lbfd check out of NO_DEMANGLE condition Namhyung Kim @ 2013-09-30 3:13 ` Jiri Olsa 2013-10-02 1:18 ` Namhyung Kim 1 sibling, 0 replies; 14+ messages in thread From: Jiri Olsa @ 2013-09-30 3:13 UTC (permalink / raw) To: Namhyung Kim Cc: linux-kernel, Corey Ashford, Ingo Molnar, Paul Mackerras, Peter Zijlstra, Arnaldo Carvalho de Melo, David Ahern On Sun, Sep 29, 2013 at 03:52:06PM +0900, Namhyung Kim wrote: > Hi Jiri, > > 2013-09-27 (금), 16:32 +0200, Jiri Olsa: > > We fail build with NO_DEMANGLE with missing -lbfd externals error. > > The reason is that we now use bfd code in srcline object: > > perf tools: Implement addr2line directly using libbfd > > > > So we need to check/add -lbfd always now. > > > > Signed-off-by: Jiri Olsa <jolsa@redhat.com> > > Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> > > Cc: Ingo Molnar <mingo@elte.hu> > > Cc: Namhyung Kim <namhyung@kernel.org> > > Cc: Paul Mackerras <paulus@samba.org> > > Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> > > Cc: Arnaldo Carvalho de Melo <acme@redhat.com> > > Cc: David Ahern <dsahern@gmail.com> > > --- > > tools/perf/config/Makefile | 17 ++++++++--------- > > 1 file changed, 8 insertions(+), 9 deletions(-) > > > > diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile > > index 8b49a00..40a41c6 100644 > > --- a/tools/perf/config/Makefile > > +++ b/tools/perf/config/Makefile > > @@ -360,6 +360,13 @@ else > > endif > > endif > > > > +FLAGS_BFD=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -lbfd > > +has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD),libbfd) > > +ifeq ($(has_bfd),y) > > + EXTLIBS += -lbfd > > + CFLAGS += -DLIBBFD_SUPPORT > > +endif > > + > > ifdef NO_DEMANGLE > > CFLAGS += -DNO_DEMANGLE > > else > > @@ -367,11 +374,7 @@ else > > EXTLIBS += -liberty > > CFLAGS += -DHAVE_CPLUS_DEMANGLE > > else > > - FLAGS_BFD=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -lbfd > > - has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD),libbfd) > > - ifeq ($(has_bfd),y) > > - EXTLIBS += -lbfd > > - else > > + ifneq ($(has_bfd),y) > > FLAGS_BFD_IBERTY=$(FLAGS_BFD) -liberty > > has_bfd_iberty := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY),liberty) > > ifeq ($(has_bfd_iberty),y) > > @@ -397,10 +400,6 @@ else > > endif > > endif > > > > -ifndef ($(filter -lbfd,$(EXTLIBS)),) > > - CFLAGS += -DLIBBFD_SUPPORT > > -endif > > - > > ifndef NO_STRLCPY > > ifeq ($(call try-cc,$(SOURCE_STRLCPY),,-DHAVE_STRLCPY),y) > > CFLAGS += -DHAVE_STRLCPY > > Is it enough to check on -lbfd only? I guess libbfd can have additional > dependencies to libiberty and libz. If so, this patch can fail to set > -DLIBBFD_SUPPORT, right? hum, you're right.. so it's 2 bugs fixed by removing that code ;-) jirka ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/3] perf tools: Separate lbfd check out of NO_DEMANGLE condition 2013-09-29 6:52 ` [PATCH 1/3] perf tools: Separate lbfd check out of NO_DEMANGLE condition Namhyung Kim 2013-09-30 3:13 ` Jiri Olsa @ 2013-10-02 1:18 ` Namhyung Kim 2013-10-02 8:17 ` Jiri Olsa 1 sibling, 1 reply; 14+ messages in thread From: Namhyung Kim @ 2013-10-02 1:18 UTC (permalink / raw) To: Jiri Olsa Cc: linux-kernel, Corey Ashford, Ingo Molnar, Paul Mackerras, Peter Zijlstra, Arnaldo Carvalho de Melo, David Ahern Hi Jiri, On Sun, 29 Sep 2013 15:52:06 +0900, Namhyung Kim wrote: > Hi Jiri, > > 2013-09-27 (금), 16:32 +0200, Jiri Olsa: >> We fail build with NO_DEMANGLE with missing -lbfd externals error. >> The reason is that we now use bfd code in srcline object: >> perf tools: Implement addr2line directly using libbfd >> >> So we need to check/add -lbfd always now. >> >> Signed-off-by: Jiri Olsa <jolsa@redhat.com> >> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> >> Cc: Ingo Molnar <mingo@elte.hu> >> Cc: Namhyung Kim <namhyung@kernel.org> >> Cc: Paul Mackerras <paulus@samba.org> >> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> >> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> >> Cc: David Ahern <dsahern@gmail.com> >> --- >> tools/perf/config/Makefile | 17 ++++++++--------- >> 1 file changed, 8 insertions(+), 9 deletions(-) >> >> diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile >> index 8b49a00..40a41c6 100644 >> --- a/tools/perf/config/Makefile >> +++ b/tools/perf/config/Makefile >> @@ -360,6 +360,13 @@ else >> endif >> endif >> >> +FLAGS_BFD=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -lbfd >> +has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD),libbfd) >> +ifeq ($(has_bfd),y) >> + EXTLIBS += -lbfd >> + CFLAGS += -DLIBBFD_SUPPORT >> +endif >> + >> ifdef NO_DEMANGLE >> CFLAGS += -DNO_DEMANGLE >> else >> @@ -367,11 +374,7 @@ else >> EXTLIBS += -liberty >> CFLAGS += -DHAVE_CPLUS_DEMANGLE >> else >> - FLAGS_BFD=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -lbfd >> - has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD),libbfd) >> - ifeq ($(has_bfd),y) >> - EXTLIBS += -lbfd >> - else >> + ifneq ($(has_bfd),y) >> FLAGS_BFD_IBERTY=$(FLAGS_BFD) -liberty >> has_bfd_iberty := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY),liberty) >> ifeq ($(has_bfd_iberty),y) >> @@ -397,10 +400,6 @@ else >> endif >> endif >> >> -ifndef ($(filter -lbfd,$(EXTLIBS)),) >> - CFLAGS += -DLIBBFD_SUPPORT >> -endif >> - >> ifndef NO_STRLCPY >> ifeq ($(call try-cc,$(SOURCE_STRLCPY),,-DHAVE_STRLCPY),y) >> CFLAGS += -DHAVE_STRLCPY > > Is it enough to check on -lbfd only? I guess libbfd can have additional > dependencies to libiberty and libz. If so, this patch can fail to set > -DLIBBFD_SUPPORT, right? I tested this on my system. At first I guessed (without testing) it cannot build SOURCE_BFD with -lbfd only due to additional -liberty and -lz dependency, but it's not. Actually the libfd.so is a plain text file which contains linker script like this: $ file /lib64/libbfd.so /lib64/libbfd.so: ASCII text $ cat /lib64/libbfd.so /* GNU ld script */ /* Ensure this .so library will not be used by a link for a different format on a multi-architecture system. */ OUTPUT_FORMAT(elf64-x86-64) /* The libz dependency is unexpected by legacy build scripts. */ INPUT ( /usr/lib64/libbfd.a -liberty -lz ) So it should handle external dependencies. But it doesn't. $ cat bfd.c #include <bfd.h> int main(void) { bfd_demangle(0, 0, 0); return 0; } namhyung@sejong:tmp$ gcc bfd.c -lbfd /usr/lib64/libbfd.a(plugin.o): In function `try_load_plugin': (.text+0x1ab): undefined reference to `dlopen' /usr/lib64/libbfd.a(plugin.o): In function `try_load_plugin': (.text+0x1ca): undefined reference to `dlsym' /usr/lib64/libbfd.a(plugin.o): In function `try_load_plugin': (.text+0x263): undefined reference to `dlerror' collect2: error: ld returned 1 exit status It seems that it needs libdl for loading plugins. Adding -ldl makes above build successfully. So we need to add -ldl for EXTLIBS IMHO. Without it, make NO_GTK2=1 NO_LIBPERL=1 NO_LIBPYTHON=1 will fail to check libbfd correctly (FYI, libperl and libpython add -ldl to the dependency list). Thanks, Namhyung ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/3] perf tools: Separate lbfd check out of NO_DEMANGLE condition 2013-10-02 1:18 ` Namhyung Kim @ 2013-10-02 8:17 ` Jiri Olsa 2013-10-02 8:38 ` Namhyung Kim 0 siblings, 1 reply; 14+ messages in thread From: Jiri Olsa @ 2013-10-02 8:17 UTC (permalink / raw) To: Namhyung Kim Cc: linux-kernel, Corey Ashford, Ingo Molnar, Paul Mackerras, Peter Zijlstra, Arnaldo Carvalho de Melo, David Ahern On Wed, Oct 02, 2013 at 10:18:32AM +0900, Namhyung Kim wrote: > Hi Jiri, > > On Sun, 29 Sep 2013 15:52:06 +0900, Namhyung Kim wrote: > > Hi Jiri, > > > > 2013-09-27 (금), 16:32 +0200, Jiri Olsa: > >> We fail build with NO_DEMANGLE with missing -lbfd externals error. > >> The reason is that we now use bfd code in srcline object: > >> perf tools: Implement addr2line directly using libbfd > >> > >> So we need to check/add -lbfd always now. > >> > >> Signed-off-by: Jiri Olsa <jolsa@redhat.com> > >> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> > >> Cc: Ingo Molnar <mingo@elte.hu> > >> Cc: Namhyung Kim <namhyung@kernel.org> > >> Cc: Paul Mackerras <paulus@samba.org> > >> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> > >> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> > >> Cc: David Ahern <dsahern@gmail.com> > >> --- > >> tools/perf/config/Makefile | 17 ++++++++--------- > >> 1 file changed, 8 insertions(+), 9 deletions(-) > >> > >> diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile > >> index 8b49a00..40a41c6 100644 > >> --- a/tools/perf/config/Makefile > >> +++ b/tools/perf/config/Makefile > >> @@ -360,6 +360,13 @@ else > >> endif > >> endif > >> > >> +FLAGS_BFD=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -lbfd > >> +has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD),libbfd) > >> +ifeq ($(has_bfd),y) > >> + EXTLIBS += -lbfd > >> + CFLAGS += -DLIBBFD_SUPPORT > >> +endif > >> + > >> ifdef NO_DEMANGLE > >> CFLAGS += -DNO_DEMANGLE > >> else > >> @@ -367,11 +374,7 @@ else > >> EXTLIBS += -liberty > >> CFLAGS += -DHAVE_CPLUS_DEMANGLE > >> else > >> - FLAGS_BFD=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -lbfd > >> - has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD),libbfd) > >> - ifeq ($(has_bfd),y) > >> - EXTLIBS += -lbfd > >> - else > >> + ifneq ($(has_bfd),y) > >> FLAGS_BFD_IBERTY=$(FLAGS_BFD) -liberty > >> has_bfd_iberty := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY),liberty) > >> ifeq ($(has_bfd_iberty),y) > >> @@ -397,10 +400,6 @@ else > >> endif > >> endif > >> > >> -ifndef ($(filter -lbfd,$(EXTLIBS)),) > >> - CFLAGS += -DLIBBFD_SUPPORT > >> -endif > >> - > >> ifndef NO_STRLCPY > >> ifeq ($(call try-cc,$(SOURCE_STRLCPY),,-DHAVE_STRLCPY),y) > >> CFLAGS += -DHAVE_STRLCPY > > > > Is it enough to check on -lbfd only? I guess libbfd can have additional > > dependencies to libiberty and libz. If so, this patch can fail to set > > -DLIBBFD_SUPPORT, right? > > I tested this on my system. At first I guessed (without testing) it > cannot build SOURCE_BFD with -lbfd only due to additional -liberty and > -lz dependency, but it's not. Actually the libfd.so is a plain text > file which contains linker script like this: > > $ file /lib64/libbfd.so > /lib64/libbfd.so: ASCII text > > $ cat /lib64/libbfd.so > /* GNU ld script */ > > /* Ensure this .so library will not be used by a link for a different format > on a multi-architecture system. */ > OUTPUT_FORMAT(elf64-x86-64) > > /* The libz dependency is unexpected by legacy build scripts. */ > INPUT ( /usr/lib64/libbfd.a -liberty -lz ) > > > So it should handle external dependencies. But it doesn't. > > $ cat bfd.c > #include <bfd.h> > > int main(void) > { > bfd_demangle(0, 0, 0); > return 0; > } > > namhyung@sejong:tmp$ gcc bfd.c -lbfd > /usr/lib64/libbfd.a(plugin.o): In function `try_load_plugin': > (.text+0x1ab): undefined reference to `dlopen' > /usr/lib64/libbfd.a(plugin.o): In function `try_load_plugin': > (.text+0x1ca): undefined reference to `dlsym' > /usr/lib64/libbfd.a(plugin.o): In function `try_load_plugin': > (.text+0x263): undefined reference to `dlerror' > collect2: error: ld returned 1 exit status > > > It seems that it needs libdl for loading plugins. Adding -ldl makes > above build successfully. So we need to add -ldl for EXTLIBS IMHO. > Without it, make NO_GTK2=1 NO_LIBPERL=1 NO_LIBPYTHON=1 will fail to > check libbfd correctly (FYI, libperl and libpython add -ldl to the > dependency list). hum, so on my system -liberty check wins without -lbfd, so 'NO_GTK2=1 NO_LIBPERL=1 NO_LIBPYTHON=1' passes I need to check Ingo's latest changes on this, not sure how if this problem is relevant any longer ;-) jirka ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/3] perf tools: Separate lbfd check out of NO_DEMANGLE condition 2013-10-02 8:17 ` Jiri Olsa @ 2013-10-02 8:38 ` Namhyung Kim 2013-10-02 10:08 ` Ingo Molnar 0 siblings, 1 reply; 14+ messages in thread From: Namhyung Kim @ 2013-10-02 8:38 UTC (permalink / raw) To: Jiri Olsa Cc: linux-kernel, Corey Ashford, Ingo Molnar, Paul Mackerras, Peter Zijlstra, Arnaldo Carvalho de Melo, David Ahern Hi Jiri, On Wed, 2 Oct 2013 10:17:57 +0200, Jiri Olsa wrote: > On Wed, Oct 02, 2013 at 10:18:32AM +0900, Namhyung Kim wrote: >> It seems that it needs libdl for loading plugins. Adding -ldl makes >> above build successfully. So we need to add -ldl for EXTLIBS IMHO. >> Without it, make NO_GTK2=1 NO_LIBPERL=1 NO_LIBPYTHON=1 will fail to >> check libbfd correctly (FYI, libperl and libpython add -ldl to the >> dependency list). > > hum, so on my system -liberty check wins without -lbfd, > so 'NO_GTK2=1 NO_LIBPERL=1 NO_LIBPYTHON=1' passes > > I need to check Ingo's latest changes on this, not sure how > if this problem is relevant any longer ;-) AFAICS, Ingo's patch does "-lbfd -ldl" rather than "-lbfd". So probably there's no problem then. :) Thanks, Namhyung ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/3] perf tools: Separate lbfd check out of NO_DEMANGLE condition 2013-10-02 8:38 ` Namhyung Kim @ 2013-10-02 10:08 ` Ingo Molnar 0 siblings, 0 replies; 14+ messages in thread From: Ingo Molnar @ 2013-10-02 10:08 UTC (permalink / raw) To: Namhyung Kim Cc: Jiri Olsa, linux-kernel, Corey Ashford, Ingo Molnar, Paul Mackerras, Peter Zijlstra, Arnaldo Carvalho de Melo, David Ahern * Namhyung Kim <namhyung@kernel.org> wrote: > Hi Jiri, > > On Wed, 2 Oct 2013 10:17:57 +0200, Jiri Olsa wrote: > > On Wed, Oct 02, 2013 at 10:18:32AM +0900, Namhyung Kim wrote: > >> It seems that it needs libdl for loading plugins. Adding -ldl makes > >> above build successfully. So we need to add -ldl for EXTLIBS IMHO. > >> Without it, make NO_GTK2=1 NO_LIBPERL=1 NO_LIBPYTHON=1 will fail to > >> check libbfd correctly (FYI, libperl and libpython add -ldl to the > >> dependency list). > > > > hum, so on my system -liberty check wins without -lbfd, so 'NO_GTK2=1 > > NO_LIBPERL=1 NO_LIBPYTHON=1' passes > > > > I need to check Ingo's latest changes on this, not sure how if this > > problem is relevant any longer ;-) > > AFAICS, Ingo's patch does "-lbfd -ldl" rather than "-lbfd". So probably > there's no problem then. :) I didn't fully demangle the maze of demangler feature tests yet :-) I added a single testcase, the rest is still detected using the old method. Any assymetry in detection is probably a bug in my patches. If that nested series of conditions is really necessary then we can add separate testcases for each, the same file built with different linker flags. Thanks, Ingo ^ permalink raw reply [flat|nested] 14+ messages in thread
* [tip:perf/core] perf tools: Add missing -ldl for gtk build 2013-09-26 18:55 [PATCH] perf tools: Add missing -ldl for gtk build Jiri Olsa 2013-09-27 2:27 ` Namhyung Kim 2013-09-27 14:32 ` [PATCH 1/3] perf tools: Separate lbfd check out of NO_DEMANGLE condition Jiri Olsa @ 2013-10-15 5:28 ` tip-bot for Jiri Olsa 2 siblings, 0 replies; 14+ messages in thread From: tip-bot for Jiri Olsa @ 2013-10-15 5:28 UTC (permalink / raw) To: linux-tip-commits Cc: acme, linux-kernel, paulus, hpa, mingo, a.p.zijlstra, namhyung, jolsa, fweisbec, ak, dsahern, tglx, cjashfor, mingo Commit-ID: e2137086be7bc52893a790292635cfafc475b693 Gitweb: http://git.kernel.org/tip/e2137086be7bc52893a790292635cfafc475b693 Author: Jiri Olsa <jolsa@redhat.com> AuthorDate: Thu, 26 Sep 2013 20:55:54 +0200 Committer: Arnaldo Carvalho de Melo <acme@redhat.com> CommitDate: Fri, 11 Oct 2013 12:17:29 -0300 perf tools: Add missing -ldl for gtk build If we build perf with NO_LIBPYTHON=1 NO_LIBPERL=1 the '-ldl' is not added to libs build fails if we have gtk2 code in, because it depends on it. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Andi Kleen <ak@linux.intel.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1380221754-29865-1-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/config/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index cf6ad5d..29ad7d6 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile @@ -382,6 +382,7 @@ ifndef NO_GTK2 CFLAGS += -DHAVE_GTK2_SUPPORT GTK_CFLAGS += $(shell pkg-config --cflags gtk+-2.0 2>/dev/null) GTK_LIBS := $(shell pkg-config --libs gtk+-2.0 2>/dev/null) + EXTLIBS += -ldl endif endif ^ permalink raw reply related [flat|nested] 14+ messages in thread
end of thread, other threads:[~2013-10-15 5:41 UTC | newest] Thread overview: 14+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-09-26 18:55 [PATCH] perf tools: Add missing -ldl for gtk build Jiri Olsa 2013-09-27 2:27 ` Namhyung Kim 2013-09-27 14:32 ` [PATCH 1/3] perf tools: Separate lbfd check out of NO_DEMANGLE condition Jiri Olsa 2013-09-27 14:32 ` [PATCH 2/3] perf tools: Adding missing ifdef for cmd_trace call Jiri Olsa 2013-09-27 14:32 ` [BUG/RFC 3/3] perf tools: Add missing GTK2_SUPPORT ifdefs Jiri Olsa 2013-09-27 18:54 ` Arnaldo Carvalho de Melo 2013-09-29 6:54 ` Namhyung Kim 2013-09-29 6:52 ` [PATCH 1/3] perf tools: Separate lbfd check out of NO_DEMANGLE condition Namhyung Kim 2013-09-30 3:13 ` Jiri Olsa 2013-10-02 1:18 ` Namhyung Kim 2013-10-02 8:17 ` Jiri Olsa 2013-10-02 8:38 ` Namhyung Kim 2013-10-02 10:08 ` Ingo Molnar 2013-10-15 5:28 ` [tip:perf/core] perf tools: Add missing -ldl for gtk build tip-bot for Jiri Olsa
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox