Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Oct 2017 23:14:59 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r325175 - in head/sys/boot: . efi/boot1 efi/libefi efi/loader i386/gptzfsboot i386/libi386 i386/loader i386/zfsboot ofw/libofw sparc64/loader userboot userboot/userboot userboot/zfs zfs
Message-ID:  <201710302314.v9UNExnn026034@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Mon Oct 30 23:14:59 2017
New Revision: 325175
URL: https://svnweb.freebsd.org/changeset/base/325175

Log:
  For amd64, compile both zfs and zfs32 libraries.
  
  We have a separate copy of zfs for userboot. However, we don't need it
  if we compile both 32 and 64 bit ZFS libraries. Remove redunant copies
  of zfs related .o files now that both versions are
  available. Introduce ZFSSRC and use it everywhere.
  
  Sponsored by: Netflix

Deleted:
  head/sys/boot/userboot/zfs/Makefile
  head/sys/boot/userboot/zfs/Makefile.depend
Modified:
  head/sys/boot/Makefile.amd64
  head/sys/boot/Makefile.arm
  head/sys/boot/Makefile.arm64
  head/sys/boot/Makefile.i386
  head/sys/boot/defs.mk
  head/sys/boot/efi/boot1/Makefile
  head/sys/boot/efi/libefi/Makefile
  head/sys/boot/efi/loader/Makefile
  head/sys/boot/i386/gptzfsboot/Makefile
  head/sys/boot/i386/libi386/Makefile
  head/sys/boot/i386/loader/Makefile
  head/sys/boot/i386/zfsboot/Makefile
  head/sys/boot/ofw/libofw/Makefile
  head/sys/boot/sparc64/loader/Makefile
  head/sys/boot/userboot/Makefile
  head/sys/boot/userboot/userboot/Makefile
  head/sys/boot/zfs/Makefile

Modified: head/sys/boot/Makefile.amd64
==============================================================================
--- head/sys/boot/Makefile.amd64	Mon Oct 30 23:14:53 2017	(r325174)
+++ head/sys/boot/Makefile.amd64	Mon Oct 30 23:14:59 2017	(r325175)
@@ -1,16 +1,16 @@
 # $FreeBSD$
 
-SUBDIR+=		efi
 SUBDIR+=		libsa32
-SUBDIR+=		zfs
+SUBDIR+=		zfs zfs32
+.if ${MK_FORTH} != "no"
+SUBDIR+=		ficl32
+.endif
+
+SUBDIR+=		efi
 SUBDIR+=		userboot
 
 .if ${LOADER_GELI_SUPPORT:Uyes} == "yes"
 SUBDIR+=		geli
-.endif
-
-.if ${MK_FORTH} != "no"
-SUBDIR+=		ficl32
 .endif
 
 SUBDIR+=		i386

Modified: head/sys/boot/Makefile.arm
==============================================================================
--- head/sys/boot/Makefile.arm	Mon Oct 30 23:14:53 2017	(r325174)
+++ head/sys/boot/Makefile.arm	Mon Oct 30 23:14:59 2017	(r325175)
@@ -3,5 +3,8 @@
 .if ${MK_FDT} != "no"
 SUBDIR+=		fdt
 .endif
+.if ${MK_ZFS} != "no"
+SUBDIR+=		zfs
+.endif
 
 SUBDIR+=		efi uboot

Modified: head/sys/boot/Makefile.arm64
==============================================================================
--- head/sys/boot/Makefile.arm64	Mon Oct 30 23:14:53 2017	(r325174)
+++ head/sys/boot/Makefile.arm64	Mon Oct 30 23:14:59 2017	(r325175)
@@ -3,5 +3,8 @@
 .if ${MK_FDT} != "no"
 SUBDIR+=		fdt
 .endif
+.if ${MK_ZFS} != "no"
+SUBDIR+=		zfs
+.endif
 
 SUBDIR+=		efi

Modified: head/sys/boot/Makefile.i386
==============================================================================
--- head/sys/boot/Makefile.i386	Mon Oct 30 23:14:53 2017	(r325174)
+++ head/sys/boot/Makefile.i386	Mon Oct 30 23:14:59 2017	(r325175)
@@ -1,9 +1,9 @@
 # $FreeBSD$
 
