From 47804274694dd189e97c7b255af29a544730dd6e Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Mon, 6 Nov 2017 15:21:51 +0000 Subject: [PATCH] Use DO32 for all the places that we need to flag we're building a 32 bit version of a library. Use a generic name since this may be usefule elsewhere. Sponsored by: Netflix --- sys/boot/ficl.mk | 6 +++--- sys/boot/ficl/Makefile | 6 +++++- sys/boot/ficl32/Makefile | 2 +- sys/boot/libsa32/Makefile | 2 ++ sys/boot/zfs/Makefile | 8 ++++---- sys/boot/zfs32/Makefile | 2 +- 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/sys/boot/ficl.mk b/sys/boot/ficl.mk index c26787b914ce..3c74e3495979 100644 --- a/sys/boot/ficl.mk +++ b/sys/boot/ficl.mk @@ -4,7 +4,7 @@ .include "defs.mk" -.if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32) +.if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 1 FICL_CPUARCH= i386 .elif ${MACHINE_ARCH:Mmips64*} != "" FICL_CPUARCH= mips64 @@ -15,7 +15,7 @@ FICL_CPUARCH= ${MACHINE_CPUARCH} .PATH: ${FICLSRC} ${FICLSRC}/${FICL_CPUARCH} .if ${MACHINE_CPUARCH} == "amd64" -.if defined(FICL32) +.if ${DO32:U0} == 1 CFLAGS+= -m32 -I. .else CFLAGS+= -fPIC @@ -30,7 +30,7 @@ CFLAGS+= -I${FICLSRC} -I${FICLSRC}/${FICL_CPUARCH} -I${LDRSRC} CFLAGS+= -DBOOT_FORTH CFLAGS+= -DBF_DICTSIZE=15000 -.if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32) +.if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 1 .if !exists(machine) ${SRCS:M*.c:R:S/$/.o/g}: machine diff --git a/sys/boot/ficl/Makefile b/sys/boot/ficl/Makefile index ce0cbe6e395c..19c2da8eb197 100644 --- a/sys/boot/ficl/Makefile +++ b/sys/boot/ficl/Makefile @@ -10,9 +10,13 @@ BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c math64.c \ SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES= softcore.c testmain testmain.o .if ${MACHINE_CPUARCH} == "i386" || \ - (${MACHINE_CPUARCH} == "amd64" && defined(FICL32)) + (${MACHINE_CPUARCH} == "amd64" && defined(DO32)) CFLAGS+= -march=i386 .endif +.if ${MACHINE_CPUARCH} == "amd64" && defined(DO32) +CFLAGS+= -m32 +.endif + .if defined(HAVE_PNP) CFLAGS+= -DHAVE_PNP .endif diff --git a/sys/boot/ficl32/Makefile b/sys/boot/ficl32/Makefile index b27a339bc2ab..09499464ac89 100644 --- a/sys/boot/ficl32/Makefile +++ b/sys/boot/ficl32/Makefile @@ -1,5 +1,5 @@ # $FreeBSD$ -FICL32= +DO32=1 .include "${.CURDIR}/../ficl/Makefile" diff --git a/sys/boot/libsa32/Makefile b/sys/boot/libsa32/Makefile index 9338a0fe15d6..d4552fbf50b4 100644 --- a/sys/boot/libsa32/Makefile +++ b/sys/boot/libsa32/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +DO32=1 + .include LIB=sa32 diff --git a/sys/boot/zfs/Makefile b/sys/boot/zfs/Makefile index 24d0773479db..d06464354fca 100644 --- a/sys/boot/zfs/Makefile +++ b/sys/boot/zfs/Makefile @@ -17,16 +17,16 @@ CFLAGS+= -I${SYSDIR}/cddl/boot/zfs CFLAGS+= -I${SYSDIR}/crypto/skein .if ${MACHINE_CPUARCH} == "i386" || \ - (${MACHINE_CPUARCH} == "amd64" && defined(ZFS32)) + (${MACHINE_CPUARCH} == "amd64" && defined(DO32)) CFLAGS+= -march=i386 .endif -.if ${MACHINE_CPUARCH} == "amd64" && defined(ZFS32) +.if ${MACHINE_CPUARCH} == "amd64" && defined(DO32) CFLAGS+= -m32 .endif CFLAGS+= -Wformat -Wall -.if ${MACHINE_CPUARCH} == "amd64" && defined(ZFS32) +.if ${MACHINE_CPUARCH} == "amd64" && defined(DO32) CLEANFILES+= machine machine: .NOMETA ln -sf ${SYSDIR}/i386/include machine @@ -35,7 +35,7 @@ machine: .NOMETA .include .include -.if ${MACHINE_CPUARCH} == "amd64" && defined(ZFS32) +.if ${MACHINE_CPUARCH} == "amd64" && defined(DO32) .if !exists(machine) beforedepend ${OBJS}: machine .endif diff --git a/sys/boot/zfs32/Makefile b/sys/boot/zfs32/Makefile index 2af3987486e8..32d0074ad340 100644 --- a/sys/boot/zfs32/Makefile +++ b/sys/boot/zfs32/Makefile @@ -1,5 +1,5 @@ # $FreeBSD$ -ZFS32=1 +DO32=1 .include "${.CURDIR}/../zfs/Makefile"