]> Pileus Git - ~andy/linux/commitdiff
tools/perf/build: Split out feature check: 'stackprotector'
authorIngo Molnar <mingo@kernel.org>
Mon, 7 Oct 2013 07:47:00 +0000 (09:47 +0200)
committerIngo Molnar <mingo@kernel.org>
Wed, 9 Oct 2013 06:48:31 +0000 (08:48 +0200)
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/n/tip-eyLYjhskzn6qxkoyjtjic4ap@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
tools/perf/config/Makefile
tools/perf/config/feature-checks/Makefile
tools/perf/config/feature-checks/test-stackprotector.c [new file with mode: 0644]

index 1a67371441494adc7f9719df60cfc6dde19f7c48..9f94912ccf63c0946ecf10b600f4e914b1b23657 100644 (file)
@@ -104,6 +104,7 @@ $(info done)
 FEATURE_TESTS =                                \
        hello                           \
        stackprotector-all              \
+       stackprotector                  \
        libnuma
 
 $(foreach test,$(FEATURE_TESTS),$(call feature_check,$(test),$(test)))
@@ -112,7 +113,7 @@ ifeq ($(feature-stackprotector-all), 1)
   CFLAGS += -fstack-protector-all
 endif
 
-ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wstack-protector,-Wstack-protector),y)
+ifeq ($(feature-stackprotector), 1)
   CFLAGS += -Wstack-protector
 endif
 
index 7538c148b40cc9d71159d665a843784bdec81cf2..46b7650983cb6b7200f42a459fd62499d9e0b014 100644 (file)
@@ -2,6 +2,7 @@
 FILES=                                 \
        test-hello                      \
        test-stackprotector-all         \
+       test-stackprotector             \
        test-libnuma
 
 CC := $(CC) -MD
@@ -18,6 +19,9 @@ test-hello:
 test-stackprotector-all:
        $(BUILD) -Werror -fstack-protector-all
 
+test-stackprotector:
+       $(BUILD) -Werror -fstack-protector
+
 test-libnuma:
        $(BUILD) -lnuma
 
diff --git a/tools/perf/config/feature-checks/test-stackprotector.c b/tools/perf/config/feature-checks/test-stackprotector.c
new file mode 100644 (file)
index 0000000..c9f398d
--- /dev/null
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+int main(void)
+{
+       return puts("hi");
+}