-SUBDIR+=		efi
 SUBDIR+=		libsa32
-SUBDIR+=		zfs
-
 .if ${LOADER_GELI_SUPPORT:Uyes} == "yes"
 SUBDIR+=		geli
 .endif
+SUBDIR+=		zfs
+
+SUBDIR+=		efi

Modified: head/sys/boot/defs.mk
==============================================================================
--- head/sys/boot/defs.mk	Mon Oct 30 23:14:53 2017	(r325174)
+++ head/sys/boot/defs.mk	Mon Oct 30 23:14:59 2017	(r325175)
@@ -15,6 +15,7 @@ LDRSRC=		${BOOTSRC}/common
 SASRC=		${BOOTSRC}/libsa
 SYSDIR=		${SRCTOP}/sys
 UBOOTSRC=	${BOOTSRC}/uboot
+ZFSSRC=		${BOOTSRC}/zfs
 
 BOOTOBJ=	${OBJTOP}/sys/boot
 

Modified: head/sys/boot/efi/boot1/Makefile
==============================================================================
--- head/sys/boot/efi/boot1/Makefile	Mon Oct 30 23:14:53 2017	(r325174)
+++ head/sys/boot/efi/boot1/Makefile	Mon Oct 30 23:14:59 2017	(r325175)
@@ -26,21 +26,15 @@ CWARNFLAGS.zfs_module.c += -Wno-missing-prototypes
 CWARNFLAGS.zfs_module.c += -Wno-sign-compare
 CWARNFLAGS.zfs_module.c += -Wno-unused-parameter
 CWARNFLAGS.zfs_module.c += -Wno-unused-function
-CWARNFLAGS.skein.c += -Wno-cast-align
-.if ${COMPILER_TYPE} == "clang"
-CWARNFLAGS.skein.c += -Wno-missing-variable-declarations
-.else if ${COMPILER_TYPE} == "gcc"
-CWARNFLAGS.skein.c += -Wno-missing-declarations
-.endif
 
 # architecture-specific loader code
 SRCS=	boot1.c self_reloc.c start.S ufs_module.c
 .if ${MK_ZFS} != "no"
 SRCS+=		zfs_module.c
-SRCS+=		skein.c skein_block.c
-# Do not unroll skein loops, reduce code size
-CFLAGS+=	-DSKEIN_LOOP=111
-.PATH:		${SYSDIR}/crypto/skein
+CFLAGS+=	-I${ZFSSRC}
+CFLAGS+=	-I${SYSDIR}/cddl/boot/zfs
+CFLAGS+=	-DEFI_ZFS_BOOT
+LIBZFSBOOT=	${BOOTOBJ}/zfs/libzfsboot.a
 .endif
 
 .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201
@@ -57,13 +51,6 @@ CFLAGS+=	-DEFI_UFS_BOOT
 CFLAGS+=	-DEFI_DEBUG
 .endif
 
-.if ${MK_ZFS} != "no"
-CFLAGS+=	-I${BOOTSRC}/zfs/
-CFLAGS+=	-I${SYSDIR}/cddl/boot/zfs/
-CFLAGS+=	-I${SYSDIR}/crypto/skein
-CFLAGS+=	-DEFI_ZFS_BOOT
-.endif
-
 # Always add MI sources and REGULAR efi loader bits
 .PATH:		${EFISRC}/loader/arch/${MACHINE}
 .PATH:		${EFISRC}/loader
@@ -91,8 +78,8 @@ LIBEFI=		${BOOTOBJ}/efi/libefi/libefi.a
 # __aeabi_* (arm) or __divdi3 (i386).
 # as well as required string and memory functions for all platforms.
 #
-DPADD+=		${LIBEFI} ${LIBSA}
-LDADD+=		${LIBEFI} ${LIBSA}
+DPADD+=		${LIBEFI} ${LIBZFSBOOT} ${LIBSA}
+LDADD+=		${LIBEFI} ${LIBZFSBOOT} ${LIBSA}
 
 DPADD+=		${LDSCRIPT}
 

