From nobody Sat May 30 02:45:11 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gS4MW65p1z6f44J for ; Sat, 30 May 2026 02:45:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gS4MW3tXjz3NS9 for ; Sat, 30 May 2026 02:45:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780109111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dof4Zy1EPJf+0KkKzNyWuLP3ZIMO6Ew1P/VQdp2PRl4=; b=exfmWhOHorXpa8OlMI98ppQFgOzdWBDM4679m6n5DSh2DgL9ELdGanlhcR4Y0bNY3aqmxa hHP/5lx7HgvmzuSofQBQLUwZfgbLJsUvpD07WRFjzTaa+hVycbZRwXY/SNMWkpZTditJ7c DVz2/LmAhuJ8UhduLuArfbzxdzcIFeUhAeX+y9WXlOXN9KXh0NWiTwNCgDtCSZT58LPPGb 1KK610aWKU3P758dy+j8wLSBFKJk1qzvQjH/zHdKBJbptUhQanqLM+qS5OMxywufZYkyCx TD9zhJJqI5ghJXJjlyIxFXs9P7RJKzfjpHDS1YDlVFU+6h/rs5H3FFJmSLP4tw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1780109111; a=rsa-sha256; cv=none; b=XpCb+X/V1XbqsV98MKFtA9r0YWqmuHUxIbidkcKjYr8qfMl7EEPQs3Xsa7C+FdYaDfOXO8 s9EUUc28xI4aP3imrzMfmCBh1xV8X4g8ZICjdRJ3OnXjg9TZh9o0rIL8q8x5UHZbb8qqbX uwZCB5HTXSjm8mDP5KToI6nfccJHnhla8Yao8uSO4znOlR+978KSSE1jBR0hiN+eb3T8PS jfLHl2WHo5oRmj0xLYSgLzBYr8BdZeq2aGM7WgR0EARMcIfe+YLBQTkamzAkQDu99q3cbN z1wg+vH4Dy8Rhf9ug0OF5md+dLtQoyXJUKY0XKmPadl3tvTahwL8ULUWjF061Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780109111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dof4Zy1EPJf+0KkKzNyWuLP3ZIMO6Ew1P/VQdp2PRl4=; b=QWocURefz7ruQEUwCKp5aZmOTOU4sUjxiiYIEfJiSoiSWGr+zUJblUZimV+qRQ5wa/bnEu 1KgFcMSVy6w8RtAwftKzxsQ+cvjP0JTH7TbX1Ggk4oePi0supr2VMkH5rloULvk0wAShqg JP7Mw2XeMdn0CRysojoTx6CXvAVtN9PwESSTDrD1eQ0uKRYPWo6kKyRrvjGgR6nZ+018Ma +0ODj4Rs94/AFXZD4G90u0ij+sxaHfYxmH5lr4aj3pesnYTnE7XqW6AM4EFG9PMTpTlzeb pgdHqIJaWuRBi3uDwC0xNOEm0ryHgn+YbO4FfaWP+Dqbf29wvj953E5pN2bavw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gS4MW3BYvz11ZW for ; Sat, 30 May 2026 02:45:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 31c8e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 30 May 2026 02:45:11 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ahmad Khalifa Subject: git: d15cc7625dde - main - stand: compile ia32 EFI loader with -malign-double List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d15cc7625dde9bcb6a63ee59cccf14f3b93b15bf Auto-Submitted: auto-generated Date: Sat, 30 May 2026 02:45:11 +0000 Message-Id: <6a1a4f37.31c8e.265484b8@gitrepo.freebsd.org> The branch main has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=d15cc7625dde9bcb6a63ee59cccf14f3b93b15bf commit d15cc7625dde9bcb6a63ee59cccf14f3b93b15bf Author: Ahmad Khalifa AuthorDate: 2026-05-30 02:40:39 +0000 Commit: Ahmad Khalifa CommitDate: 2026-05-30 02:40:39 +0000 stand: compile ia32 EFI loader with -malign-double The UEFI spec says: > Structures are aligned on boundaries equal to the largest internal > datum of the structure and internal data are implicitly padded to > achieve natural alignment. Unlike the old Intel EFI toolkit, the EDK2 headers expect ia32 builds to use -malign-double to achive this. Make EFI versions of libsa32, liblua32, and ficl32. With the difference being that they are compiled with -malign-double. Differential Revision: https://reviews.freebsd.org/D55385 --- stand/defs.mk | 2 +- stand/efi/Makefile | 8 +++++++- stand/efi/Makefile.inc | 5 +++++ stand/efi/ficl32efi/Makefile | 3 +++ stand/efi/liblua32efi/Makefile | 3 +++ stand/efi/libsa32efi/Makefile | 1 + stand/loader.mk | 4 ++-- 7 files changed, 22 insertions(+), 4 deletions(-) diff --git a/stand/defs.mk b/stand/defs.mk index 7f3803c7ab42..ac4f38451111 100644 --- a/stand/defs.mk +++ b/stand/defs.mk @@ -78,7 +78,7 @@ LIBSA= ${BOOTOBJ}/libsa/libsa.a .if ${MACHINE} == "i386" LIBSA32= ${LIBSA} .else -LIBSA32= ${BOOTOBJ}/libsa32/libsa32.a +LIBSA32= ${BOOTOBJ}/${"${LOADER}" == "loader_ia32":?efi/libsa32efi:libsa32}/libsa32.a .endif # Standard options: diff --git a/stand/efi/Makefile b/stand/efi/Makefile index 1887b9536a5b..5ece7eff8ef2 100644 --- a/stand/efi/Makefile +++ b/stand/efi/Makefile @@ -3,12 +3,18 @@ NO_OBJ=t .include SUBDIR.yes+= libefi -SUBDIR.${MK_LOADER_IA32}+= libefi32 +SUBDIR.${MK_LOADER_IA32}+= libsa32efi libefi32 SUBDIR.${MK_FDT}+= fdt SUBDIR.yes+= .WAIT SUBDIR.yes+= boot1 gptboot +.if ${LOADER_DEFAULT_INTERP} == "lua" +SUBDIR.${MK_LOADER_IA32}+= liblua32efi +.elif ${LOADER_DEFAULT_INTERP} == "4th" +SUBDIR.${MK_LOADER_IA32}+= ficl32efi +.endif + SUBDIR.${MK_FORTH}+= loader_4th SUBDIR.${MK_LOADER_LUA}+= loader_lua SUBDIR.${MK_LOADER_IA32}+= loader_ia32 diff --git a/stand/efi/Makefile.inc b/stand/efi/Makefile.inc index 6bb0af1d84f3..452820aeeb32 100644 --- a/stand/efi/Makefile.inc +++ b/stand/efi/Makefile.inc @@ -8,6 +8,11 @@ LDFLAGS+= -nostdlib .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -fshort-wchar CFLAGS+= -mno-red-zone +.if ${DO32:U0} == 1 +# This is needed so the EDK2 EFI structs have the correct layout for +# the ia32 loader. +CFLAGS+= -malign-double +.endif .endif .if ${MACHINE_CPUARCH} == "aarch64" diff --git a/stand/efi/ficl32efi/Makefile b/stand/efi/ficl32efi/Makefile new file mode 100644 index 000000000000..63800cb0f209 --- /dev/null +++ b/stand/efi/ficl32efi/Makefile @@ -0,0 +1,3 @@ +DO32=1 + +.include "${.CURDIR}/../../ficl/Makefile" diff --git a/stand/efi/liblua32efi/Makefile b/stand/efi/liblua32efi/Makefile new file mode 100644 index 000000000000..cf391967ecf0 --- /dev/null +++ b/stand/efi/liblua32efi/Makefile @@ -0,0 +1,3 @@ +DO32=1 + +.include "${.CURDIR}/../../liblua/Makefile" diff --git a/stand/efi/libsa32efi/Makefile b/stand/efi/libsa32efi/Makefile new file mode 100644 index 000000000000..109c420bf734 --- /dev/null +++ b/stand/efi/libsa32efi/Makefile @@ -0,0 +1 @@ +.include "${.CURDIR}/../../libsa32/Makefile" diff --git a/stand/loader.mk b/stand/loader.mk index 496252e7a534..0d94ed3e6263 100644 --- a/stand/loader.mk +++ b/stand/loader.mk @@ -162,14 +162,14 @@ LIBFICL= ${BOOTOBJ}/ficl/libficl.a .if ${MACHINE} == "i386" LIBFICL32= ${LIBFICL} .else -LIBFICL32= ${BOOTOBJ}/ficl32/libficl.a +LIBFICL32= ${BOOTOBJ}/${"${LOADER}" == "loader_ia32":?efi/ficl32efi:ficl32}/libficl.a .endif LIBLUA= ${BOOTOBJ}/liblua/liblua.a .if ${MACHINE} == "i386" LIBLUA32= ${LIBLUA} .else -LIBLUA32= ${BOOTOBJ}/liblua32/liblua.a +LIBLUA32= ${BOOTOBJ}/${"${LOADER}" == "loader_ia32":?efi/liblua32efi:liblua32}/liblua.a .endif CLEANFILES+= vers.c