[<prev] [next>] [day] [month] [year] [list]
Message-id: <1263217768-6950-1-git-send-email-m.nazarewicz@samsung.com>
Date: Mon, 11 Jan 2010 14:49:28 +0100
From: Michal Nazarewicz <m.nazarewicz@...sung.com>
To: LKML <linux-kernel@...r.kernel.org>, linux-kernel@...r.kernel.org
Cc: Michal Nazarewicz <m.nazarewicz@...sung.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Paul Mackerras <paulus@...ba.org>, Ingo Molnar <mingo@...e.hu>
Subject: [PATCH] perf tools: Test if programs with -fstack-prtoector-all link
The -fstack-protector may need additional library to be present in
system thus it is not enough to test if compiler compiles program
but also whether linker links it thus "-c" flag has been removed
Signed-off-by: Michal Nazarewicz <m.nazarewicz@...sung.com>
---
tools/perf/Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
As I was corss-compiling perf compiler handled -fstack-protector-all
nicely and so the flag has been added to CFLAGS however test for
presence of libelf failed because linker could not link with ssp_nonshared
library. Removing "-c" from the -fstack-protector-all test code fixed
problem by forcing linking and thus testing if not only compiler but the
whole toolchain supported stack protector.
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 652a470..223e5f5 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -250,7 +250,7 @@ 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 "$(QUIET_STDERR)" && echo y"), y)
+ifeq ($(shell sh -c "echo 'int foo(void) {char X[2]; return 3;}' | $(CC) -x c -Werror -fstack-protector-all - -o /dev/null "$(QUIET_STDERR)" && echo y"), y)
CFLAGS := $(CFLAGS) -fstack-protector-all
endif
--
1.6.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists