diff --git a/stand/efi/Makefile b/stand/efi/Makefile --- a/stand/efi/Makefile +++ b/stand/efi/Makefile @@ -3,12 +3,18 @@ .include SUBDIR.yes+= libefi -SUBDIR.${MK_LOADER_IA32}+= libefi32 +SUBDIR.${MK_LOADER_IA32}+= libsa32 libefi32 SUBDIR.${MK_FDT}+= fdt SUBDIR.yes+= .WAIT SUBDIR.yes+= boot1 gptboot +.if ${LOADER_DEFAULT_INTERP} == "lua" +SUBDIR.${MK_LOADER_IA32}+= liblua32 +.elif ${LOADER_DEFAULT_INTERP} == "4th" +SUBDIR.${MK_LOADER_IA32}+= ficl32 +.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 --- a/stand/efi/Makefile.inc +++ b/stand/efi/Makefile.inc @@ -8,6 +8,9 @@ .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -fshort-wchar CFLAGS+= -mno-red-zone +# This is needed so the EDK2 EFI structs have the correct layout for +# the ia32 loader. For the 64-bit amd64 loader, it has no effect. +CFLAGS+= -malign-double .endif .if ${MACHINE_CPUARCH} == "aarch64" diff --git a/stand/efi/ficl32/Makefile b/stand/efi/ficl32/Makefile new file mode 100644 --- /dev/null +++ b/stand/efi/ficl32/Makefile @@ -0,0 +1,3 @@ +DO32=1 + +.include "${.CURDIR}/../../ficl/Makefile" diff --git a/stand/efi/liblua32/Makefile b/stand/efi/liblua32/Makefile new file mode 100644 --- /dev/null +++ b/stand/efi/liblua32/Makefile @@ -0,0 +1,3 @@ +DO32=1 + +.include "${.CURDIR}/../../liblua/Makefile" diff --git a/stand/efi/libsa32/Makefile b/stand/efi/libsa32/Makefile new file mode 100644 --- /dev/null +++ b/stand/efi/libsa32/Makefile @@ -0,0 +1 @@ +.include "${.CURDIR}/../../libsa32/Makefile" diff --git a/stand/efi/loader/Makefile b/stand/efi/loader/Makefile --- a/stand/efi/loader/Makefile +++ b/stand/efi/loader/Makefile @@ -99,6 +99,11 @@ # Always add MI sources .include "${BOOTSRC}/loader.mk" +# Make these point to the EFI versions. +LIBSA32:= ${LIBSA32:S/${BOOTOBJ}/${BOOTOBJ}\/efi/1} +LIBLUA32:= ${LIBLUA32:S/${BOOTOBJ}/${BOOTOBJ}\/efi/1} +LIBFICL32:= ${LIBFICL32:S/${BOOTOBJ}/${BOOTOBJ}\/efi/1} + CLEANFILES+= 8x16.c 8x16.c: ${SRCTOP}/contrib/terminus/ter-u16b.bdf