[PATCH 01/11] Makefile: Put x86-specifics under ARCH_IS_X86 condition

2 views
Skip to first unread message

Jan Kiszka

unread,
Jun 20, 2022, 9:30:07 AM6/20/22
to efibootg...@googlegroups.com, Christian Storm
From: Jan Kiszka <jan.k...@siemens.com>

This simplifies the addition of ARM by make x86 special, rather than
arm64.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>
---
Makefile.am | 15 ++++++++-------
configure.ac | 1 +
2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 7398b85..ad0bfac 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -147,9 +147,8 @@ bin_SCRIPTS = tools/bg_gen_unified_kernel
efi_loadername = efibootguard$(MACHINE_TYPE_NAME).efi

if BOOTLOADER
-if ARCH_AARCH64
-efi_sources_watchdogs =
-else
+
+if ARCH_IS_X86
# NOTE: wdat.c is placed first so it is tried before any other drivers
# NOTE: ipc4x7e_wdt.c must be *before* itco.c
efi_sources_watchdogs = \
@@ -160,6 +159,8 @@ efi_sources_watchdogs = \
drivers/watchdog/ipc4x7e_wdt.c \
drivers/watchdog/itco.c \
drivers/watchdog/hpwdt.c
+else
+efi_sources_watchdogs =
endif

efi_sources = \
@@ -220,13 +221,13 @@ efi_ldflags = \
-L $(GNUEFI_LIB_DIR) \
$(GNUEFI_LIB_DIR)/crt0-efi-$(ARCH).o

-if ARCH_AARCH64
-# aarch64's objcopy doesn't understand --target efi-[app|bsdrv|rtdrv],
+if ARCH_IS_X86
+objcopy_format = --target=efi-app-$(ARCH)
+else
+# aarch64's and arm's objcopy don't understand --target efi-[app|bsdrv|rtdrv],
# hence set subsystem 0xa (EFI application) and binary format.
objcopy_format = -O binary
efi_ldflags += --defsym=EFI_SUBSYSTEM=0xa
-else
-objcopy_format = --target=efi-app-$(ARCH)
endif

efi_objects_pre1 = $(efi_sources:.c=.o)
diff --git a/configure.ac b/configure.ac
index 371fc9b..0f079bb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -101,6 +101,7 @@ AM_COND_IF(ARCH_AARCH64, [

AC_SUBST([ARCH])
AC_SUBST([MACHINE_TYPE_NAME])
+AM_CONDITIONAL([ARCH_IS_X86], [test "$ARCH" = "ia32" -o "$ARCH" = "x86_64"])

# Checks from autoscan:
AC_CHECK_FUNCS([getmntent])
--
2.35.3

Reply all
Reply to author
Forward
0 new messages