tools/lib/api: undefine _FORTIFY_SOURCE before setting it
PATCH 1/1 tools/lib/api: undefine _FORTIFY_SOURCE before setting it
Some toolchains (like Hardened Gentoo) define _FORTIFY_SOURCE in the built-in, default args. This causes perf builds to fail with:
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror] <built-in>: note: this is the location of the previous definition
cc1: all warnings being treated as errors
To avoid this, undefine _FORTIFY_SOURCE before (possibly re-)defining it in tools/lib/api.
--- tools/lib/api/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/api/Makefile +1 -1
@@ -21,7 +21,7 @@ LIB_OBJS += $(OUTPUT)fd/array.o LIBFILE = libapikfs.a -CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC +CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC EXTLIBS = -lelf -lpthread -lrt -lm ALL_CFLAGS = $(CFLAGS) $(BASIC_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 ALL_LDFLAGS = $(LDFLAGS)
Signature · 1 line
2.3.5
Quoted 11 lines · Bobby Powers
Some toolchains (like Hardened Gentoo) define
_FORTIFY_SOURCEin the built-in, default args. This causes perf builds to fail with:<command-line>:0:0: error: "
_FORTIFY_SOURCE" redefined [-Werror] <built-in>: note: this is the location of the previous definition
cc1: all warnings being treated as errorsTo avoid this, undefine
_FORTIFY_SOURCEbefore (possibly re-)defining it intools/lib/api.Signed-off-by Bobby Powers <[email protected]>
thanks,
jirka
Quoted 20 lines
--- tools/lib/api/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/lib/api/Makefile +1
-1@@ -21,7 +21,7 @@ LIB_OBJS += $(OUTPUT)fd/array.o LIBFILE = libapikfs.a -CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC +CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC EXTLIBS = -lelf -lpthread -lrt -lm ALL_CFLAGS = $(CFLAGS) $(BASIC_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 ALL_LDFLAGS = $(LDFLAGS)Signature · 1 line
2.3.5
+CC linux-kbuild. Related to this Dirk's work [1].
Quoted 11 lines · Jiri Olsa
Quoted 10 lines · Bobby Powers
Some toolchains (like Hardened Gentoo) define
_FORTIFY_SOURCEin the built-in, default args. This causes perf builds to fail with:<command-line>:0:0: error: "
_FORTIFY_SOURCE" redefined [-Werror] <built-in>: note: this is the location of the previous definition
cc1: all warnings being treated as errorsTo avoid this, undefine
_FORTIFY_SOURCEbefore (possibly re-)defining it intools/lib/api.
Quoted 6 lines
Quoted 1 line
Signed-off-by Bobby Powers <[email protected]>Acked-by Jiri Olsa <[email protected]>thanks,
jirka
yours,
Bobby
1 - https://lkml.org/lkml/2015/4/20/269
Quoted 21 lines
Quoted 21 lines
--- tools/lib/api/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/lib/api/Makefile +1
-2@@ -21,7 +21,7 @@ LIB_OBJS += $(OUTPUT)fd/array.o LIBFILE = libapikfs.a -CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC +CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC EXTLIBS = -lelf -lpthread -lrt -lm ALL_CFLAGS = $(CFLAGS) $(BASIC_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 ALL_LDFLAGS = $(LDFLAGS) --2.3.5