[lkml]   [2009]   [Jun]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[tip:perfcounters/core] perf_counter: tools: Makefile tweaks for 64-bit powerpc
Commit-ID:  e24a72c4d8f0b2c17783b3ba9c8931b537149423
Author: Paul Mackerras <>
AuthorDate: Wed, 17 Jun 2009 21:54:26 +1000
Committer: Ingo Molnar <>
CommitDate: Thu, 18 Jun 2009 11:11:47 +0200

perf_counter: tools: Makefile tweaks for 64-bit powerpc

On 64-bit powerpc, perf needs to be built as a 64-bit executable.
This arranges to add the -m64 flag to CFLAGS if we are running on
a 64-bit machine, indicated by the result of uname -m ending in "64".
This means that we'll use -m64 on x86_64 machines as well.

Signed-off-by: Paul Mackerras <>
Cc: Peter Zijlstra <>
LKML-Reference: <>
Signed-off-by: Ingo Molnar <>

tools/perf/Makefile | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index e8346f9..714db73 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -157,9 +157,14 @@ 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
+ifneq ($(patsubst %64,%,$(uname_M)),$(uname_M))
+ M64 := -m64
# CFLAGS and LDFLAGS are for the users to override from the command line.

-CFLAGS = -ggdb3 -Wall -Werror -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -std=gnu99 -Wdeclaration-after-statement -O6
+CFLAGS = $(M64) -ggdb3 -Wall -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -std=gnu99 -Wdeclaration-after-statement -O6
LDFLAGS = -lpthread -lrt -lelf -lm

 \ /
  Last update: 2009-06-18 14:57    [W:0.168 / U:2.332 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site