All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Make _FORTIFY_SOURCE defines dependent on the feature
@ 2019-09-25 19:59 Ian Rogers
  2019-09-25 19:59 ` [PATCH 2/2] Avoid raising segv using an obvious null dereference Ian Rogers
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ian Rogers @ 2019-09-25 19:59 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Alexander Shishkin, Jiri Olsa, Namhyung Kim, Andi Kleen,
	linux-kernel
  Cc: Stephane Eranian, Ian Rogers

Unconditionally defining _FORTIFY_SOURCE can break tools that don't work
with it, such as memory sanitizers:
https://github.com/google/sanitizers/wiki/AddressSanitizer#faq

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/lib/subcmd/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/lib/subcmd/Makefile b/tools/lib/subcmd/Makefile
index ed61fb3a46c0..5b2cd5e58df0 100644
--- a/tools/lib/subcmd/Makefile
+++ b/tools/lib/subcmd/Makefile
@@ -20,7 +20,13 @@ MAKEFLAGS += --no-print-directory
 LIBFILE = $(OUTPUT)libsubcmd.a
 
 CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
-CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC
+CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -fPIC
+
+ifeq ($(DEBUG),0)
+  ifeq ($(feature-fortify-source), 1)
+    CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
+  endif
+endif
 
 ifeq ($(CC_NO_CLANG), 0)
   CFLAGS += -O3
-- 
2.23.0.351.gc4317032e6-goog


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-10-07 14:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-25 19:59 [PATCH 1/2] Make _FORTIFY_SOURCE defines dependent on the feature Ian Rogers
2019-09-25 19:59 ` [PATCH 2/2] Avoid raising segv using an obvious null dereference Ian Rogers
2019-09-26 15:24   ` Arnaldo Carvalho de Melo
2019-10-07 14:49   ` [tip: perf/urgent] perf tests: Avoid raising SEGV using an obvious NULL dereference tip-bot2 for Ian Rogers
2019-09-26 15:18 ` [PATCH 1/2] Make _FORTIFY_SOURCE defines dependent on the feature Arnaldo Carvalho de Melo
2019-10-07 14:49 ` [tip: perf/urgent] libsubcmd: " tip-bot2 for Ian Rogers

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.