@@ -438,7 +438,11 @@ QUIET := $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),-q)
# Strip off the annoying quoting
ARCH := $(call qstrip,$(BR2_ARCH))
NORMALIZED_ARCH := $(call qstrip,$(BR2_KERNEL_ARCH))
+ifeq ($(call qstrip,$(BR2_KERNEL_ARCH_OVERRIDE)),)
KERNEL_ARCH := $(call qstrip,$(BR2_KERNEL_ARCH))
+else
+KERNEL_ARCH := $(call qstrip,$(BR2_KERNEL_ARCH_OVERRIDE))
+endif
ZCAT := $(call qstrip,$(BR2_ZCAT))
BZCAT := $(call qstrip,$(BR2_BZCAT))
@@ -331,6 +331,21 @@ config BR2_ARCH
config BR2_KERNEL_ARCH
string
+config BR2_KERNEL_ARCH_OVERRIDE
+ string "Kernel architecture override"
+ help
+ Normally, the correct kernel architecture value is derived
+ from the selected architecture, and you should keep this
+ option empty.
+ However, there are cases where you may want to enter a custom
+ value, for example when using a 64-bit architecture but
+ running userspace in 32-bit mode.
+ As an example, in case of an x86_64 processor where you want
+ 32-bit userspace, BR2_ARCH will be 'i386'/'i486'/'i686' and
+ BR2_KERNEL_ARCH_OVERRIDE should be set to 'x86_64'. Note that
+ in this example you will also need a multilib toolchain and
+ pass '-m32' via BR2_TARGET_OPTIMIZATION.
+
config BR2_ENDIAN
string