aboutsummaryrefslogtreecommitdiff
path: root/sys/boot/defs.mk
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/defs.mk
parent9b19f65c83aa290548baeef1f60ff011bd54f28f (diff)
downloadsrc-63c69e1beba1cb7cd161e511b04d47a875a9a3b8.tar.gz
src-63c69e1beba1cb7cd161e511b04d47a875a9a3b8.zip
Centralize all 32-bit builds on 64-bit platform stuff.
Move the addition of the -m32 and other flags to defs.mk. Remove redunant copies of -m32 that come from multiple locations. Sponsored by: Netflix
Notes
Notes: svn path=/head/; revision=325485
Diffstat (limited to 'sys/boot/defs.mk')
-rw-r--r--sys/boot/defs.mk10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/boot/defs.mk b/sys/boot/defs.mk
index 4fbc83966dc6..75c354c6254a 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}