From 84087126d50400789b44459cfc45721778e6ebb0 Mon Sep 17 00:00:00 2001 From: Marti Raudsepp Date: Sat, 24 Oct 2009 19:10:36 +0300 Subject: perf tools: Fix compatibility with libelf 0.8 and autodetect The Makefile now automatically defines LIBELF_NO_MMAP when libelf 0.8.x is detected. libelf 0.8 is still maintained and some distributions such as Arch Linux use it instead of elfutils. Signed-off-by: Marti Raudsepp Cc: Lucas De Marchi Cc: Peter Zijlstra Cc: Paul Mackerras Cc: Frederic Weisbecker Cc: Arnaldo Carvalho de Melo Cc: Arjan van de Ven Cc: Mike Galbraith LKML-Reference: <1256400636.3007.16.camel@newn> Signed-off-by: Ingo Molnar --- tools/perf/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tools/perf/Makefile') diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 742a32e..46e877b 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile @@ -422,7 +422,11 @@ ifeq ($(uname_S),Darwin) PTHREAD_LIBS = endif -ifneq ($(shell sh -c "(echo '\#include '; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y) +ifeq ($(shell sh -c "(echo '\#include '; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y) + ifneq ($(shell sh -c "(echo '\#include '; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y) + BASIC_CFLAGS += -DLIBELF_NO_MMAP + endif +else msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel and glibc-dev[el]); endif -- cgit v1.1 From ec29b8d2af01912bb79adda8aeab4293539f29ac Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Mon, 26 Oct 2009 14:40:01 +0900 Subject: perf tools: Remove -Wcast-align The present use of -Wcast-align causes the build to blow up on SH due to generating a "cast increases required alignment of target type" error on each invocation of list_for_each_entry(). It seems that this was previously reported and killed off in the ia64 support patch, but nothing seems to have happened with that. Presumably the same problem still remains there, too. Signed-off-by: Paul Mundt LKML-Reference: <20091026054000.GA13517@linux-sh.org> Signed-off-by: Ingo Molnar --- tools/perf/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tools/perf/Makefile') diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 46e877b..7e190d5 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile @@ -177,8 +177,7 @@ endif # Include saner warnings here, which can catch bugs: # -EXTRA_WARNINGS := -Wcast-align -EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat +EXTRA_WARNINGS := -Wformat EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-security EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-y2k EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wshadow -- cgit v1.1