diff --git a/sys/boot/i386/Makefile b/sys/boot/i386/Makefile index 6af86425e7f7..912714fe2a29 100644 --- a/sys/boot/i386/Makefile +++ b/sys/boot/i386/Makefile @@ -1,9 +1,9 @@ # $FreeBSD$ SUBDIR= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot zfsboot \ - kgzldr libi386 libfirewire loader + gptzfsboot kgzldr libi386 libfirewire loader # special boot programs, 'self-extracting boot2+loader' SUBDIR+= pxeldr .include diff --git a/sys/boot/i386/gptzfsboot/Makefile b/sys/boot/i386/gptzfsboot/Makefile index 985c0430db4a..930061ff25a6 100644 --- a/sys/boot/i386/gptzfsboot/Makefile +++ b/sys/boot/i386/gptzfsboot/Makefile @@ -1,74 +1,74 @@ # $FreeBSD$ .PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../gptboot ${.CURDIR}/../zfsboot FILES= gptzfsboot NM?= nm BOOT_COMCONSOLE_PORT?= 0x3f8 BOOT_COMCONSOLE_SPEED?= 9600 B2SIOFMT?= 0x3 REL1= 0x700 ORG1= 0x7c00 ORG2= 0x0 CFLAGS= -Os \ -fno-guess-branch-probability \ -fomit-frame-pointer \ -fno-unit-at-a-time \ -mno-align-long-strings \ -mrtd \ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ -DGPT -DBOOT2 \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ -DSIOFMT=${B2SIOFMT} \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ -I${.CURDIR}/../../common \ -I${.CURDIR}/../../zfs \ -I${.CURDIR}/../../../cddl/boot/zfs \ -I${.CURDIR}/../btx/lib -I. \ -I${.CURDIR}/../boot2 \ -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ -Winline --param max-inline-insns-single=100 LDFLAGS=-static -N --gc-sections # Pick up ../Makefile.inc early. .include CLEANFILES= gptzfsboot gptzfsboot: gptldr.bin gptzfsboot.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \ -o ${.TARGET} gptzfsboot.bin CLEANFILES+= gptldr.bin gptldr.out gptldr.o gptldr.bin: gptldr.out objcopy -S -O binary gptldr.out ${.TARGET} gptldr.out: gptldr.o ${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o CLEANFILES+= gptzfsboot.bin gptzfsboot.out zfsboot.o sio.o gptzfsboot.bin: gptzfsboot.out objcopy -S -O binary gptzfsboot.out ${.TARGET} gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} zfsboot.o: ${.CURDIR}/../../zfs/zfsimpl.c .if ${MACHINE_ARCH} == "amd64" -beforedepend gptzfsboot.o: machine +beforedepend zfsboot.o: machine CLEANFILES+= machine machine: ln -sf ${.CURDIR}/../../../i386/include machine .endif .include diff --git a/sys/boot/zfs/Makefile b/sys/boot/zfs/Makefile index 723233ce4ebb..5a22ecd9d7fa 100644 --- a/sys/boot/zfs/Makefile +++ b/sys/boot/zfs/Makefile @@ -1,29 +1,39 @@ # $FreeBSD$ LIB= zfsboot INTERNALLIB= SRCS+= zfs.c CFLAGS+= -I${.CURDIR}/../common -I${.CURDIR}/../.. -I. CFLAGS+= -I${.CURDIR}/../../../lib/libstand CFLAGS+= -I${.CURDIR}/../../cddl/boot/zfs -# XXX need arch-specific bootstrap CFLAGS here -# -CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 \ - -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 +CFLAGS+= -ffreestanding +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +CFLAGS+= -mpreferred-stack-boundary=2 +CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 +.endif +.if ${MACHINE_ARCH} == "i386" +CFLAGS+= -mno-sse3 +.endif +.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "arm" +CFLAGS+= -msoft-float +.endif +.if ${MACHINE_ARCH} == "amd64" +CFLAGS+= -m32 -march=i386 +.endif CFLAGS+= -Wformat -Wall .if ${MACHINE_ARCH} == "amd64" CLEANFILES+= machine machine: ln -sf ${.CURDIR}/../../../i386/include machine .endif .include .if ${MACHINE_ARCH} == "amd64" beforedepend ${OBJS}: machine .endif