This removes the support for building kernels and boot loaders with
gcc on amd64 and i386, simplifying the corresponding Makefiles.

ok?

Index: arch/amd64/conf/Makefile.amd64
===================================================================
RCS file: /cvs/src/sys/arch/amd64/conf/Makefile.amd64,v
retrieving revision 1.116
diff -u -p -r1.116 Makefile.amd64
--- arch/amd64/conf/Makefile.amd64      21 Jun 2019 15:34:06 -0000      1.116
+++ arch/amd64/conf/Makefile.amd64      1 Sep 2019 21:43:30 -0000
@@ -40,7 +40,8 @@ INCLUDES=     -nostdinc -I$S -I${.OBJDIR} -I
 CPPFLAGS=      ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -MD -MP
 CWARNFLAGS=    -Werror -Wall -Wimplicit-function-declaration \
                -Wno-uninitialized -Wno-pointer-sign \
-               -Wframe-larger-than=2047
+               -Wframe-larger-than=2047 -Wno-address-of-packed-member \
+               -Wno-constant-conversion
 
 CMACHFLAGS=    -mcmodel=kernel -mno-red-zone -mno-sse2 -mno-sse -mno-3dnow \
                -mno-mmx -msoft-float -fno-omit-frame-pointer
@@ -55,14 +56,8 @@ CMACHFLAGS+= -msave-args
 .if ${IDENT:M-DSMALL_KERNEL}
 SORTR=         cat
 COPTS?=                -Oz
-.if ${COMPILER_VERSION:Mclang}
 CMACHFLAGS+=   -mno-retpoline
 .endif
-.endif
-.if ${COMPILER_VERSION:Mclang}
-NO_INTEGR_AS=  -no-integrated-as
-CWARNFLAGS+=   -Wno-address-of-packed-member -Wno-constant-conversion
-.endif
 
 DEBUG?=                -g
 COPTS?=                -O2
@@ -110,11 +105,11 @@ SYSTEM_LD_TAIL+=; umask 007; \
 LINKFLAGS+=    -S
 .endif
 
-.if ${SYSTEM_OBJ:Mkcov.o} && ${COMPILER_VERSION:Mclang}
+.if ${SYSTEM_OBJ:Mkcov.o}
 PROF=          -fsanitize-coverage=trace-pc,trace-cmp
 .endif
 
-.if ${IDENT:M-DKUBSAN} && ${COMPILER_VERSION:Mclang}
+.if ${IDENT:M-DKUBSAN}
 CFLAGS+=       -fsanitize=undefined
 CFLAGS+=       -fno-wrapv
 .endif
@@ -129,7 +124,7 @@ CFLAGS+=    -fno-wrapv
 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} ${NO_INTEGR_AS} ${CFLAGS} ${CPPFLAGS} 
-MF assym.P > assym.h.tmp
+           sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} 
-no-integrated-as -MF assym.P > assym.h.tmp
        sed '1s/.*/assym.h: \\/' assym.P > assym.d
        sort -u assym.h.tmp > assym.h
 
@@ -171,7 +166,7 @@ vers.o: ${SYSTEM_DEP:Ngap.o}
        sh $S/conf/newvers.sh
        ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
 
-.if ${SYSTEM_OBJ:Mkcov.o} && ${COMPILER_VERSION:Mclang}
+.if ${SYSTEM_OBJ:Mkcov.o}
 kcov.o: $S/dev/kcov.c
        ${NORMAL_C} -fno-sanitize-coverage=trace-pc,trace-cmp
 .endif
Index: arch/amd64/stand/Makefile.inc
===================================================================
RCS file: /cvs/src/sys/arch/amd64/stand/Makefile.inc,v
retrieving revision 1.18
diff -u -p -r1.18 Makefile.inc
--- arch/amd64/stand/Makefile.inc       25 Jul 2017 13:32:14 -0000      1.18
+++ arch/amd64/stand/Makefile.inc       1 Sep 2019 21:44:45 -0000
@@ -23,18 +23,13 @@ CLEANFILES+=        assym.h machine
 
 SACFLAGS+=-nostdinc -fno-builtin -fpack-struct
 
-.include <bsd.own.mk>
-.if ${COMPILER_VERSION:Mclang}
-NO_INTEGR_AS=  -no-integrated-as
-.endif
-
 .if !make(clean) && !make(cleandir) && !make(includes) && !make(libdep) && \
     !make(sadep) && !make(salibdir) && !make(obj)
 .BEGIN:
        @([ X$(S) = X -o -h machine ] || ln -s $(S)/arch/amd64/include machine)
 
 assym.h: ${S}/kern/genassym.sh ${SADIR}/etc/genassym.cf
