This is a note to let you know that I've just added the patch titled
perf tools: Test -fstack-protector-all compiler option for inclusion in
CFLAGS
to the 2.6.32-longterm tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/longterm/longterm-queue-2.6.32.git;a=summary
The filename of the patch is:
perf-tools-test-fstack-protector-all-compiler-option.patch
and it can be found in the queue-2.6.32 subdirectory.
If you, or anyone else, feels it should not be added to the 2.6.32 longterm
tree,
please let <[email protected]> know about it.
>From 81113c316dd112fe2cfc35286920c68780997e67 Mon Sep 17 00:00:00 2001
From: Michael Cree <[email protected]>
Date: Wed, 11 Nov 2009 20:43:03 +1300
Subject: perf tools: Test -fstack-protector-all compiler option for inclusion
in CFLAGS
From: Michael Cree <[email protected]>
commit 5d7bdab75cd56d2bdc0986ae5546be3b09fea70a upstream.
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 <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: Ivan Kokshaysky <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Paul Mackerras <[email protected]>
LKML-Reference: <20091111074302.GA3728@omega>
Signed-off-by: Ingo Molnar <[email protected]>
[bwh: Backport to 2.6.32]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
tools/perf/Makefile | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -207,7 +207,7 @@ ifndef PERF_DEBUG
CFLAGS_OPTIMIZE = -O6
endif
-CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE)
-fstack-protector-all -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS)
+CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE)
-D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS)
LDFLAGS = -lpthread -lrt -lelf -lm
ALL_CFLAGS = $(CFLAGS)
ALL_LDFLAGS = $(LDFLAGS)
@@ -261,6 +261,9 @@ PTHREAD_LIBS = -lpthread
# explicitly what architecture to check for. Fix this up for yours..
SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
+ifeq ($(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)
+ CFLAGS := $(CFLAGS) -fstack-protector-all
+endif
### --- END CONFIGURATION SECTION ---
Patches currently in longterm-queue-2.6.32 which might be from
[email protected] are
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/increase-osf-partition-limit-from-8-to-18.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/perf-tools-test-fstack-protector-all-compiler-option.patch
_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable