blob: aa1a2a646f04ce6fc1b6c587ee340e7e65f1d11f [file] [log] [blame] [raw]
Allow the kernel source be compiled with gcc(1).
diff -ru --exclude-from freebsd-src-diff-exclude-names /var/tmp/freebsd-10.3-src/usr/src/sys/conf/kern.mk freebsd-10.3/usr/src/sys/conf/kern.mk
--- /var/tmp/freebsd-10.3-src/usr/src/sys/conf/kern.mk 2016-03-25 09:09:25.000000000 +0800
+++ freebsd-10.3/usr/src/sys/conf/kern.mk 2019-03-11 17:20:32.887470354 +0800
@@ -29,22 +29,24 @@
# enough to error out the whole kernel build. Display them anyway, so there is
# some incentive to fix them eventually.
CWARNEXTRA?= -Wno-error-tautological-compare -Wno-error-empty-body \
- -Wno-error-parentheses-equality -Wno-error-unused-function \
- ${NO_WFORMAT}
+ -Wno-error-parentheses-equality -Wno-error-unused-function
.endif
.if ${COMPILER_TYPE} == "gcc"
# For gcc 4.2, eliminate the too-often-wrong warnings about uninitialized vars.
-CWARNEXTRA?= -Wno-uninitialized
+CWARNEXTRA?= -Wno-uninitialized -Wno-error=unused-but-set-variable \
+ -Wno-error=inline
.endif
+CWARNEXTRA+= ${NO_WFORMAT}
+
# External compilers may not support our format extensions. Allow them
# to be disabled. WARNING: format checking is disabled in this case.
-.if ${MK_FORMAT_EXTENSIONS} == "no"
+#.if ${MK_FORMAT_EXTENSIONS} == "no"
NO_WFORMAT= -Wno-format
-.else
-FORMAT_EXTENSIONS= -fformat-extensions
-.endif
+#.else
+#FORMAT_EXTENSIONS= -fformat-extensions
+#.endif
#
# On i386, do not align the stack to 16-byte boundaries. Otherwise GCC 2.95
@@ -67,7 +69,7 @@
#
.if ${MACHINE_CPUARCH} == "i386"
.if ${COMPILER_TYPE} != "clang"
-CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2
+CFLAGS+= -mpreferred-stack-boundary=2
.else
CFLAGS+= -mno-aes -mno-avx
.endif
diff -ru --exclude-from freebsd-src-diff-exclude-names /var/tmp/freebsd-src/usr/src/sys/conf/kmod.mk freebsd-10.3/usr/src/sys/conf/kmod.mk
--- /var/tmp/freebsd-src/usr/src/sys/conf/kmod.mk 2016-03-25 09:09:25.000000000 +0800
+++ freebsd-10.3/usr/src/sys/conf/kmod.mk 2016-12-06 12:42:01.344048915 +0800
@@ -94,7 +94,7 @@
.if !empty(CFLAGS:M-O[23s]) && empty(CFLAGS:M-fno-strict-aliasing)
CFLAGS+= -fno-strict-aliasing
.endif
-WERROR?= -Werror
+#WERROR?= -Werror
CFLAGS+= ${WERROR}
CFLAGS+= -D_KERNEL
CFLAGS+= -DKLD_MODULE