[PATCH] perf tool: Fix build for NO_DWARF=1 case

From: Jiri Olsa
Date: Tue Oct 02 2012 - 09:10:59 EST


On Tue, Oct 02, 2012 at 07:39:23AM -0400, Ben Guthro wrote:
> Hi Ian,
>
> Once again - apologies for multiple copies of this email. Please reply
> to this (plain text) version so it will get through LKML filters.
>
> On Tue, Oct 2, 2012 at 12:24 AM, Ian Munsie <imunsie@xxxxxxxxxxx> wrote:
> >
> >
> > > CC arch/x86/util/dwarf-regs.o
> >
> > Is this correct? i.e. Are you building perf for x86?
>
> Yes, x86_64, specifically.
>
> >
> > What commandline are you using to build?
>
> cd /data/home/bguthro/dev/orc-newdev.git/linux/build/tools/tools/perf
> && make EXTRAVERSION=-orc
>
> >
> > Any exported environment variables that may be relevant?
>
> none that I can think of.
>
> >
> > What dev libraries does perf warn is missing (Is libdw-dev among them)?
>
> make[3]: Entering directory
> `/data/home/bguthro/dev/orc-newdev.git/linux/build/tools/tools/perf'
> Makefile:502: No libunwind found, disabling post unwind support.
> Please install libunwind-dev[el] >= 0.99
> Makefile:537: No libdw.h found or old libdw.h found or elfutils is
> older than 0.138, disables dwarf support. Please install new
> elfutils-devel/libdw-dev
> Makefile:567: No libaudit.h found, disables 'trace' tool, please
> install audit-libs-devel or libaudit-dev
> Makefile:580: newt not found, disables TUI support. Please install
> newt-devel or libnewt-dev
> Makefile:752: No bfd.h/libbfd found, install
> binutils-dev[el]/zlib-static to gain symbol demangling
>
> Actually - I hadn't noticed these warnings before.
>
> After installing libdw-dev - the perf build completed successfully.
> Perhaps this should be fatal, rather than a warning?
>
> Thanks for your help
>
> Ben

hi,
attached patch fixies the issue for me. Adding Arnaldo to the loop.

jirka


---
We need to include arch Makefile after we decide the NO_DWARF value,
otherwise we get might get build failure.

The reason is the arch Makefile could include objects based on
the NO_DWARF value, as it is for x86 case.

Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
---
tools/perf/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 6958ba4..0ca8f45 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -505,8 +505,6 @@ ifneq ($(call try-cc,$(SOURCE_LIBUNWIND),$(FLAGS_UNWIND)),y)
endif # Libunwind support
endif # NO_LIBUNWIND

--include arch/$(ARCH)/Makefile
-
ifneq ($(OUTPUT),)
BASIC_CFLAGS += -I$(OUTPUT)
endif
@@ -635,6 +633,8 @@ else
endif
endif

+-include arch/$(ARCH)/Makefile
+
disable-python = $(eval $(disable-python_code))
define disable-python_code
BASIC_CFLAGS += -DNO_LIBPYTHON
--
1.7.11.4

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