From ea8f3ee34755a5c2dbd010f8833a675b332be909 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Mon, 10 Sep 2001 06:23:33 +0000 Subject: [PATCH] This will have to be revised, but allow putting 'makeoptions GCC3=true' in a kernel config file. This should minimize the tearing-out-hair process while updating the kernel for gcc-3 compliance. --- share/mk/bsd.kern.mk | 15 +++++++++++++++ sys/conf/kern.mk | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/share/mk/bsd.kern.mk b/share/mk/bsd.kern.mk index d81fd7ce699..2845be70f37 100644 --- a/share/mk/bsd.kern.mk +++ b/share/mk/bsd.kern.mk @@ -7,9 +7,16 @@ # most of the remaining warnings. Warnings introduced with -Wall will # also pop up, but are easier to fix. # +# XXX FIXME - revert when there is a gcc3 with -fformat-extensions +.ifndef GCC3 CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ -fformat-extensions -ansi +.else +CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ + -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ + -Wno-format -ansi +.endif # # The following flags are next up for working on: # -W @@ -47,3 +54,11 @@ CFLAGS+= -mno-fp-regs -ffixed-8 -Wa,-mev56 .if ${MACHINE_ARCH} == "ia64" CFLAGS+= -ffixed-r13 -mfixed-range=f32-f127 .endif + +# +# GCC 3.0 and above like to do certain optimizations based on the +# assumption that the program is linked against libc. Stop this. +# +.ifdef GCC3 +CFLAGS+= -ffreestanding +.endif diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index d81fd7ce699..2845be70f37 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -7,9 +7,16 @@ # most of the remaining warnings. Warnings introduced with -Wall will # also pop up, but are easier to fix. # +# XXX FIXME - revert when there is a gcc3 with -fformat-extensions +.ifndef GCC3 CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ -fformat-extensions -ansi +.else +CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ + -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ + -Wno-format -ansi +.endif # # The following flags are next up for working on: # -W @@ -47,3 +54,11 @@ CFLAGS+= -mno-fp-regs -ffixed-8 -Wa,-mev56 .if ${MACHINE_ARCH} == "ia64" CFLAGS+= -ffixed-r13 -mfixed-range=f32-f127 .endif + +# +# GCC 3.0 and above like to do certain optimizations based on the +# assumption that the program is linked against libc. Stop this. +# +.ifdef GCC3 +CFLAGS+= -ffreestanding +.endif