Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1ea6f99e authored by Ingo Molnar's avatar Ingo Molnar
Browse files

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: default avatarIngo Molnar <mingo@kernel.org>
parent c2510445
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -106,6 +106,7 @@ FEATURE_TESTS = \
	stackprotector-all		\
	stackprotector-all		\
	stackprotector			\
	stackprotector			\
	volatile-register-var		\
	volatile-register-var		\
	fortify-source			\
	libnuma
	libnuma


$(foreach test,$(FEATURE_TESTS),$(call feature_check,$(test),$(test)))
$(foreach test,$(FEATURE_TESTS),$(call feature_check,$(test),$(test)))
@@ -123,7 +124,7 @@ ifeq ($(feature-volatile-register-var), 1)
endif
endif


ifndef PERF_DEBUG
ifndef PERF_DEBUG
  ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -D_FORTIFY_SOURCE=2,-D_FORTIFY_SOURCE=2),y)
  ifeq ($(feature-fortify-source), 1)
    CFLAGS += -D_FORTIFY_SOURCE=2
    CFLAGS += -D_FORTIFY_SOURCE=2
  endif
  endif
endif
endif
+4 −0
Original line number Original line Diff line number Diff line
@@ -4,6 +4,7 @@ FILES= \
	test-stackprotector-all		\
	test-stackprotector-all		\
	test-stackprotector		\
	test-stackprotector		\
	test-volatile-register-var	\
	test-volatile-register-var	\
	test-fortify-source		\
	test-libnuma
	test-libnuma


CC := $(CC) -MD
CC := $(CC) -MD
@@ -26,6 +27,9 @@ test-stackprotector:
test-volatile-register-var:
test-volatile-register-var:
	$(BUILD) -Werror -Wvolatile-register-var
	$(BUILD) -Werror -Wvolatile-register-var


test-fortify-source:
	$(BUILD) -O2 -Werror -D_FORTIFY_SOURCE=2

test-libnuma:
test-libnuma:
	$(BUILD) -lnuma
	$(BUILD) -lnuma


+6 −0
Original line number Original line Diff line number Diff line
#include <stdio.h>

int main(void)
{
	return puts("hi");
}