-       sh ${S}/kern/genassym.sh ${CC} ${NO_INTEGR_AS} ${CFLAGS} ${CPPFLAGS} \
+       sh ${S}/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -no-integrated-as \
            ${PARAM} < ${SADIR}/etc/genassym.cf > assym.h.tmp && \
            mv -f assym.h.tmp assym.h
 .endif
Index: arch/amd64/stand/biosboot/Makefile
===================================================================
RCS file: /cvs/src/sys/arch/amd64/stand/biosboot/Makefile,v
retrieving revision 1.14
diff -u -p -r1.14 Makefile
--- arch/amd64/stand/biosboot/Makefile  16 Oct 2018 18:20:58 -0000      1.14
+++ arch/amd64/stand/biosboot/Makefile  1 Sep 2019 21:45:20 -0000
@@ -24,7 +24,7 @@ ${PROG}: $(OBJS)
 CPPFLAGS+=-DLOADADDR=$(LOADADDR) -DLINKADDR=$(LINKADDR) 
-DBOOTMAGIC=$(BOOTMAGIC)
 CPPFLAGS+=${DEBUGFLAGS}
 CFLAGS+=-fno-pie
-AFLAGS+=${NO_INTEGR_AS}
+AFLAGS+=-no-integrated-as
 AFLAGS+=-m32 # -Wa,-a
 AFLAGS+=-fno-pie
 .else
Index: arch/amd64/stand/boot/Makefile
===================================================================
RCS file: /cvs/src/sys/arch/amd64/stand/boot/Makefile,v
retrieving revision 1.42
diff -u -p -r1.42 Makefile
--- arch/amd64/stand/boot/Makefile      3 Aug 2019 15:22:19 -0000       1.42
+++ arch/amd64/stand/boot/Makefile      1 Sep 2019 21:45:38 -0000
@@ -78,7 +78,7 @@ CPPFLAGS+=-DSLOW -DSMALL -DNOBYFOUR -DNO
 CPPFLAGS+=-DHIBERNATE
 CPPFLAGS+=-DHEAP_LIMIT=${HEAP_LIMIT} -I${S}/stand/boot #-DCOMPAT_UFS
 CFLAGS+=-m32 $(SACFLAGS) -D__INTERNAL_LIBSA_CREAD -fno-pie
-AFLAGS+=${NO_INTEGR_AS}
+AFLAGS+=-no-integrated-as
 AFLAGS+=-m32 # -Wa,-R
 # AFLAGS+=-Wa,-a
 AFLAGS+=-fno-pie
Index: arch/amd64/stand/cdboot/Makefile
===================================================================
RCS file: /cvs/src/sys/arch/amd64/stand/cdboot/Makefile,v
retrieving revision 1.37
diff -u -p -r1.37 Makefile
--- arch/amd64/stand/cdboot/Makefile    3 Aug 2019 15:22:19 -0000       1.37
+++ arch/amd64/stand/cdboot/Makefile    1 Sep 2019 21:45:44 -0000
@@ -68,6 +68,6 @@ CFLAGS+=${SACFLAGS} -D__INTERNAL_LIBSA_C
 CFLAGS+=-DOSREV=\"${OSREV}\" -DMACHINE=\"${MACHINE}\"
 CFLAGS+=-DKERNEL=\"/${OSREV}/${MACHINE}/bsd.rd\"
 CFLAGS+=-fno-pie
-AFLAGS+=${NO_INTEGR_AS}
+AFLAGS+=-no-integrated-as
 AFLAGS+=-m32
 AFLAGS+=-fno-pie
Index: arch/amd64/stand/pxeboot/Makefile
===================================================================
RCS file: /cvs/src/sys/arch/amd64/stand/pxeboot/Makefile,v
retrieving revision 1.35
diff -u -p -r1.35 Makefile
--- arch/amd64/stand/pxeboot/Makefile   3 Aug 2019 15:22:20 -0000       1.35
+++ arch/amd64/stand/pxeboot/Makefile   1 Sep 2019 21:45:51 -0000
@@ -70,7 +70,7 @@ CPPFLAGS+=-DSLOW -DSMALL -DNOBYFOUR -DNO
 CPPFLAGS+=-DHEAP_LIMIT=${HEAP_LIMIT} -I${S}/stand/boot #-DCOMPAT_UFS
 CFLAGS+=-m32
 CFLAGS+=$(SACFLAGS) -D__INTERNAL_LIBSA_CREAD -fno-pie
