blob: a3dd2fbec4eadefaf49b926cf7249c913fa66741 [file] [log] [blame] [raw]
Allow the kernel source be compiled with gcc(1).
diff -ru --exclude-from freebsd-src-diff-exclude-names /var/archive3/public/freebsd-releng-10.4-src/sys/conf/kern.mk freebsd-10.4/sys/conf/kern.mk
--- /var/archive3/public/freebsd-releng-10.4-src/sys/conf/kern.mk 2017-09-29 08:19:45.000000000 +0800
+++ freebsd-10.4/sys/conf/kern.mk 2019-08-17 23:51:17.292268521 +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-unused-but-set-variable \
+ -Wno-error=inline -Wno-error=address
.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,8 @@
#
.if ${MACHINE_CPUARCH} == "i386"
.if ${COMPILER_TYPE} != "clang"
-CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2
+CFLAGS+= -mpreferred-stack-boundary=2
+CWARNEXTRA+= -Wno-pointer-to-int-cast -Wno-error=strict-overflow
.else
CFLAGS+= -mno-aes -mno-avx
.endif
diff -ru --exclude-from freebsd-src-diff-exclude-names /var/archive3/public/freebsd-releng-10.4-src/sys/conf/kmod.mk freebsd-10.4/sys/conf/kmod.mk
--- /var/archive3/public/freebsd-releng-10.4-src/sys/conf/kmod.mk 2017-09-29 08:19:45.000000000 +0800
+++ freebsd-10.4/sys/conf/kmod.mk 2019-08-17 23:51:17.292268521 +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