[rfc] a few kern.mk and bsd.sys.mk related changes

Alexander Best arundel at freebsd.org
Fri May 27 11:51:47 UTC 2011


hi there,

i would like to hear people's opinion regarding the following patch. it
features the following semantic changes:

1) -W is now called -Wextra
2) move -fformat-extensions and -fdiagnostics-show-option out of CWARNFLAGS,
   since they aren't really warnings. this will now let anybody use custom
   CWARNFLAGS without having to remember to add -fformat-extensions in order
   not to break buildworld.
3) rearrange "\" characters, as to avoid double spaces
4) when building kernel modules, -fstack-protector was added to CFLAGS twice.
   this should now be solved.

cheers.
alex

-- 
a13x
-------------- next part --------------
diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk
index 796d169..eec7408 100644
--- a/share/mk/bsd.sys.mk
+++ b/share/mk/bsd.sys.mk
@@ -36,7 +36,7 @@ CWARNFLAGS	+=	-Werror
 CWARNFLAGS	+=	-Wall -Wno-format-y2k
 .  endif
 .  if ${WARNS} >= 3
-CWARNFLAGS	+=	-W -Wno-unused-parameter -Wstrict-prototypes\
+CWARNFLAGS	+=	-Wextra -Wno-unused-parameter -Wstrict-prototypes\
 			-Wmissing-prototypes -Wpointer-arith
 .  endif
 .  if ${WARNS} >= 4
diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk
index a0a595f..0806b0b 100644
--- a/sys/conf/kern.mk
+++ b/sys/conf/kern.mk
@@ -3,10 +3,9 @@
 #
 # Warning flags for compiling the kernel and components of the kernel:
 #
-CWARNFLAGS?=	-Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \
-		-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \
-		-Wundef -Wno-pointer-sign -fformat-extensions \
-		-Wmissing-include-dirs -fdiagnostics-show-option
+CWARNFLAGS?=	-Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes\
+		-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual\
+		-Wundef -Wno-pointer-sign -Wmissing-include-dirs
 #
 # The following flags are next up for working on:
 #	-Wextra
@@ -83,7 +82,7 @@ CFLAGS+=	-mno-sse
 .else
 CFLAGS+=	-mno-aes -mno-avx
 .endif
-CFLAGS+=	-mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float \
+CFLAGS+=	-mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float\
 		-fno-asynchronous-unwind-tables
 INLINE_LIMIT?=	8000
 .endif
@@ -120,11 +119,17 @@ INLINE_LIMIT?=	8000
 CFLAGS+=	-ffreestanding
 
 #
+# Enable FreeBSD kernel-specific printf format specifiers. Also instruct gcc to
+# enable some diagnostics, which make it easier to pinpoint tinderbox failures.
+CFLAGS+=	-fformat-extensions -fdiagnostics-show-option
+
+#
 # GCC SSP support
 #
 .if ${MK_SSP} != "no" && ${MACHINE_CPUARCH} != "ia64" && \
     ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips"
-CFLAGS+=	-fstack-protector
+SSP_CFLAGS?=	-fstack-protector
+CFLAGS+=	${SSP_CFLAGS}
 .endif
 
 #


More information about the freebsd-toolchain mailing list