Skip to contentSkip to conversation

glibc: Pass correct -mabi for MIPS

PATCH New Markos Chandras 3 participants 4 messages Sep 25, 2013 – Oct 1, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 glibc: Pass correct -mabi for MIPS

According to glibc-2.18/ports/sysdeps/mips/preconfigure, if no -mabi was passed to CFLAGS, then it defaults to -mabi=n32. This breaks o32 and n64 builds for MIPS64. Therefore, it is necessary to append -mabi to CFLAGS.

---
 package/glibc/glibc.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)
package/glibc/glibc.mk +10 -0
index 4dd2e63..68c4636 100644
@@ -43,6 +43,16 @@ ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y)
 GLIBC_EXTRA_CFLAGS += -marm
 endif
 
+# MIPS64 defaults to n32 so pass the correct -mabi if
+# we are using a different ABI. OABI32 is also used
+# in MIPS so we pass -mabi=32 in this case as well
+# even though it's not strictly necessary.
+ifeq ($(BR2_MIPS_NABI64),y)
+GLIBC_EXTRA_CFLAGS += -mabi=64
+else ifeq ($(BR2_MIPS_OABI32),y)
+GLIBC_EXTRA_CFLAGS += -mabi=32
+endif
+
 # Even though we use the autotools-package infrastructure, we have to
 # override the default configure commands for several reasons:
 #
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/1 glibc: Pass correct -mabi for MIPS

Quoted 22 lines · Markos Chandras

According to glibc-2.18/ports/sysdeps/mips/preconfigure, if no -mabi was passed to CFLAGS, then it defaults to -mabi=n32. This breaks o32 and n64 builds for MIPS64. Therefore, it is necessary to append -mabi to CFLAGS.

---
  package/glibc/glibc.mk | 10 ++++++++++
  1 file changed, 10 insertions(+)
package/glibc/glibc.mk +3 -0
index 4dd2e63..68c4636 100644
@@ -43,6 +43,16 @@ ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y)
  GLIBC_EXTRA_CFLAGS += -marm
  endif
 
+# MIPS64 defaults to n32 so pass the correct -mabi if
+# we are using a different ABI. OABI32 is also used
+# in MIPS so we pass -mabi=32 in this case as well

package/glibc/glibc.mk ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y) · line 58

Quoted 10 lines
package/glibc/glibc.mk +7 -0
+# even though it's not strictly necessary.
+ifeq ($(BR2_MIPS_NABI64),y)
+GLIBC_EXTRA_CFLAGS += -mabi=64
+else ifeq ($(BR2_MIPS_OABI32),y)
+GLIBC_EXTRA_CFLAGS += -mabi=32
+endif
+
  # Even though we use the autotools-package infrastructure, we have to
  # override the default configure commands for several reasons:
  #

Ping? :)

#2 lore raw

PATCH 1/1 glibc: Pass correct -mabi for MIPS

In reply to Markos Chandras

Dear Markos Chandras,

Quoted 6 lines · Markos Chandras

According to glibc-2.18/ports/sysdeps/mips/preconfigure, if no -mabi was passed to CFLAGS, then it defaults to -mabi=n32. This breaks o32 and n64 builds for MIPS64. Therefore, it is necessary to append -mabi to CFLAGS.

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

PATCH 1/1 glibc: Pass correct -mabi for MIPS

In reply to Markos Chandras
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Markos" == Markos Chandras <[email protected]> writes:

Markos> According to glibc-2.18/ports/sysdeps/mips/preconfigure, Markos> if no -mabi was passed to CFLAGS, then it defaults to -mabi=n32. Markos> This breaks o32 and n64 builds for MIPS64. Therefore, it is Markos> necessary to append -mabi to CFLAGS.

Markos> Signed-off-by: Markos Chandras <[email protected]>

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard