aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2013-10-07 03:38:28 -0400
committerIngo Molnar <mingo@kernel.org>2013-10-09 02:48:32 -0400
commit1ea6f99efd8ae61fce68c97a9cf9f722cfbca3ad (patch)
tree6962640fe08ef1c9976315af6b3e5b09b2d72e7f /tools/perf
parentc25104452de94102810e86323eabb7d9a4cad083 (diff)
tools/perf/build: Split out feature check: 'fortify-source'
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-wicrcLCy2wkalka7iwsuzgpb@git.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/config/Makefile3
-rw-r--r--tools/perf/config/feature-checks/Makefile4
-rw-r--r--tools/perf/config/feature-checks/test-fortify-source.c6
3 files changed, 12 insertions, 1 deletions
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index a3de2f8bd61a..7a614f92ce8c 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -106,6 +106,7 @@ FEATURE_TESTS = \
106 stackprotector-all \ 106 stackprotector-all \
107 stackprotector \ 107 stackprotector \
108 volatile-register-var \ 108 volatile-register-var \
109 fortify-source \
109 libnuma 110 libnuma
110 111
111$(foreach test,$(FEATURE_TESTS),$(call feature_check,$(test),$(test))) 112$(foreach test,$(FEATURE_TESTS),$(call feature_check,$(test),$(test)))
@@ -123,7 +124,7 @@ ifeq ($(feature-volatile-register-var), 1)
123endif 124endif
124 125
125ifndef PERF_DEBUG 126ifndef PERF_DEBUG
126 ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -D_FORTIFY_SOURCE=2,-D_FORTIFY_SOURCE=2),y) 127 ifeq ($(feature-fortify-source), 1)
127 CFLAGS += -D_FORTIFY_SOURCE=2 128 CFLAGS += -D_FORTIFY_SOURCE=2
128 endif 129 endif
129endif 130endif
diff --git a/tools/perf/config/feature-checks/Makefile b/tools/perf/config/feature-checks/Makefile
index 5693299b4806..529317e6009b 100644
--- a/tools/perf/config/feature-checks/Makefile
+++ b/tools/perf/config/feature-checks/Makefile
@@ -4,6 +4,7 @@ FILES= \
4 test-stackprotector-all \ 4 test-stackprotector-all \
5 test-stackprotector \ 5 test-stackprotector \
6 test-volatile-register-var \ 6 test-volatile-register-var \
7 test-fortify-source \
7 test-libnuma 8 test-libnuma
8 9
9CC := $(CC) -MD 10CC := $(CC) -MD
@@ -26,6 +27,9 @@ test-stackprotector:
26test-volatile-register-var: 27test-volatile-register-var:
27 $(BUILD) -Werror -Wvolatile-register-var 28 $(BUILD) -Werror -Wvolatile-register-var
28 29
30test-fortify-source:
31 $(BUILD) -O2 -Werror -D_FORTIFY_SOURCE=2
32
29test-libnuma: 33test-libnuma:
30 $(BUILD) -lnuma 34 $(BUILD) -lnuma
31 35
diff --git a/tools/perf/config/feature-checks/test-fortify-source.c b/tools/perf/config/feature-checks/test-fortify-source.c
new file mode 100644
index 000000000000..c9f398d87868
--- /dev/null
+++ b/tools/perf/config/feature-checks/test-fortify-source.c
@@ -0,0 +1,6 @@
1#include <stdio.h>
2
3int main(void)
4{
5 return puts("hi");
6}