Commit a7112397 authored by Robert Morell's avatar Robert Morell Committed by Arnaldo Carvalho de Melo

perf tools: Remove hardcoded include paths for elfutils

This change removes the use of hardcoded absolute "/usr/include/elfutils" paths
from the perf build.  The problem with hardcoded paths is that it prevents them
from being overridden by $prefix or by -I in CFLAGS (e.g., for cross-compiling
purposes).

Instead, just include the "elfutils/" subdirectory as a relative path when
files are needed from that directory.

Tested by building perf:
- Cross-compiled for ARM on x86_64
- Built natively on x86_64
- Built on x86_64 with /usr/include/elfutils moved to another location
  and manually included in CFLAGS
Acked-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
LKML-Reference: <1289945793-31441-1-git-send-email-rmorell@nvidia.com>
Signed-off-by: default avatarRobert Morell <rmorell@nvidia.com>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent f5b4a9c3
...@@ -507,7 +507,7 @@ PERFLIBS = $(LIB_FILE) ...@@ -507,7 +507,7 @@ PERFLIBS = $(LIB_FILE)
-include config.mak -include config.mak
ifndef NO_DWARF ifndef NO_DWARF
FLAGS_DWARF=$(ALL_CFLAGS) -I/usr/include/elfutils -ldw -lelf $(ALL_LDFLAGS) $(EXTLIBS) FLAGS_DWARF=$(ALL_CFLAGS) -ldw -lelf $(ALL_LDFLAGS) $(EXTLIBS)
ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF)),y) ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF)),y)
msg := $(warning 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); msg := $(warning 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);
NO_DWARF := 1 NO_DWARF := 1
...@@ -554,7 +554,7 @@ ifndef NO_DWARF ...@@ -554,7 +554,7 @@ ifndef NO_DWARF
ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined) ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled); msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled);
else else
BASIC_CFLAGS += -I/usr/include/elfutils -DDWARF_SUPPORT BASIC_CFLAGS += -DDWARF_SUPPORT
EXTLIBS += -lelf -ldw EXTLIBS += -lelf -ldw
LIB_OBJS += $(OUTPUT)util/probe-finder.o LIB_OBJS += $(OUTPUT)util/probe-finder.o
endif # PERF_HAVE_DWARF_REGS endif # PERF_HAVE_DWARF_REGS
......
...@@ -9,8 +9,8 @@ endef ...@@ -9,8 +9,8 @@ endef
ifndef NO_DWARF ifndef NO_DWARF
define SOURCE_DWARF define SOURCE_DWARF
#include <dwarf.h> #include <dwarf.h>
#include <libdw.h> #include <elfutils/libdw.h>
#include <version.h> #include <elfutils/version.h>
#ifndef _ELFUTILS_PREREQ #ifndef _ELFUTILS_PREREQ
#error #error
#endif #endif
......
...@@ -34,9 +34,9 @@ extern int find_available_vars_at(int fd, struct perf_probe_event *pev, ...@@ -34,9 +34,9 @@ extern int find_available_vars_at(int fd, struct perf_probe_event *pev,
bool externs); bool externs);
#include <dwarf.h> #include <dwarf.h>
#include <libdw.h> #include <elfutils/libdw.h>
#include <libdwfl.h> #include <elfutils/libdwfl.h>
#include <version.h> #include <elfutils/version.h>
struct probe_finder { struct probe_finder {
struct perf_probe_event *pev; /* Target probe event */ struct perf_probe_event *pev; /* Target probe event */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment