Skip to contentSkip to conversation

arch/Config.in: introduce BR2_KERNEL_64_USERLAND_32 symbol

PATCH New Gustavo Zacarias 2 participants 3 messages Oct 25, 2013 – Oct 30, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 arch/Config.in: introduce BR2_KERNEL_64_USERLAND_32 symbol

On some architectures one can be running a 64-bit kernel with a 32-bit userland.
Such is the case for sparc64 (unsupported) for example and mips64 with n32 ABI.
Some tools that interface directly with the kernel need to be built specially for this, so introduce this symbol to tweak their build in one central kludge to be future-proof.
Example: bug #6602.

---
 arch/Config.in      | 3 +++
 arch/Config.in.mips | 1 +
 2 files changed, 4 insertions(+)
arch/Config.in +3 -0
index 3fd8c1c..bc81dac 100644
@@ -3,6 +3,9 @@ menu "Target options"
 config BR2_ARCH_IS_64
 	bool
 
+config BR2_KERNEL_64_USERLAND_32
+	bool
+
 config BR2_SOFT_FLOAT
 	bool
 
arch/Config.in.mips +1 -0
index 6242bcc..ca8b87f 100644
@@ -47,6 +47,7 @@ config BR2_MIPS_OABI32
 config BR2_MIPS_NABI32
 	bool "n32"
 	depends on BR2_ARCH_IS_64
+	select BR2_KERNEL_64_USERLAND_32
 config BR2_MIPS_NABI64
 	bool "n64"
 	depends on BR2_ARCH_IS_64
Signature · 1 line
1.8.1.5
#1 lore raw

PATCH 2/2 ebtables: build fix for 64-bit kernel with 32-bit userland

Fixes bug #6602.

---
 package/ebtables/ebtables.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
package/ebtables/ebtables.mk +2 -1
index edb5d42..612cf83 100644
@@ -10,10 +10,11 @@ EBTABLES_SITE = http://downloads.sourceforge.net/project/ebtables/ebtables/ebtab
 EBTABLES_LICENSE = GPLv2+
 EBTABLES_LICENSE_FILES = COPYING
 EBTABLES_STATIC = $(if $(BR2_PREFER_STATIC_LIB),static)
+EBTABLES_K64U32 = $(if $(BR2_KERNEL_64_USERLAND_32),CFLAGS+="-DKERNEL_64_USERSPACE_32")
 
 define EBTABLES_BUILD_CMDS
 	$(MAKE) $(TARGET_CONFIGURE_OPTS) LIBDIR=/lib/ebtables $(EBTABLES_STATIC) \
-		-C $(@D)
+		$(EBTABLES_K64U32) -C $(@D)
 endef
 
 ifeq ($(BR2_PREFER_STATIC_LIB),y)
Signature · 1 line
1.8.1.5
#2 lore raw

PATCH 1/2 arch/Config.in: introduce BR2_KERNEL_64_USERLAND_32 symbol

In reply to Gustavo Zacarias

Dear Gustavo Zacarias,

Quoted 9 lines · Gustavo Zacarias

On some architectures one can be running a 64-bit kernel with a 32-bit userland.
Such is the case for sparc64 (unsupported) for example and mips64 with n32 ABI.
Some tools that interface directly with the kernel need to be built specially for this, so introduce this symbol to tweak their build in one central kludge to be future-proof.
Example: bug #6602.

Quoted 5 lines
---
 arch/Config.in      | 3 +++
 arch/Config.in.mips | 1 +
 2 files changed, 4 insertions(+)

Applied both patches to for-peter-2013.11, thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com