1From ebf0236270b977a62c522bc32810bc9f8edc72d1 Mon Sep 17 00:00:00 2001 2From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> 3Date: Wed, 24 Mar 2021 13:40:14 +0100 4Subject: [PATCH] configure.ac: add option --enable-kernel-64-userland-32 5 6The ebtables build system seems to assume that 'sparc64' is the 7only case where KERNEL_64_USERSPACE_32 is relevant, but this is not true. 8This situation can happen on many architectures, especially in embedded 9systems. For example, an Aarch64 processor with kernel in 64-bit but 10userland build for 32-bit Arm. Or a 64-bit MIPS Octeon III processor, with 11userland running in the 'n32' ABI. 12 13While it is possible to set CFLAGS in the environment when calling the 14configure script, the caller would need to know to not only specify 15KERNEL_64_USERSPACE_32 but also the EBT_MIN_ALIGN value. 16 17Instead, add a configure option. All internal details can then be handled by 18the configure script. 19 20Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> 21Upstream-Status: http://patchwork.ozlabs.org/project/netfilter-devel/patch/20210518181730.13436-2-patrickdepinguin@gmail.com/ 22--- 23 configure.ac | 9 ++++++++- 24 1 file changed, 8 insertions(+), 1 deletion(-) 25 26diff --git a/configure.ac b/configure.ac 27index c24ede3..3e89c0c 100644 28--- a/configure.ac 29+++ b/configure.ac 30@@ -15,10 +15,17 @@ AS_IF([test "x$LOCKFILE" = x], [LOCKFILE="/var/lib/ebtables/lock"]) 31 32 regular_CFLAGS="-Wall -Wunused" 33 regular_CPPFLAGS="" 34+ 35 case "$host" in 36 sparc64-*) 37- regular_CPPFLAGS="$regular_CPPFLAGS -DEBT_MIN_ALIGN=8 -DKERNEL_64_USERSPACE_32";; 38+ enable_kernel_64_userland_32=yes ;; 39 esac 40+AC_ARG_ENABLE([kernel-64-userland-32], 41+ AC_HELP_STRING([--enable-kernel-64-userland-32], [indicate that ebtables will be built as a 32-bit application but run under a 64-bit kernel]) 42+) 43+AS_IF([test "x$enable_kernel_64_userland_32" = xyes], 44+ [regular_CPPFLAGS="$regular_CPPFLAGS -DEBT_MIN_ALIGN=8 -DKERNEL_64_USERSPACE_32"] 45+) 46 47 AC_SUBST([regular_CFLAGS]) 48 AC_SUBST([regular_CPPFLAGS]) 49-- 502.26.2 51 52