From: Jan Kiszka <[email protected]> Buildsystem-wise, we are ready now. We just need to append -mgeneraly-regs-only on modern gcc (e.g. with Debian 11) to ensure that no unsupported FPU instructions get used. We also want to suppress the for us meaningless warnings about mismatching wchar sizes - we do not use any of the functions (from the compiler runtime) that triggers this.
Signed-off-by: Jan Kiszka <[email protected]> --- Makefile.am | 12 ++++++++++++ configure.ac | 9 +++++++++ tools/tests/Makefile.am | 4 ++++ 3 files changed, 25 insertions(+) diff --git a/Makefile.am b/Makefile.am index 8d550ff..856908f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -110,6 +110,10 @@ lib_LTLIBRARIES = libebgenv.la libebgenv_la_SOURCES = $(libebgenv_a_SOURCES) libebgenv_la_LDFLAGS = -version-info 0:0:0 +if ARCH_ARM +libebgenv_la_LDFLAGS += -Wl,--no-wchar-size-warning +endif + # # bg_setenv binary # @@ -124,6 +128,10 @@ bg_setenv_SOURCES = \ bg_setenv_CFLAGS = \ $(AM_CFLAGS) -static +if ARCH_ARM +bg_setenv_LDFLAGS = -Wl,--no-wchar-size-warning +endif + bg_setenv_LDADD = \ $(top_builddir)/libebgenv.a \ -lz @@ -208,6 +216,10 @@ efi_cflags += \ -mno-mmx \ -mno-red-zone endif +if ARCH_ARM +efi_cflags += \ + $(CFLAGS_MGENERAL_REGS_ONLY) +endif efi_ldflags = \ -T $(GNUEFI_LIB_DIR)/elf_$(ARCH)_efi.lds \ diff --git a/configure.ac b/configure.ac index 0f079bb..d39b5fa 100644 --- a/configure.ac +++ b/configure.ac @@ -86,6 +86,7 @@ SET_ARCH(I586, i586*|i686*) SET_ARCH(X86_64, x86_64*) SET_ARCH(IA64, ia64*) SET_ARCH(AARCH64, aarch64*) +SET_ARCH(ARM, arm*) ARCH=$(echo $host | sed "s/\(-\).*$//") @@ -99,10 +100,18 @@ AM_COND_IF(ARCH_X86_64, [ AM_COND_IF(ARCH_AARCH64, [ MACHINE_TYPE_NAME=aa64]) +AM_COND_IF(ARCH_ARM, [ + MACHINE_TYPE_NAME=arm]) + AC_SUBST([ARCH]) AC_SUBST([MACHINE_TYPE_NAME]) AM_CONDITIONAL([ARCH_IS_X86], [test "$ARCH" = "ia32" -o "$ARCH" = "x86_64"]) +AX_CHECK_COMPILE_FLAG([-mgeneral-regs-only], + [CFLAGS_MGENERAL_REGS_ONLY=-mgeneral-regs-only], + [CFLAGS_MGENERAL_REGS_ONLY=]) +AC_SUBST([CFLAGS_MGENERAL_REGS_ONLY]) + # Checks from autoscan: AC_CHECK_FUNCS([getmntent]) AC_CHECK_FUNCS([memset]) diff --git a/tools/tests/Makefile.am b/tools/tests/Makefile.am index 78c5d54..3947ab5 100644 --- a/tools/tests/Makefile.am +++ b/tools/tests/Makefile.am @@ -29,6 +29,10 @@ AM_CFLAGS = \ -D_GNU_SOURCE \ -g +if ARCH_ARM +AM_LDFLAGS = -Wl,--no-wchar-size-warning +endif + libtest_env_api_fat_a_SRC = \ ../../env/env_api.c \ ../../env/env_api_fat.c \ -- 2.35.3 -- You received this message because you are subscribed to the Google Groups "EFI Boot Guard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/efibootguard-dev/9b89f493f27e7028dbc22ab8bc76b3e13c7f6bfe.1655731805.git.jan.kiszka%40siemens.com.
