aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMichael Cree <mcree@orcon.net.nz>2009-11-11 02:43:03 -0500
committerIngo Molnar <mingo@elte.hu>2009-11-11 02:46:45 -0500
commit5d7bdab75cd56d2bdc0986ae5546be3b09fea70a (patch)
treea0fcfc07a4d7cad05421f56de30526d68a442675 /tools
parent9e827dd00a94136b944a538bede67c944d0b740a (diff)
perf tools: Test -fstack-protector-all compiler option for inclusion in CFLAGS
Some architectures (e.g. Alpha) do not support the -fstack-protector-all compiler option and the use of the option with -Werror causes the compiler to abort and the build fails. Test that the compiler supports -fstack-protector-all before inclusion in CFLAGS. Signed-off-by: Michael Cree <mcree@orcon.net.nz> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <20091111074302.GA3728@omega> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/Makefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index b9509b1cc32c..e6d42728a33a 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -207,7 +207,7 @@ ifndef PERF_DEBUG
207 CFLAGS_OPTIMIZE = -O6 207 CFLAGS_OPTIMIZE = -O6
208endif 208endif
209 209
210CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -fstack-protector-all -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) 210CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS)
211LDFLAGS = -lpthread -lrt -lelf -lm 211LDFLAGS = -lpthread -lrt -lelf -lm
212ALL_CFLAGS = $(CFLAGS) 212ALL_CFLAGS = $(CFLAGS)
213ALL_LDFLAGS = $(LDFLAGS) 213ALL_LDFLAGS = $(LDFLAGS)
@@ -259,6 +259,9 @@ PTHREAD_LIBS = -lpthread
259# explicitly what architecture to check for. Fix this up for yours.. 259# explicitly what architecture to check for. Fix this up for yours..
260SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__ 260SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
261 261
262ifeq ($(shell sh -c "echo 'int foo(void) {char X[2]; return 3;}' | $(CC) -x c -c -Werror -fstack-protector-all - -o /dev/null >/dev/null 2>&1 && echo y"), y)
263 CFLAGS := $(CFLAGS) -fstack-protector-all
264endif
262 265
263 266
264### --- END CONFIGURATION SECTION --- 267### --- END CONFIGURATION SECTION ---