Date: Fri, 27 May 2011 11:51:47 +0000 From: Alexander Best <arundel@freebsd.org> To: freebsd-hackers@freebsd.org Cc: freebsd-toolchain@freebsd.org Subject: [rfc] a few kern.mk and bsd.sys.mk related changes Message-ID: <20110527115147.GA73802@freebsd.org>
next in thread | raw e-mail | index | archive | help
--rwEMma7ioTxnRzrJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --rwEMma7ioTxnRzrJ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="kern.mk-bsy.sys.mk.patch" 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 # --rwEMma7ioTxnRzrJ--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110527115147.GA73802>