summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--share/mk/bsd.kern.mk15
-rw-r--r--sys/conf/kern.mk15
2 files changed, 30 insertions, 0 deletions
diff --git a/share/mk/bsd.kern.mk b/share/mk/bsd.kern.mk
index d81fd7c..2845be7 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 d81fd7c..2845be7 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
OpenPOWER on IntegriCloud