summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@cvs.openbsd.org>2017-07-23 21:43:30 +0000
committerChristian Weisgerber <naddy@cvs.openbsd.org>2017-07-23 21:43:30 +0000
commit0c98e23900e27dc6f87bbc59f6c850168332a0e7 (patch)
tree015158648d69a1c87a26b837445db962875c7102 /sys
parent82d61b1101abf0b863f1f79f391a6f99a66052dd (diff)
permit kernel building with clang as the base compiler; ok kettenis@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/conf/Makefile.amd6410
-rw-r--r--sys/arch/i386/conf/Makefile.i3868
2 files changed, 13 insertions, 5 deletions
diff --git a/sys/arch/amd64/conf/Makefile.amd64 b/sys/arch/amd64/conf/Makefile.amd64
index d223eaa7ac7..6f116d0df56 100644
--- a/sys/arch/amd64/conf/Makefile.amd64
+++ b/sys/arch/amd64/conf/Makefile.amd64
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.amd64,v 1.89 2017/07/18 16:43:27 tb Exp $
+# $OpenBSD: Makefile.amd64,v 1.90 2017/07/23 21:43:29 naddy Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
@@ -25,6 +25,7 @@ INCLUDES= -nostdinc -I$S -I${.OBJDIR} -I$S/arch
CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -MD -MP
CWARNFLAGS= -Werror -Wall -Wimplicit-function-declaration \
-Wno-uninitialized -Wno-pointer-sign \
+ -Wno-address-of-packed-member -Wno-constant-conversion \
-Wframe-larger-than=2047
CMACHFLAGS= -mcmodel=kernel -mno-red-zone -mno-sse2 -mno-sse -mno-3dnow \
@@ -34,13 +35,16 @@ SORTR= sort -R
.if ${IDENT:M-DNO_PROPOLICE}
CMACHFLAGS+= -fno-stack-protector
.endif
-.if ${IDENT:M-DDDB}
+.if ${IDENT:M-DDDB} && !${COMPILER_VERSION:Mclang}
CMACHFLAGS+= -msave-args
.endif
.if ${IDENT:M-DSMALL_KERNEL}
CMACHFLAGS+= -Wa,-n
SORTR= cat
.endif
+.if ${COMPILER_VERSION:Mclang}
+NO_INTEGR_AS= -no-integrated-as
+.endif
DEBUG?= -g
COPTS?= -O2
@@ -104,7 +108,7 @@ LINKFLAGS+= -S
assym.h: $S/kern/genassym.sh Makefile \
${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf
cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \
- sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp
+ sh $S/kern/genassym.sh ${CC} ${NO_INTEGR_AS} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp
sed '1s/.*/assym.h: \\/' assym.P > assym.d
sort -u assym.h.tmp > assym.h
diff --git a/sys/arch/i386/conf/Makefile.i386 b/sys/arch/i386/conf/Makefile.i386
index 73c452dbcec..4f0b89904ed 100644
--- a/sys/arch/i386/conf/Makefile.i386
+++ b/sys/arch/i386/conf/Makefile.i386
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.i386,v 1.115 2017/07/18 16:43:27 tb Exp $
+# $OpenBSD: Makefile.i386,v 1.116 2017/07/23 21:43:29 naddy Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
@@ -25,6 +25,7 @@ INCLUDES= -nostdinc -I$S -I${.OBJDIR} -I$S/arch
CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -MD -MP
CWARNFLAGS= -Werror -Wall -Wimplicit-function-declaration \
-Wno-uninitialized -Wno-pointer-sign \
+ -Wno-address-of-packed-member -Wno-constant-conversion \
-Wframe-larger-than=2047
CMACHFLAGS=
@@ -36,6 +37,9 @@ CMACHFLAGS+= -fno-stack-protector
.if ${IDENT:M-DSMALL_KERNEL}
SORTR= cat
.endif
+.if ${COMPILER_VERSION:Mclang}
+NO_INTEGR_AS= -no-integrated-as
+.endif
DEBUG?= -g
COPTS?= -O2
@@ -105,7 +109,7 @@ LINKFLAGS+= -S
assym.h: $S/kern/genassym.sh Makefile \
${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf
cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \
- sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp
+ sh $S/kern/genassym.sh ${CC} ${NO_INTEGR_AS} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp
sed '1s/.*/assym.h: \\/' assym.P > assym.d
sort -u assym.h.tmp > assym.h