Changes v2:
- add parenthesis
- correct comments
the binary copy for armhf still works
configure.ac | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/
configure.ac b/
configure.ac
index 1779661..0a5227a 100644
--- a/
configure.ac
+++ b/
configure.ac
@@ -245,12 +245,17 @@ AC_DEFINE_UNQUOTED([GNU_EFI_VERSION], [${GNU_EFI_VERSION}], [gnu-efi version])
AC_SUBST([OBJCOPY_HAS_EFI_APP_TARGET], [$($OBJCOPY --info | $GREP -q pei- 2>/dev/null && echo "true")])
-# Use objcopy -O binary on riscv64, arm, and aarch64 with gnu-efi 3.0.15
+# Use objcopy -O binary arm, aarch64 with gnu-efi < 3.0.16 and riscv64 < 4.0
AM_CONDITIONAL([OBJCOPY_USE_BINARY_COPY],
- [test "$ARCH" = "arm" || test "$ARCH" = "riscv64" || test "$ARCH" = "aarch64" -a $GNU_EFI_VERSION -eq 0])
-
-# Ensure objcopy supports target=efi-app for x86 across the board(s) and aarch64 with gnu-efi > 3.0.15
-if test -z "$ARCH_IS_X86_TRUE" -a -z "$OBJCOPY_HAS_EFI_APP_TARGET" || test "$ARCH" = "aarch64" -a -z "$OBJCOPY_HAS_EFI_APP_TARGET" -a $GNU_EFI_VERSION -gt 0; then
+ [test "$ARCH" = "arm" || \
+ (test "$ARCH" = "riscv64" && test $GNU_EFI_VERSION -lt 4000000) || \
+ (test "$ARCH" = "aarch64" && test $GNU_EFI_VERSION -eq 0)])
+
+# Ensure objcopy supports target=efi-app for x86 across the board(s), aarch64 with gnu-efi > 3.0.15,
+# and riscv64 > 4.0
+if (test -z "$ARCH_IS_X86_TRUE" && test -z "$OBJCOPY_HAS_EFI_APP_TARGET") || \
+ (test "$ARCH" = "aarch64" && test -z "$OBJCOPY_HAS_EFI_APP_TARGET" && test $GNU_EFI_VERSION -gt 0) || \
+ (test "$ARCH" = "riscv64" && test -z "$OBJCOPY_HAS_EFI_APP_TARGET" && test $GNU_EFI_VERSION -gt 4000000); then
AC_MSG_ERROR([objcopy doesn't support --target=efi-app but that is needed by gnu-efi])
fi
--
2.53.0