-AFLAGS+=${NO_INTEGR_AS}
+AFLAGS+=-no-integrated-as
 # AFLAGS+=-Wa,-a
 AFLAGS+=-m32 # -Wa,-R
 AFLAGS+=-fno-pie
Index: arch/i386/conf/Makefile.i386
===================================================================
RCS file: /cvs/src/sys/arch/i386/conf/Makefile.i386,v
retrieving revision 1.135
diff -u -p -r1.135 Makefile.i386
--- arch/i386/conf/Makefile.i386        21 Jun 2019 15:34:07 -0000      1.135
+++ arch/i386/conf/Makefile.i386        1 Sep 2019 21:50:31 -0000
@@ -27,7 +27,8 @@ INCLUDES=     -nostdinc -I$S -I${.OBJDIR} -I
 CPPFLAGS=      ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -MD -MP
 CWARNFLAGS=    -Werror -Wall -Wimplicit-function-declaration \
                -Wno-uninitialized -Wno-pointer-sign \
-               -Wframe-larger-than=2047
+               -Wframe-larger-than=2047 -Wno-address-of-packed-member \
+               -Wno-constant-conversion
 
 CMACHFLAGS=
 CMACHFLAGS+=   -ffreestanding ${NOPIE_FLAGS}
@@ -38,13 +39,9 @@ CMACHFLAGS+= -fno-stack-protector
 .if ${IDENT:M-DSMALL_KERNEL}
 SORTR=         cat
 COPTS?=                -Oz -mtune=i486 -mno-retpoline
-.elif ${COMPILER_VERSION:Mclang}
+.else
 CMACHFLAGS+=   -mretpoline
 .endif
-.if ${COMPILER_VERSION:Mclang}
-NO_INTEGR_AS=  -no-integrated-as
-CWARNFLAGS+=   -Wno-address-of-packed-member -Wno-constant-conversion
-.endif
 
 DEBUG?=                -g
 COPTS?=                -O2
@@ -99,7 +96,7 @@ SYSTEM_LD_TAIL+=; umask 007; \
 LINKFLAGS+=    -S
 .endif
 
-.if ${SYSTEM_OBJ:Mkcov.o} && ${COMPILER_VERSION:Mclang}
+.if ${SYSTEM_OBJ:Mkcov.o}
 PROF=          -fsanitize-coverage=trace-pc,trace-cmp
 .endif
 
@@ -113,7 +110,7 @@ PROF=               -fsanitize-coverage=trace-pc,trac
 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} ${NO_INTEGR_AS} ${CFLAGS} ${CPPFLAGS} 
-MF assym.P > assym.h.tmp
+           sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} 
-no-integrated-as -MF assym.P > assym.h.tmp
        sed '1s/.*/assym.h: \\/' assym.P > assym.d
        sort -u assym.h.tmp > assym.h
 
@@ -149,7 +146,7 @@ vers.o: ${SYSTEM_DEP:Ngap.o}
        sh $S/conf/newvers.sh
        ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
 
-.if ${SYSTEM_OBJ:Mkcov.o} && ${COMPILER_VERSION:Mclang}
+.if ${SYSTEM_OBJ:Mkcov.o}
 kcov.o: $S/dev/kcov.c
        ${NORMAL_C} -fno-sanitize-coverage=trace-pc,trace-cmp
 .endif
Index: arch/i386/stand/Makefile.inc
===================================================================
RCS file: /cvs/src/sys/arch/i386/stand/Makefile.inc,v
retrieving revision 1.51
diff -u -p -r1.51 Makefile.inc
--- arch/i386/stand/Makefile.inc        25 Jul 2017 13:32:14 -0000      1.51
+++ arch/i386/stand/Makefile.inc        1 Sep 2019 21:50:56 -0000
@@ -23,18 +23,13 @@ CLEANFILES+=        assym.h machine
 
 SACFLAGS+=-nostdinc -fno-builtin -fpack-struct
 
-.include <bsd.own.mk>
-.if ${COMPILER_VERSION:Mclang}
-NO_INTEGR_AS=   -no-integrated-as
-.endif
-
 .if !make(clean) && !make(cleandir) && !make(includes) && !make(libdep) && \
     !make(sadep) && !make(salibdir) && !make(obj)
 .BEGIN:
        @([ X$(S) = X -o -h machine ] || ln -s $(S)/arch/i386/include machine)
 
 assym.h: ${S}/kern/genassym.sh ${SADIR}/etc/genassym.cf
