summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2001-09-10 06:23:33 +0000
committerpeter <peter@FreeBSD.org>2001-09-10 06:23:33 +0000
commit51f2eacde0acc83af2b12607a026eb395e6af02b (patch)
treea8ac0d4401a83cfa63e2c952ba0e4c31090684ee
parent96b9a12bd20f300ee8fcf003538e8aa560536c2c (diff)
downloadFreeBSD-src-51f2eacde0acc83af2b12607a026eb395e6af02b.zip
FreeBSD-src-51f2eacde0acc83af2b12607a026eb395e6af02b.tar.gz
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.
-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