Modified: head/sys/boot/efi/libefi/Makefile
==============================================================================
--- head/sys/boot/efi/libefi/Makefile	Mon Oct 30 23:14:53 2017	(r325174)
+++ head/sys/boot/efi/libefi/Makefile	Mon Oct 30 23:14:59 2017	(r325175)
@@ -38,9 +38,7 @@ CFLAGS+= -I${SYSDIR}
 CFLAGS+= -I${EFIINC}
 CFLAGS+= -I${EFIINCMD}
 .if ${MK_ZFS} != "no"
-CFLAGS+=	-I${BOOTSRC}/zfs
-CFLAGS+=	-I${SYSDIR}/cddl/boot/zfs
-CFLAGS+=	-I${SYSDIR}/crypto/skein
+CFLAGS+=	-I${ZFSSRC}
 CFLAGS+=	-DEFI_ZFS_BOOT
 .endif
 

Modified: head/sys/boot/efi/loader/Makefile
==============================================================================
--- head/sys/boot/efi/loader/Makefile	Mon Oct 30 23:14:53 2017	(r325174)
+++ head/sys/boot/efi/loader/Makefile	Mon Oct 30 23:14:59 2017	(r325175)
@@ -29,17 +29,9 @@ SRCS=	autoload.c \
 	vers.c
 
 .if ${MK_ZFS} != "no"
-SRCS+=		zfs.c
-.PATH:		${BOOTSRC}/zfs
-SRCS+=		skein.c skein_block.c
-# Do not unroll skein loops, reduce code size
-CFLAGS+=	-DSKEIN_LOOP=111
-.PATH:		${SYSDIR}/crypto/skein
-
-# Disable warnings that are currently incompatible with the zfs boot code
-CWARNFLAGS.zfs.c+=	-Wno-sign-compare
-CWARNFLAGS.zfs.c+=	-Wno-array-bounds
-CWARNFLAGS.zfs.c+=	-Wno-missing-prototypes
+LIBZFSBOOT=	${BOOTOBJ}/zfs/libzfsboot.a
+CFLAGS+=	-I${ZFSSRC}
+CFLAGS+=	-DEFI_ZFS_BOOT
 .endif
 
 .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201
@@ -65,12 +57,6 @@ CFLAGS+=	-I${EFISRC}/include/${MACHINE}
 CFLAGS+=	-I${SYSDIR}/contrib/dev/acpica/include
 CFLAGS+=	-I${SYSDIR}
 CFLAGS+=	-I${BOOTSRC}/i386/libi386
-.if ${MK_ZFS} != "no"
-CFLAGS+=	-I${BOOTSRC}/zfs
-CFLAGS+=	-I${SYSDIR}/cddl/boot/zfs
-CFLAGS+=	-I${SYSDIR}/crypto/skein
-CFLAGS+=	-DEFI_ZFS_BOOT
-.endif
 CFLAGS+=	-DNO_PCI -DEFI
 
 .if !defined(BOOT_HIDE_SERIAL_NUMBERS)
@@ -142,9 +128,9 @@ loader.efi: ${PROG}
 
 LIBEFI=		${BOOTOBJ}/efi/libefi/libefi.a
 
-DPADD=		${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSA} \
+DPADD=		${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBZFSBOOT} ${LIBSA} \
 		${LDSCRIPT}
-LDADD=		${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSA}
+LDADD=		${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBZFSBOOT} ${LIBSA}
 
 .include <bsd.prog.mk>
 

