From 4d178e2c0ce19851642045f1661664a9d0f5336f Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Mon, 5 Aug 2013 11:00:59 +0200 Subject: build: prevent redefinition of _FORTIFY_SOURCE in gentoo Add a -U_FORTIFY_SOURCE in HARDENING=1 [1] to prevent [2], e.g. as in: x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -std=gnu99 -pipe -fPIE -pie -Wl,-z,relro,-z,now -fstack-protector-all -Wstack-protector --param=ssp-buffer-size=4 -ftrapv -D_FORTIFY_SOURCE=2 -fexceptions -fomit-frame-pointer -fno-strict-aliasing -fasynchronous-unwind-tables -fno-delete-null-pointer-checks -D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DVERSION_STRING=\""0.5.8-rc2"""\" -DVERSION_LONG=\""0.5.8-rc2"" (Ziggomatic)"\" -DPREFIX_STRING=\"\" -Wall -I. -I/usr/include/libnl3 -I/usr/include/libnl3 -DHAVE_DISSECTOR_PROTOS -DNEED_TCPDUMP_LIKE_FILTER -I/usr/include/libnl3 -I/usr/include/libnl3 -DHAVE_DISSECTOR_PROTOS -DNEED_TCPDUMP_LIKE_FILTER -o netsniff-ng/proto_igmp.o -c proto_igmp.c :0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default] proto_igmp.c:1:0: note: this is the location of the previous definition [1] http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-analyzer/netsniff-ng/files/netsniff-ng-0.5.8-fortify_source.patch?revision=1.1&view=markup [2] http://b-4.xmw.de/var/log/portage/build/net-analyzer/netsniff-ng-0.5.8_rc2:20130805-070734.log Reported-by: Michael Weber Suggested-by: Michael Weber Signed-off-by: Daniel Borkmann --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 6966be4..99358a2 100644 --- a/Makefile +++ b/Makefile @@ -72,7 +72,7 @@ ifeq ($(HARDENING), 1) CFLAGS_DEF += -Wstack-protector CFLAGS_DEF += --param=ssp-buffer-size=4 CFLAGS_DEF += -ftrapv - CFLAGS_DEF += -D_FORTIFY_SOURCE=2 + CFLAGS_DEF += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 CFLAGS_DEF += -fexceptions endif -- cgit v1.2.3-54-g00ecf