aboutsummaryrefslogtreecommitdiff
path: root/sys/boot
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2017-11-06 15:22:24 +0000
committerWarner Losh <imp@FreeBSD.org>2017-11-06 15:22:24 +0000
commit63c69e1beba1cb7cd161e511b04d47a875a9a3b8 (patch)
tree5f7701575cad75e81b9076a92b2dd0e83471774e /sys/boot
parent9b19f65c83aa290548baeef1f60ff011bd54f28f (diff)
Notes
Diffstat (limited to 'sys/boot')
-rw-r--r--sys/boot/defs.mk10
-rw-r--r--sys/boot/fdt/Makefile4
-rw-r--r--sys/boot/ficl.mk10
-rw-r--r--sys/boot/ficl/Makefile7
-rw-r--r--sys/boot/geli/Makefile2
-rw-r--r--sys/boot/i386/Makefile.inc5
-rw-r--r--sys/boot/libsa32/Makefile10
-rw-r--r--sys/boot/ofw/Makefile.inc5
-rw-r--r--sys/boot/uboot/Makefile.inc5
-rw-r--r--sys/boot/zfs/Makefile8
10 files changed, 14 insertions, 52 deletions
diff --git a/sys/boot/defs.mk b/sys/boot/defs.mk
index 4fbc83966dc60..75c354c6254ae 100644
--- a/sys/boot/defs.mk
+++ b/sys/boot/defs.mk
@@ -96,6 +96,16 @@ CFLAGS+= -DLOADER_GELI_SUPPORT
CFLAGS+= -m32 -mcpu=powerpc
.endif
+# For amd64, there's a bit of mixed bag. Some of the tree (i386, lib*32) is
+# build 32-bit and some 64-bit (lib*, efi). Centralize all the 32-bit magic here
+# and activate it when DO32 is explicitly defined to be 1.
+.if ${MACHINE_ARCH} == "amd64" && ${DO32:U0} == 1
+CFLAGS+= -m32 -mcpu=i386
+# LD_FLAGS is passed directly to ${LD}, not via ${CC}:
+LD_FLAGS+= -m elf_i386_fbsd
+AFLAGS+= --32
+.endif
+
_ILINKS=machine
.if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64"
_ILINKS+=${MACHINE_CPUARCH}
diff --git a/sys/boot/fdt/Makefile b/sys/boot/fdt/Makefile
index 467e424c2baf1..a725499d2f78e 100644
--- a/sys/boot/fdt/Makefile
+++ b/sys/boot/fdt/Makefile
@@ -22,10 +22,6 @@ CFLAGS+= -ffreestanding
CFLAGS+= -msoft-float
.endif
-.if ${MACHINE_ARCH} == "powerpc64"
-CFLAGS+= -m32
-.endif
-
CFLAGS+= -Wformat -Wall
.include <bsd.stand.mk>
diff --git a/sys/boot/ficl.mk b/sys/boot/ficl.mk
index b6ac8d9096b04..a0a13206b495a 100644
--- a/sys/boot/ficl.mk
+++ b/sys/boot/ficl.mk
@@ -14,17 +14,9 @@ FICL_CPUARCH= ${MACHINE_CPUARCH}
.PATH: ${FICLSRC} ${FICLSRC}/${FICL_CPUARCH}
-.if ${MACHINE_CPUARCH} == "amd64"
-.if ${DO32:U0} == 1
-CFLAGS+= -m32 -I.
-.else
+.if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 0
CFLAGS+= -fPIC
.endif
-.endif
-
-.if ${MACHINE_ARCH} == "powerpc64"
-CFLAGS+= -m32 -mcpu=powerpc -I.
-.endif
CFLAGS+= -I${FICLSRC} -I${FICLSRC}/${FICL_CPUARCH} -I${LDRSRC}
CFLAGS+= -DBOOT_FORTH
diff --git a/sys/boot/ficl/Makefile b/sys/boot/ficl/Makefile
index 19c2da8eb1972..e32e3909687d6 100644
--- a/sys/boot/ficl/Makefile
+++ b/sys/boot/ficl/Makefile
@@ -9,13 +9,6 @@ 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(DO32))
-CFLAGS+= -march=i386
-.endif
-.if ${MACHINE_CPUARCH} == "amd64" && defined(DO32)
-CFLAGS+= -m32
-.endif
.if defined(HAVE_PNP)
CFLAGS+= -DHAVE_PNP
diff --git a/sys/boot/geli/Makefile b/sys/boot/geli/Makefile
index 84ac9bdf6698c..b16f7a8c5ab37 100644
--- a/sys/boot/geli/Makefile
+++ b/sys/boot/geli/Makefile
@@ -14,7 +14,7 @@ NO_PIC=
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -march=i386
.endif
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64"
+.if ${MACHINE_ARCH} == "amd64"
CFLAGS+= -m32
.endif
diff --git a/sys/boot/i386/Makefile.inc b/sys/boot/i386/Makefile.inc
index 941a8c49ab9b2..b324d1adfef59 100644
--- a/sys/boot/i386/Makefile.inc
+++ b/sys/boot/i386/Makefile.inc
@@ -25,11 +25,6 @@ LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary
LD_FLAGS_BIN=-static -N --gc-sections
.if ${MACHINE_CPUARCH} == "amd64"
-CFLAGS+= -m32
-ACFLAGS+= -m32
-# LD_FLAGS is passed directly to ${LD}, not via ${CC}:
-LD_FLAGS+= -m elf_i386_fbsd
-AFLAGS+= --32
DO32=1
.endif
diff --git a/sys/boot/libsa32/Makefile b/sys/boot/libsa32/Makefile
index 862f8868beab0..f09811b62128b 100644
--- a/sys/boot/libsa32/Makefile
+++ b/sys/boot/libsa32/Makefile
@@ -5,15 +5,9 @@ DO32=1
.include <bsd.init.mk>
LIB=sa32
-.if ${MACHINE_CPUARCH} == "amd64"
-LIBSA_CPUARCH=i386
-.else
-LIBSA_CPUARCH=${MACHINE_CPUARCH}
-.endif
+LIBSA_CPUARCH=${MACHINE_CPUARCH:C/amd64/i386/}
-.if ${MACHINE_ARCH} == "amd64"
-CFLAGS+= -m32 -I.
-.endif
+CFLAGS+= -I.
.PATH: ${SASRC}
.include "${SASRC}/Makefile"
diff --git a/sys/boot/ofw/Makefile.inc b/sys/boot/ofw/Makefile.inc
index e67c0dc904eba..265f86d1ed55a 100644
--- a/sys/boot/ofw/Makefile.inc
+++ b/sys/boot/ofw/Makefile.inc
@@ -1,8 +1,3 @@
# $FreeBSD$
-.if ${MACHINE_ARCH} == "powerpc64"
-CFLAGS+= -m32 -mcpu=powerpc
-LDFLAGS+= -m elf32ppc_fbsd
-.endif
-
.include "../Makefile.inc"
diff --git a/sys/boot/uboot/Makefile.inc b/sys/boot/uboot/Makefile.inc
index e67c0dc904eba..265f86d1ed55a 100644
--- a/sys/boot/uboot/Makefile.inc
+++ b/sys/boot/uboot/Makefile.inc
@@ -1,8 +1,3 @@
# $FreeBSD$
-.if ${MACHINE_ARCH} == "powerpc64"
-CFLAGS+= -m32 -mcpu=powerpc
-LDFLAGS+= -m elf32ppc_fbsd
-.endif
-
.include "../Makefile.inc"
diff --git a/sys/boot/zfs/Makefile b/sys/boot/zfs/Makefile
index 478e168ef3689..7575aa9207ebb 100644
--- a/sys/boot/zfs/Makefile
+++ b/sys/boot/zfs/Makefile
@@ -16,14 +16,6 @@ CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I.
CFLAGS+= -I${SYSDIR}/cddl/boot/zfs
CFLAGS+= -I${SYSDIR}/crypto/skein
-.if ${MACHINE_CPUARCH} == "i386" || \
- (${MACHINE_CPUARCH} == "amd64" && defined(DO32))
-CFLAGS+= -march=i386
-.endif
-.if ${MACHINE_CPUARCH} == "amd64" && defined(DO32)
-CFLAGS+= -m32
-.endif
-
CFLAGS+= -Wformat -Wall
.include <bsd.stand.mk>