Modified: head/sys/boot/i386/gptzfsboot/Makefile
==============================================================================
--- head/sys/boot/i386/gptzfsboot/Makefile	Mon Oct 30 23:14:53 2017	(r325174)
+++ head/sys/boot/i386/gptzfsboot/Makefile	Mon Oct 30 23:14:59 2017	(r325175)
@@ -4,7 +4,7 @@
 
 .PATH:		${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/gptboot \
 		${BOOTSRC}/i386/zfsboot ${BOOTSRC}/i386/common \
-		${SYSDIR}/crypto/skein ${SASRC}
+		${SASRC}
 
 FILES=		gptzfsboot
 MAN=		gptzfsboot.8
@@ -27,9 +27,8 @@ CFLAGS+=-DBOOTPROG=\"gptzfsboot\" \
 	-DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
 	-I${LDRSRC} \
 	-I${BOOTSRC}/i386/common \
-	-I${BOOTSRC}/zfs \
+	-I${ZFSSRC} \
 	-I${SYSDIR}/cddl/boot/zfs \
-	-I${SYSDIR}/crypto/skein \
 	-I${BOOTSRC}/i386/btx/lib -I. \
 	-I${BOOTSRC}/i386/boot2 \
 	-I${SYSDIR} \
@@ -45,8 +44,11 @@ NO_WCAST_ALIGN=
 CFLAGS+=	-Wno-tentative-definition-incomplete-type
 .endif
 
-# Do not unroll skein loops, reduce code size
-CFLAGS+=	-DSKEIN_LOOP=111
+.if ${MACHINE} == "amd64"
+LIBZFSBOOT=${BOOTOBJ}/zfs32/libzfsboot.a
+.else
+LIBZFSBOOT=${BOOTOBJ}/zfs/libzfsboot.a
+.endif
 
 .if ${LOADER_GELI_SUPPORT:Uyes} == "yes"
 CFLAGS+=	-DLOADER_GELI_SUPPORT
@@ -75,16 +77,16 @@ gptldr.out: gptldr.o
 	${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
 
 CLEANFILES+=	gptzfsboot.bin gptzfsboot.out zfsboot.o sio.o cons.o \
-		drv.o gpt.o util.o skein.o skein_block.o ${OPENCRYPTO_XTS}
+		drv.o gpt.o util.o ${OPENCRYPTO_XTS}
 
 gptzfsboot.bin: gptzfsboot.out
 	${OBJCOPY} -S -O binary gptzfsboot.out ${.TARGET}
 
 gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o util.o \
-	skein.o skein_block.o ${OPENCRYPTO_XTS}
-	${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSA32}
+	${OPENCRYPTO_XTS}
+	${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBZFSBOOT} ${LIBSA32}
 
-zfsboot.o: ${BOOTSRC}/zfs/zfsimpl.c
+zfsboot.o: ${ZFSSRC}/zfsimpl.c
 
 .if ${MACHINE_CPUARCH} == "amd64"
 beforedepend zfsboot.o: machine

Modified: head/sys/boot/i386/libi386/Makefile
==============================================================================
--- head/sys/boot/i386/libi386/Makefile	Mon Oct 30 23:14:53 2017	(r325174)
+++ head/sys/boot/i386/libi386/Makefile	Mon Oct 30 23:14:59 2017	(r325175)
@@ -11,8 +11,8 @@ SRCS=	biosacpi.c bioscd.c biosdisk.c biosmem.c biospnp
 	elf64_freebsd.c multiboot.c multiboot_tramp.S relocater_tramp.S \
 	i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \
 	smbios.c time.c vidconsole.c amd64_tramp.S spinconsole.c
-.PATH:	${BOOTSRC}/zfs
-SRCS+=	devicename_stubs.c
+.PATH:	${ZFSSRC}
+SRCS+=  devicename_stubs.c
 
 BOOT_COMCONSOLE_PORT?= 0x3f8
 CFLAGS+=	-DCOMPORT=${BOOT_COMCONSOLE_PORT}

Modified: head/sys/boot/i386/loader/Makefile
==============================================================================
--- head/sys/boot/i386/loader/Makefile	Mon Oct 30 23:14:53 2017	(r325174)
+++ head/sys/boot/i386/loader/Makefile	Mon Oct 30 23:14:59 2017	(r325175)
@@ -31,7 +31,11 @@ LIBFIREWIRE=	${BOOTSRC}/i386/libfirewire/libfirewire.a
 # Set by zfsloader Makefile
 .if defined(LOADER_ZFS_SUPPORT)
 CFLAGS+=	-DLOADER_ZFS_SUPPORT
+.if ${MACHINE} == "amd64"
+LIBZFSBOOT=	${BOOTOBJ}/zfs32/libzfsboot.a
+.else
 LIBZFSBOOT=	${BOOTOBJ}/zfs/libzfsboot.a
+.endif
 .endif
 
 # Include bcache code.

Modified: head/sys/boot/i386/zfsboot/Makefile
==============================================================================
--- head/sys/boot/i386/zfsboot/Makefile	Mon Oct 30 23:14:53 2017	(r325174)
+++ head/sys/boot/i386/zfsboot/Makefile	Mon Oct 30 23:14:59 2017	(r325175)
@@ -4,8 +4,7 @@ LOADER_GELI_SUPPORT=no
 
 .include <bsd.init.mk>
 
-.PATH:		${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/common \
-		${SYSDIR}/crypto/skein ${SASRC}
+.PATH:		${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/common ${SASRC}
 
 FILES=		zfsboot
 MAN=		zfsboot.8
@@ -29,9 +28,8 @@ CFLAGS+=-DBOOTPROG=\"zfsboot\" \
 	-I${LDRSRC} \
 	-I${BOOTSRC}/i386/common \
 	-I${BOOTSRC}/i386 \
-	-I${BOOTSRC}/zfs \
+	-I${ZFSSRC} \
 	-I${SYSDIR}/cddl/boot/zfs \
-	-I${SYSDIR}/crypto/skein \
 	-I${BTXLIB} -I. \
 	-I${BOOTSRC}/i386/boot2 \
 	-Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \
@@ -40,8 +38,11 @@ CFLAGS+=-DBOOTPROG=\"zfsboot\" \
 	-Winline
 
 CFLAGS.gcc+=	--param max-inline-insns-single=100
-# Do not unroll skein loops, reduce code size
-CFLAGS+=	-DSKEIN_LOOP=111
+.if ${MACHINE} == "amd64"
+LIBZFSBOOT=${BOOTOBJ}/zfs32/libzfsboot.a
+.else
+LIBZFSBOOT=${BOOTOBJ}/zfs/libzfsboot.a
+.endif
 
 LD_FLAGS+=${LD_FLAGS_BIN}
 
@@ -59,8 +60,7 @@ zfsldr.out: zfsldr.o
 	${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} zfsldr.o
 
 CLEANFILES+=	zfsboot2 zfsboot.ld zfsboot.ldr zfsboot.bin zfsboot.out \
-		zfsboot.o zfsboot.s zfsboot.s.tmp sio.o cons.o drv.o util.o \
-		skein.o skein_block.o
+		zfsboot.o zfsboot.s zfsboot.s.tmp sio.o cons.o drv.o util.o
 
 # We currently allow 128k bytes for zfsboot - in practice it could be
 # any size up to 3.5Mb but keeping it fixed size simplifies zfsldr.
@@ -82,8 +82,8 @@ zfsboot.ldr:
 zfsboot.bin: zfsboot.out
 	${OBJCOPY} -S -O binary zfsboot.out ${.TARGET}
 
-zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o util.o skein.o skein_block.o
-	${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSA32}
+zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o util.o
+	${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBZFSBOOT} ${LIBSA32}
 
 SRCS=	zfsboot.c
 

Modified: head/sys/boot/ofw/libofw/Makefile
==============================================================================
--- head/sys/boot/ofw/libofw/Makefile	Mon Oct 30 23:14:53 2017	(r325174)
+++ head/sys/boot/ofw/libofw/Makefile	Mon Oct 30 23:14:59 2017	(r325175)
@@ -8,7 +8,7 @@ INTERNALLIB=
 SRCS=	devicename.c elf_freebsd.c ofw_console.c ofw_copy.c ofw_disk.c \
 	ofw_memory.c ofw_module.c ofw_net.c ofw_reboot.c \
 	ofw_time.c openfirm.c
-.PATH:	${BOOTSRC}/zfs
+.PATH:	${ZFSSRC}
 SRCS+=  devicename_stubs.c
 
 # Pick up the bootstrap header for some interface items

Modified: head/sys/boot/sparc64/loader/Makefile
==============================================================================
--- head/sys/boot/sparc64/loader/Makefile	Mon Oct 30 23:14:53 2017	(r325174)
+++ head/sys/boot/sparc64/loader/Makefile	Mon Oct 30 23:14:59 2017	(r325175)
@@ -30,7 +30,7 @@ CFLAGS+=	-DLOADER_DEBUG
 .endif
 .if ${LOADER_ZFS_SUPPORT} == "yes"
 CFLAGS+=	-DLOADER_ZFS_SUPPORT
-CFLAGS+=	-I${BOOTSRC}/zfs
+CFLAGS+=	-I${ZFSSRC}
 CFLAGS+=	-I${SYSDIR}/cddl/boot/zfs
 LIBZFSBOOT=	${BOOTOBJ}/zfs/libzfsboot.a
 .endif

Modified: head/sys/boot/userboot/Makefile
==============================================================================
--- head/sys/boot/userboot/Makefile	Mon Oct 30 23:14:53 2017	(r325174)
+++ head/sys/boot/userboot/Makefile	Mon Oct 30 23:14:59 2017	(r325175)
@@ -2,7 +2,7 @@
 
 .include <bsd.own.mk>
 
-SUBDIR=		test zfs userboot
+SUBDIR=		test userboot
 
 .include <bsd.subdir.mk>
 

Modified: head/sys/boot/userboot/userboot/Makefile
==============================================================================
--- head/sys/boot/userboot/userboot/Makefile	Mon Oct 30 23:14:53 2017	(r325174)
+++ head/sys/boot/userboot/userboot/Makefile	Mon Oct 30 23:14:59 2017	(r325175)
@@ -47,7 +47,7 @@ NEWVERSWHAT=	"User boot" ${MACHINE_CPUARCH}
 
 .if ${MK_ZFS} != "no"
 CFLAGS+=	-DUSERBOOT_ZFS_SUPPORT
-LIBZFSBOOT=	${BOOTOBJ}/userboot/zfs/libzfsboot.a
+LIBZFSBOOT=	${BOOTOBJ}/zfs/libzfsboot.a
 .endif
 
 # Always add MI sources 

Modified: head/sys/boot/zfs/Makefile
==============================================================================
--- head/sys/boot/zfs/Makefile	Mon Oct 30 23:14:53 2017	(r325174)
+++ head/sys/boot/zfs/Makefile	Mon Oct 30 23:14:59 2017	(r325175)
@@ -5,9 +5,8 @@
 LIB=		zfsboot
 INTERNALLIB=
 
-SRCS+=		zfs.c
-
-SRCS+=		skein.c skein_block.c
+.PATH:		${ZFSSRC}
+SRCS+=		zfs.c skein.c skein_block.c
 # Do not unroll skein loops, reduce code size
 CFLAGS+=	-DSKEIN_LOOP=111
 .PATH:		${SYSDIR}/crypto/skein
@@ -17,16 +16,17 @@ CFLAGS+=	-I${LDRSRC} -I${SYSDIR} -I.
 CFLAGS+=	-I${SYSDIR}/cddl/boot/zfs
 CFLAGS+=	-I${SYSDIR}/crypto/skein
 
-.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "i386" || \
+	(${MACHINE_CPUARCH} == "amd64" && defined(ZFS32))
 CFLAGS+=	-march=i386
 .endif
-.if ${MACHINE_CPUARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64" && defined(ZFS32)
 CFLAGS+=	-m32
 .endif
 
 CFLAGS+=	-Wformat -Wall
 
-.if ${MACHINE_CPUARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64" && defined(ZFS32)
 CLEANFILES+=    machine
 machine: .NOMETA
 	ln -sf ${SYSDIR}/i386/include machine
@@ -35,7 +35,7 @@ machine: .NOMETA
 .include <bsd.stand.mk>
 .include <bsd.lib.mk>
 
-.if ${MACHINE_CPUARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64" && defined(ZFS32)
 .if !exists(machine)
 beforedepend ${OBJS}: machine
 .endif



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201710302314.v9UNExnn026034>