diff options
author | Christian Weisgerber <naddy@cvs.openbsd.org> | 2017-06-01 11:18:54 +0000 |
---|---|---|
committer | Christian Weisgerber <naddy@cvs.openbsd.org> | 2017-06-01 11:18:54 +0000 |
commit | b2accca306831be4fd5b363c4e126ceb65981763 (patch) | |
tree | ab44b4f391342217992ae6b5f466f63464096fbb /sys/arch/i386/stand | |
parent | e3d41cfe477ca0daf3da834b1cd1e42b7ea3cad5 (diff) |
Sync with amd64 and allow building the i386 bootstrap with clang:
* build with -ffreestanding
* skip the integrated assembler for assym.h
* use as(1) to build biosboot.S and the various versions of srt0.S
ok kettenis@
Diffstat (limited to 'sys/arch/i386/stand')
-rw-r--r-- | sys/arch/i386/stand/Makefile.inc | 11 | ||||
-rw-r--r-- | sys/arch/i386/stand/biosboot/Makefile | 3 | ||||
-rw-r--r-- | sys/arch/i386/stand/boot/Makefile | 3 | ||||
-rw-r--r-- | sys/arch/i386/stand/cdboot/Makefile | 3 | ||||
-rw-r--r-- | sys/arch/i386/stand/pxeboot/Makefile | 3 |
5 files changed, 16 insertions, 7 deletions
diff --git a/sys/arch/i386/stand/Makefile.inc b/sys/arch/i386/stand/Makefile.inc index 212e2d1d253..db0c743e548 100644 --- a/sys/arch/i386/stand/Makefile.inc +++ b/sys/arch/i386/stand/Makefile.inc @@ -1,7 +1,7 @@ -# $OpenBSD: Makefile.inc,v 1.49 2016/11/06 16:04:20 tb Exp $ +# $OpenBSD: Makefile.inc,v 1.50 2017/06/01 11:18:53 naddy Exp $ CFLAGS=${DEBUG} ${COPTS} -Os -Wall -Werror -CFLAGS+= -fno-stack-protector -DMDRANDOM +CFLAGS+= -ffreestanding -fno-stack-protector -DMDRANDOM CPPFLAGS+=-I${S} -I${SADIR}/libsa -I. -I${.CURDIR} SACFLAGS=-D_STANDALONE DEBUGFLAGS= @@ -23,13 +23,18 @@ 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} ${CFLAGS} ${CPPFLAGS} \ + sh ${S}/kern/genassym.sh ${CC} ${NO_INTEGR_AS} ${CFLAGS} ${CPPFLAGS} \ ${PARAM} < ${SADIR}/etc/genassym.cf > assym.h.tmp && \ mv -f assym.h.tmp assym.h .endif diff --git a/sys/arch/i386/stand/biosboot/Makefile b/sys/arch/i386/stand/biosboot/Makefile index c2df759a7c8..8e84b83e76a 100644 --- a/sys/arch/i386/stand/biosboot/Makefile +++ b/sys/arch/i386/stand/biosboot/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.27 2016/07/30 03:25:48 guenther Exp $ +# $OpenBSD: Makefile,v 1.28 2017/06/01 11:18:53 naddy Exp $ MAN= biosboot.8 @@ -22,6 +22,7 @@ ${PROG}: $(OBJS) CPPFLAGS+=-DLOADADDR=$(LOADADDR) -DLINKADDR=$(LINKADDR) -DBOOTMAGIC=$(BOOTMAGIC) CPPFLAGS+=${DEBUGFLAGS} CFLAGS+=-fno-pie +AFLAGS+=${NO_INTEGR_AS} #AFLAGS+=-Wa,-a AFLAGS+=-fno-pie .else diff --git a/sys/arch/i386/stand/boot/Makefile b/sys/arch/i386/stand/boot/Makefile index 889ad6b99b3..52b440ebc40 100644 --- a/sys/arch/i386/stand/boot/Makefile +++ b/sys/arch/i386/stand/boot/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.64 2016/09/18 16:34:59 jsing Exp $ +# $OpenBSD: Makefile,v 1.65 2017/06/01 11:18:53 naddy Exp $ COPTS?= MAN?= boot.8 @@ -81,6 +81,7 @@ CPPFLAGS+=-DBOOTMAGIC=$(BOOTMAGIC) ${DEBUGFLAGS} -DLINKADDR=${LINKADDR} CPPFLAGS+=-DSLOW -DSMALL -DNOBYFOUR -DNO_GZIP -DDYNAMIC_CRC_TABLE 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+=-m32 # -Wa,-R # AFLAGS+=-Wa,-a AFLAGS+=-fno-pie diff --git a/sys/arch/i386/stand/cdboot/Makefile b/sys/arch/i386/stand/cdboot/Makefile index c832366610e..4679c7ddb9a 100644 --- a/sys/arch/i386/stand/cdboot/Makefile +++ b/sys/arch/i386/stand/cdboot/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.29 2016/09/18 16:34:59 jsing Exp $ +# $OpenBSD: Makefile,v 1.30 2017/06/01 11:18:53 naddy Exp $ MAN= cdboot.8 @@ -73,6 +73,7 @@ CFLAGS+=${SACFLAGS} -D__INTERNAL_LIBSA_CREAD CFLAGS+=-DOSREV=\"${OSREV}\" -DMACHINE=\"${MACHINE}\" CFLAGS+=-DKERNEL=\"/${OSREV}/${MACHINE}/bsd.rd\" CFLAGS+=-fno-pie +AFLAGS+=${NO_INTEGR_AS} #AFLAGS+=-Wa,-R # AFLAGS+=-Wa,-a AFLAGS+=-fno-pie diff --git a/sys/arch/i386/stand/pxeboot/Makefile b/sys/arch/i386/stand/pxeboot/Makefile index 1391225f253..4ce9cd5468f 100644 --- a/sys/arch/i386/stand/pxeboot/Makefile +++ b/sys/arch/i386/stand/pxeboot/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.26 2016/09/18 16:34:59 jsing Exp $ +# $OpenBSD: Makefile,v 1.27 2017/06/01 11:18:53 naddy Exp $ MAN= pxeboot.8 @@ -72,6 +72,7 @@ CPPFLAGS+=-DSLOW -DSMALL -DNOBYFOUR -DNO_GZIP -DDYNAMIC_CRC_TABLE CPPFLAGS+=-DHEAP_LIMIT=${HEAP_LIMIT} CPPFLAGS+=-I${S}/stand/boot CFLAGS+=$(SACFLAGS) -D__INTERNAL_LIBSA_CREAD -fno-pie +AFLAGS+=${NO_INTEGR_AS} #AFLAGS+=-Wa,-R # AFLAGS+=-Wa,-a AFLAGS+=-fno-pie |