Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Sep 2024 14:59:17 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: f0d5b1bdf075 - main - stand/efi: Add a 32-bit variant of libefi
Message-ID:  <202409201459.48KExHBL046620@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=f0d5b1bdf075c68ddb1dcfbc5a0eda0214510b5b

commit f0d5b1bdf075c68ddb1dcfbc5a0eda0214510b5b
Author:     Ahmad Khalifa <ahmadkhalifa570@gmail.com>
AuthorDate: 2024-05-14 19:37:13 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-09-20 14:45:05 +0000

    stand/efi: Add a 32-bit variant of libefi
    
    In preparation for supporting 64-bit machines with 32-bit UEFI firmware,
    add a 32-bit variant of libefi since we need to compile both the 64-bit
    version and the 32-bit version at the same time.
    
    Reviewed by: imp
    Pull Request: https://github.com/freebsd/freebsd-src/pull/1098
---
 stand/Makefile              |  1 +
 stand/defs.mk               | 10 +++++++---
 stand/efi/Makefile          |  1 +
 stand/efi/libefi32/Makefile |  4 ++++
 4 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/stand/Makefile b/stand/Makefile
index 225113384b13..ce91802d4a8b 100644
--- a/stand/Makefile
+++ b/stand/Makefile
@@ -66,6 +66,7 @@ SUBDIR_DEPEND_${MACHINE}+=	libofw
 SUBDIR+=${_x}
 .if defined(LIB32LIST) && ${LIB32LIST:M${_x}}
 SUBDIR+=${_x}32
+INTERP_DEPENDS+=${_x}32
 .endif
 .if ${_x} != "libsa"
 SUBDIR_DEPEND_${_x}+=	libsa
diff --git a/stand/defs.mk b/stand/defs.mk
index bd19c8d8e125..0e84df0f4633 100644
--- a/stand/defs.mk
+++ b/stand/defs.mk
@@ -40,7 +40,14 @@ WARNS?=		1
 BOOTSRC=	${SRCTOP}/stand
 EFISRC=		${BOOTSRC}/efi
 EFIINC=		${EFISRC}/include
+# For amd64, there's a bit of mixed bag. Some of the tree (i386, lib*32) is
+# built 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
+EFIINCMD=	${EFIINC}/i386
+.else
 EFIINCMD=	${EFIINC}/${MACHINE}
+.endif
 FDTSRC=		${BOOTSRC}/fdt
 FICLSRC=	${BOOTSRC}/ficl
 LDRSRC=		${BOOTSRC}/common
@@ -130,9 +137,6 @@ CFLAGS+=	-m32 -mcpu=powerpc -mbig-endian
 CFLAGS+=	-m32 -mcpu=powerpc -mlittle-endian
 .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
 # LD_FLAGS is passed directly to ${LD}, not via ${CC}:
diff --git a/stand/efi/Makefile b/stand/efi/Makefile
index c6ef92b26838..1a9cf68749a1 100644
--- a/stand/efi/Makefile
+++ b/stand/efi/Makefile
@@ -3,6 +3,7 @@ NO_OBJ=t
 .include <bsd.init.mk>
 
 SUBDIR.yes+=	libefi
+SUBDIR.${MK_LOADER_IA32}+=	libefi32
 SUBDIR.${MK_FDT}+=	fdt
 SUBDIR.yes+=	.WAIT
 
diff --git a/stand/efi/libefi32/Makefile b/stand/efi/libefi32/Makefile
new file mode 100644
index 000000000000..779c7e604686
--- /dev/null
+++ b/stand/efi/libefi32/Makefile
@@ -0,0 +1,4 @@
+DO32=1
+
+.PATH:	${.CURDIR}/../libefi
+.include "${.CURDIR}/../libefi/Makefile"



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