From: Dave Jiang Date: Thu, 15 Dec 2016 21:51:28 +0000 (-0700) Subject: fio: move _FORTIFY_SOURCE to only when optimization is turned on X-Git-Tag: fio-2.16~5 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=0d60927f167d318a685b9e5309bb392c624776e4 fio: move _FORTIFY_SOURCE to only when optimization is turned on When compile with debug, without the proper -O flag the compiler complains: /usr/include/features.h:331:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp] # warning _FORTIFY_SOURCE requires compiling with optimization (-O) Moving _FORTIFY_SOURCE to optimized compile option. Signed-off-by: Dave Jiang Signed-off-by: Jens Axboe --- diff --git a/Makefile b/Makefile index 262ceeaa..d27380bd 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ all: include config-host.mak endif -DEBUGFLAGS = -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -DFIO_INC_DEBUG +DEBUGFLAGS = -DFIO_INC_DEBUG CPPFLAGS= -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DFIO_INTERNAL $(DEBUGFLAGS) OPTFLAGS= -g -ffast-math CFLAGS = -std=gnu99 -Wwrite-strings -Wall -Wdeclaration-after-statement $(OPTFLAGS) $(EXTFLAGS) $(BUILD_CFLAGS) -I. -I$(SRCDIR) @@ -29,7 +29,7 @@ PROGS = fio SCRIPTS = $(addprefix $(SRCDIR)/,tools/fio_generate_plots tools/plot/fio2gnuplot tools/genfio tools/fiologparser.py tools/fio_latency2csv.py tools/hist/fiologparser_hist.py) ifndef CONFIG_FIO_NO_OPT - CFLAGS += -O3 + CFLAGS += -O3 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 endif ifdef CONFIG_GFIO