From f8e5d623a1c76bc7226eec30fb5dc8fd6f86f064 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Mon, 12 Oct 2009 09:57:25 +0200 Subject: [PATCH] --- yaml --- r: 167457 b: refs/heads/master c: 55621ccf2b7a8afe39df8c80f55b28424fd07d13 h: refs/heads/master i: 167455: 2964524fcf7b7709ef9b2d6c117bb4b96049b541 v: v3 --- [refs] | 2 +- trunk/tools/perf/Makefile | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index c20c80e010f1..ebce4900181c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cbef79a82a64ec13e745ce2b0274154ae1e47243 +refs/heads/master: 55621ccf2b7a8afe39df8c80f55b28424fd07d13 diff --git a/trunk/tools/perf/Makefile b/trunk/tools/perf/Makefile index 5881943f0c34..742a32eee8fc 100644 --- a/trunk/tools/perf/Makefile +++ b/trunk/tools/perf/Makefile @@ -157,11 +157,18 @@ uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not') uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not') uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not') -# If we're on a 64-bit kernel, use -m64 -ifndef NO_64BIT - ifneq ($(patsubst %64,%,$(uname_M)),$(uname_M)) - M64 := -m64 - endif +# +# Add -m32 for cross-builds: +# +ifdef NO_64BIT + MBITS := -m32 +else + # + # If we're on a 64-bit kernel, use -m64: + # + ifneq ($(patsubst %64,%,$(uname_M)),$(uname_M)) + MBITS := -m64 + endif endif # CFLAGS and LDFLAGS are for the users to override from the command line. @@ -194,7 +201,7 @@ EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wold-style-definition EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-prototypes EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wdeclaration-after-statement -CFLAGS = $(M64) -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -fstack-protector-all -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) +CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -fstack-protector-all -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) LDFLAGS = -lpthread -lrt -lelf -lm ALL_CFLAGS = $(CFLAGS) ALL_LDFLAGS = $(LDFLAGS) @@ -416,7 +423,7 @@ ifeq ($(uname_S),Darwin) 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) - msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel); + msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel and glibc-dev[el]); endif ifdef NO_DEMANGLE