-       sh ${S}/kern/genassym.sh ${CC} ${NO_INTEGR_AS} ${CFLAGS} ${CPPFLAGS} \
+       sh ${S}/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -no-integrated-as \
            ${PARAM} < ${SADIR}/etc/genassym.cf > assym.h.tmp && \
            mv -f assym.h.tmp assym.h
 .endif
Index: arch/i386/stand/biosboot/Makefile
===================================================================
RCS file: /cvs/src/sys/arch/i386/stand/biosboot/Makefile,v
retrieving revision 1.30
diff -u -p -r1.30 Makefile
--- arch/i386/stand/biosboot/Makefile   16 Oct 2018 18:20:58 -0000      1.30
+++ arch/i386/stand/biosboot/Makefile   1 Sep 2019 21:51:48 -0000
@@ -23,7 +23,7 @@ ${PROG}: $(OBJS)
 CPPFLAGS+=-DLOADADDR=$(LOADADDR) -DLINKADDR=$(LINKADDR) 
-DBOOTMAGIC=$(BOOTMAGIC)
 CPPFLAGS+=${DEBUGFLAGS}
 CFLAGS+=-fno-pie
-AFLAGS+=${NO_INTEGR_AS}
+AFLAGS+=-no-integrated-as
 #AFLAGS+=-Wa,-a
 AFLAGS+=-fno-pie
 .else
Index: arch/i386/stand/boot/Makefile
===================================================================
RCS file: /cvs/src/sys/arch/i386/stand/boot/Makefile,v
retrieving revision 1.69
diff -u -p -r1.69 Makefile
--- arch/i386/stand/boot/Makefile       3 Aug 2019 15:22:20 -0000       1.69
+++ arch/i386/stand/boot/Makefile       1 Sep 2019 21:51:54 -0000
@@ -82,7 +82,7 @@ CPPFLAGS+=-DSLOW -DSMALL -DNOBYFOUR -DNO
 CPPFLAGS+=-DHIBERNATE
 CPPFLAGS+=-DHEAP_LIMIT=${HEAP_LIMIT} -I${S}/stand/boot #-DCOMPAT_UFS
 CFLAGS+=-m32 $(SACFLAGS) -D__INTERNAL_LIBSA_CREAD -fno-pie
-AFLAGS+=${NO_INTEGR_AS}
+AFLAGS+=-no-integrated-as
 AFLAGS+=-m32 # -Wa,-R
 # AFLAGS+=-Wa,-a
 AFLAGS+=-fno-pie
Index: arch/i386/stand/cdboot/Makefile
===================================================================
RCS file: /cvs/src/sys/arch/i386/stand/cdboot/Makefile,v
retrieving revision 1.33
diff -u -p -r1.33 Makefile
--- arch/i386/stand/cdboot/Makefile     3 Aug 2019 15:22:21 -0000       1.33
+++ arch/i386/stand/cdboot/Makefile     1 Sep 2019 21:52:00 -0000
@@ -73,7 +73,7 @@ CFLAGS+=${SACFLAGS} -D__INTERNAL_LIBSA_C
 CFLAGS+=-DOSREV=\"${OSREV}\" -DMACHINE=\"${MACHINE}\"
 CFLAGS+=-DKERNEL=\"/${OSREV}/${MACHINE}/bsd.rd\"
 CFLAGS+=-fno-pie
-AFLAGS+=${NO_INTEGR_AS}
+AFLAGS+=-no-integrated-as
 #AFLAGS+=-Wa,-R
 # AFLAGS+=-Wa,-a
 AFLAGS+=-fno-pie
Index: arch/i386/stand/pxeboot/Makefile
===================================================================
RCS file: /cvs/src/sys/arch/i386/stand/pxeboot/Makefile,v
retrieving revision 1.30
diff -u -p -r1.30 Makefile
--- arch/i386/stand/pxeboot/Makefile    3 Aug 2019 15:22:21 -0000       1.30
+++ arch/i386/stand/pxeboot/Makefile    1 Sep 2019 21:52:05 -0000
@@ -72,7 +72,7 @@ CPPFLAGS+=-DSLOW -DSMALL -DNOBYFOUR -DNO
 CPPFLAGS+=-DHEAP_LIMIT=${HEAP_LIMIT}
 CPPFLAGS+=-I${S}/stand/boot
 CFLAGS+=$(SACFLAGS) -D__INTERNAL_LIBSA_CREAD -fno-pie
-AFLAGS+=${NO_INTEGR_AS}
+AFLAGS+=-no-integrated-as
 #AFLAGS+=-Wa,-R
 # AFLAGS+=-Wa,-a
 AFLAGS+=-fno-pie
-- 
Christian "naddy" Weisgerber                          [email protected]

Reply via email to