Skip to contentSkip to conversation

toolchain/mips: kill EABI and fix N32

PATCH New Gustavo Zacarias 2 participants 5 messages Jul 14, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 toolchain/mips: kill EABI and fix N32

MIPS EABI is a bare-metal ABI so remove it.
Also fix uClibc to really work with N32 ABI, which used the EABI knob previously.

---
 target/Config.in.arch      |    3 ---
 toolchain/uClibc/uclibc.mk |    2 +-
 2 files changed, 1 insertions(+), 4 deletions(-)
target/Config.in.arch +0 -3
index c9bbc12..bad0f4c 100644
@@ -280,9 +280,6 @@ config BR2_MIPS_OABI32
 config BR2_MIPS_ABI32
 	bool "n32"
 	depends on BR2_mips_3 || BR2_mips_4 || BR2_mips_64 || BR2_mips_64r2 || BR2_mips_16
-config BR2_MIPS_EABI
-	bool "eabi"
-	depends on BR2_mips_3 || BR2_mips_4 || BR2_mips_64 || BR2_mips_64r2 || BR2_mips_16
 config BR2_MIPS_ABI64
 	bool "n64"
 	depends on BR2_mips_3 || BR2_mips_4 || BR2_mips_64 || BR2_mips_64r2 || BR2_mips_16
toolchain/uClibc/uclibc.mk +1 -1
index f40fe36..9d0b6db 100644
@@ -158,7 +158,7 @@ ifeq ($(UCLIBC_TARGET_ARCH),mips)
 ifeq ($(BR2_MIPS_OABI),y)
 	$(SED) 's/.*\(CONFIG_MIPS_O32_ABI\).*/\1=y/' $(UCLIBC_DIR)/.oldconfig
 endif
-ifeq ($(BR2_MIPS_EABI),y)
+ifeq ($(BR2_MIPS_ABI32),y)
 	$(SED) 's/.*\(CONFIG_MIPS_N32_ABI\).*/\1=y/' $(UCLIBC_DIR)/.oldconfig
 endif
 ifeq ($(BR2_MIPS_ABI64),y)
Signature · 1 line
1.7.8.6
#1 lore raw

PATCH 2/2 toolchain/mips: add the mips64 tuple

We need to use mips64 in the tuple for 64-bit variants (N32, N64 and O64 ABIs), otherwise we get assembly failures.

---
 target/Config.in.arch |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
target/Config.in.arch +2 -0
index bad0f4c..ae90a1d 100644
@@ -600,6 +600,8 @@ config BR2_ARCH
 	default "i686"		if BR2_x86_athlon_4
 	default "m68k"		if BR2_m68k
 	default "microblaze"	if BR2_microblaze
+	default "mips64"	if (BR2_MIPS_ABI64 || BR2_MIPS_OABI64 || BR2_MIPS_ABI32) && BR2_mips
+	default "mips64el"	if (BR2_MIPS_ABI64 || BR2_MIPS_OABI64 || BR2_MIPS_ABI32) && BR2_mipsel
 	default "mips"		if BR2_mips
 	default "mipsel"	if BR2_mipsel
 	default "powerpc"	if BR2_powerpc
Signature · 1 line
1.7.8.6
#2 lore raw

PATCH 2/2 toolchain/mips: add the mips64 tuple

Le Sat, 14 Jul 2012 09:28:38 -0300,
Gustavo Zacarias <[email protected]> a ?crit :

Quoted 13 lines

We need to use mips64 in the tuple for 64-bit variants (N32, N64 and O64 ABIs), otherwise we get assembly failures.

---
 target/Config.in.arch |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
target/Config.in.arch +0 -0
index bad0f4c..ae90a1d 100644

target/Config.in.arch config BR2_ARCH · line 607

Quoted 8 lines
target/Config.in.arch +2 -0
@@ -600,6 +600,8 @@ config BR2_ARCH
 	default "i686"		if BR2_x86_athlon_4
 	default "m68k"		if BR2_m68k
 	default "microblaze"	if BR2_microblaze
+	default "mips64"	if (BR2_MIPS_ABI64 || BR2_MIPS_OABI64 || BR2_MIPS_ABI32) && BR2_mips
+	default "mips64el"	if (BR2_MIPS_ABI64 || BR2_MIPS_OABI64 || BR2_MIPS_ABI32) && BR2_mipsel
 	default "mips"		if BR2_mips
 	default "mipsel"	if BR2_mipsel
 	default "powerpc"	if BR2_powerpc

So basically all ABIs except o32 are mips64 ABIs ?

I think it would be good to add a help text below each ABI to explain its use case, the bitness of the kernel, etc.

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#3 lore raw

PATCH 1/2 toolchain/mips: kill EABI and fix N32

In reply to Gustavo Zacarias

Le Sat, 14 Jul 2012 09:28:37 -0300,
Gustavo Zacarias <[email protected]> a ?crit :

Quoted 3 lines

MIPS EABI is a bare-metal ABI so remove it.
Also fix uClibc to really work with N32 ABI, which used the EABI knob previously.

There is no support in uClibc for o64. Is this ABI really used? I see that gcc has support for it
(http://gcc.gnu.org/projects/mipso64-abi.html), but is it used in practice?

Also, is the BR2_MIPS_ABI_none knob actually useful?

Thanks,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#4 lore raw

PATCH 1/2 toolchain/mips: kill EABI and fix N32

Quoted 12 lines · Thomas Petazzoni

Le Sat, 14 Jul 2012 09:28:37 -0300,
Gustavo Zacarias <[email protected]> a ?crit :

Quoted 3 lines

MIPS EABI is a bare-metal ABI so remove it.
Also fix uClibc to really work with N32 ABI, which used the EABI knob previously.

There is no support in uClibc for o64. Is this ABI really used? I see that gcc has support for it
(http://gcc.gnu.org/projects/mipso64-abi.html), but is it used in practice?

Quoted 5 lines

Also, is the BR2_MIPS_ABI_none knob actually useful?

Thanks,

Thomas

The patchset isn't complete, it's just a start to fix the obvious so any comments/suggestions are welcome.
Other points to fix include:

* External MIPS toolchains (non ct-ng) - neither of them seems to support 64 bit anything yet it's an option, we should probably filter them out.

* uClibc 64 bit toolchains seem broken for shared objects in general. I've been able to get a qemu test running only with static linking. Aboriginal linux does static too for mips64 as supporting evidence.

The set is just to get thing to build, maybe not properly but not because of buildroot.
BR2_MIPS_ABI_none is actually useless, so yes it can be removed. o64 ABI is probably an SGI thing for IRIX, hence the reason gcc supports it, probably can be removed too.
Regards.