Skip to contentSkip to conversation

libffi: Add -mno-compact-eh when compiling for Mips

PATCH Superseded Jérôme Pouiller 2 participants 5 messages Aug 8, 2013 – Aug 9, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libffi: Add -mno-compact-eh when compiling for Mips

Fix compilation on Mips. Resolve issues detected here:

    http://autobuild.buildroot.net/results/f0c9db496233f53c26e92294d7305aa4511ec7b3/
    http://autobuild.buildroot.net/results/8968690c248df86b040218867f92b573721e872c/
    http://autobuild.buildroot.net/results/a35db8e6a49d022133b486b12f6a8e40b3c95b6e/

Also remove previous special case handling defined in libffi.mk.

---
 ...-002-Fix-use-of-compact-eh-frames-on-MIPS.patch |   25 ++++++++++++++++++++
 package/libffi/libffi.mk                           |    6 -----
 2 files changed, 25 insertions(+), 6 deletions(-)
 create mode 100644 package/libffi/libffi-002-Fix-use-of-compact-eh-frames-on-MIPS.patch
package/libffi/libffi-002-Fix-use-of-compact-eh-frames-on-MIPS.patch new file +25 -0
new file mode 100644
index 0000000..027e3d3
@@ -0,0 +1,25 @@
+Newer MIPS toolchains use a different (compact) eh_frame format.
+libffi don't like them, so we have to switch to the older format.
+
+This patch add -mno-compact-eh to CFLAGS when compiling for 
+Mips and compiler support it.
+
+--- a/configure.ac	2013-08-08 14:53:11.884267155 +0200
++++ b/configure.ac	2013-08-08 14:54:14.437493244 +0200
+@@ -430,6 +430,16 @@
+ AM_CONDITIONAL(FFI_EXEC_TRAMPOLINE_TABLE, test x$FFI_EXEC_TRAMPOLINE_TABLE = x1)
+ AC_SUBST(FFI_EXEC_TRAMPOLINE_TABLE)
+ 
++if test x$TARGET = xMIPS; then
++    save_CFLAGS="$CFLAGS"
++    CFLAGS=-mno-compact-eh
++    AC_MSG_CHECKING([whether CC need -mno-compact-eh])
++    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
++                      [AC_MSG_RESULT([yes])]; [AM_CFLAGS="-mno-compact-eh"],
++                      [AC_MSG_RESULT([no])])
++    CFLAGS="$save_CFLAGS"
++fi
++
+ if test x$TARGET = xX86_64; then
+     AC_CACHE_CHECK([assembler supports unwind section type],
+ 	libffi_cv_as_x86_64_unwind_section_type, [
package/libffi/libffi.mk +0 -6
index 51cbbce..0ad5c84 100644
@@ -11,12 +11,6 @@ LIBFFI_LICENSE_FILES = LICENSE
 LIBFFI_INSTALL_STAGING = YES
 LIBFFI_AUTORECONF = YES
 
-# Newer CS MIPS toolchains use a different (compact) eh_frame format
-# libffi don't like them, just switch to the older format
-ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201209)$(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201203),y)
-LIBFFI_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) -mno-compact-eh"
-endif
-
 # Move the headers to the usual location, and adjust the .pc file
 # accordingly.
 define LIBFFI_MOVE_STAGING_HEADERS
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 libffi: Add -mno-compact-eh when compiling for Mips

Hi J?r?me,

Quoted 52 lines · J?r?me Pouiller

Fix compilation on Mips. Resolve issues detected here:

    http://autobuild.buildroot.net/results/f0c9db496233f53c26e92294d7305aa4511ec7b3/
    http://autobuild.buildroot.net/results/8968690c248df86b040218867f92b573721e872c/
    http://autobuild.buildroot.net/results/a35db8e6a49d022133b486b12f6a8e40b3c95b6e/

Also remove previous special case handling defined in libffi.mk.

---
 ...-002-Fix-use-of-compact-eh-frames-on-MIPS.patch |   25 ++++++++++++++++++++
 package/libffi/libffi.mk                           |    6 -----
 2 files changed, 25 insertions(+), 6 deletions(-)
 create mode 100644 package/libffi/libffi-002-Fix-use-of-compact-eh-frames-on-MIPS.patch
package/libffi/libffi-002-Fix-use-of-compact-eh-frames-on-MIPS.patch new file +25 -0
new file mode 100644
index 0000000..027e3d3
@@ -0,0 +1,25 @@
+Newer MIPS toolchains use a different (compact) eh_frame format.
+libffi don't like them, so we have to switch to the older format.
+
+This patch add -mno-compact-eh to CFLAGS when compiling for
+Mips and compiler support it.
+
+--- a/configure.ac     2013-08-08 14:53:11.884267155 +0200
++++ b/configure.ac     2013-08-08 14:54:14.437493244 +0200
+@@ -430,6 +430,16 @@
+ AM_CONDITIONAL(FFI_EXEC_TRAMPOLINE_TABLE, test x$FFI_EXEC_TRAMPOLINE_TABLE = x1)
+ AC_SUBST(FFI_EXEC_TRAMPOLINE_TABLE)
+
++if test x$TARGET = xMIPS; then
++    save_CFLAGS="$CFLAGS"
++    CFLAGS=-mno-compact-eh
++    AC_MSG_CHECKING([whether CC need -mno-compact-eh])
++    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
++                      [AC_MSG_RESULT([yes])]; [AM_CFLAGS="-mno-compact-eh"],
++                      [AC_MSG_RESULT([no])])
++    CFLAGS="$save_CFLAGS"
++fi
++
+ if test x$TARGET = xX86_64; then
+     AC_CACHE_CHECK([assembler supports unwind section type],
+       libffi_cv_as_x86_64_unwind_section_type, [
package/libffi/libffi.mk +0 -0
index 51cbbce..0ad5c84 100644
@@ -11,12 +11,6 @@ LIBFFI_LICENSE_FILES = LICENSE
 LIBFFI_INSTALL_STAGING = YES
 LIBFFI_AUTORECONF = YES

package/libffi/libffi.mk LIBFFI_LICENSE_FILES = LICENSE · line 16

Quoted 10 lines
package/libffi/libffi.mk +0 -6
 
-# Newer CS MIPS toolchains use a different (compact) eh_frame format
-# libffi don't like them, just switch to the older format
-ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201209)$(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201203),y)
-LIBFFI_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) -mno-compact-eh"
-endif
-
 # Move the headers to the usual location, and adjust the .pc file
 # accordingly.
 define LIBFFI_MOVE_STAGING_HEADERS

I tried this patch on the last autobuild you mentioned above, but it still fails.
The patch is applied though. I posted the output at:
http://pastebin.com/PpByvCER

Could you have a look?

Thanks,
Thomas

#2 lore raw

PATCH v2 1/1 libffi: Add -mno-compact-eh when compiling for Mips

Fix compilation on Mips. Resolve issues detected here:

    http://autobuild.buildroot.net/results/f0c9db496233f53c26e92294d7305aa4511ec7b3/
    http://autobuild.buildroot.net/results/8968690c248df86b040218867f92b573721e872c/
    http://autobuild.buildroot.net/results/a35db8e6a49d022133b486b12f6a8e40b3c95b6e/

Also remove previous special case handling defined in libffi.mk.

---
It looks like I sent wrong version of the patch. Sorry for disturbance.

 ...-002-Fix-use-of-compact-eh-frames-on-MIPS.patch |   25 ++++++++++++++++++++
 package/libffi/libffi.mk                           |    6 -----
 2 files changed, 25 insertions(+), 6 deletions(-)
 create mode 100644 package/libffi/libffi-002-Fix-use-of-compact-eh-frames-on-MIPS.patch
package/libffi/libffi-002-Fix-use-of-compact-eh-frames-on-MIPS.patch new file +25 -0
new file mode 100644
index 0000000..552f735
@@ -0,0 +1,25 @@
+Newer MIPS toolchains use a different (compact) eh_frame format.
+libffi don't like them, so we have to switch to the older format.
+
+This patch add -mno-compact-eh to CFLAGS when compiling for 
+Mips and compiler support it.
+
+--- a/configure.ac	2013-08-08 14:53:11.884267155 +0200
++++ b/configure.ac	2013-08-08 14:54:14.437493244 +0200
+@@ -430,6 +430,16 @@
+ AM_CONDITIONAL(FFI_EXEC_TRAMPOLINE_TABLE, test x$FFI_EXEC_TRAMPOLINE_TABLE = x1)
+ AC_SUBST(FFI_EXEC_TRAMPOLINE_TABLE)
+ 
++if test x$TARGET = xMIPS; then
++    save_CFLAGS="$CFLAGS"
++    CFLAGS=-mno-compact-eh
++    AC_MSG_CHECKING([whether CC need -mno-compact-eh])
++    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
++                      [AC_MSG_RESULT([yes])]; [save_CFLAGS="$save_CFLAGS -mno-compact-eh"],
++                      [AC_MSG_RESULT([no])])
++    CFLAGS="$save_CFLAGS"
++fi
++
+ if test x$TARGET = xX86_64; then
+     AC_CACHE_CHECK([assembler supports unwind section type],
+ 	libffi_cv_as_x86_64_unwind_section_type, [
package/libffi/libffi.mk +0 -6
index 51cbbce..0ad5c84 100644
@@ -11,12 +11,6 @@ LIBFFI_LICENSE_FILES = LICENSE
 LIBFFI_INSTALL_STAGING = YES
 LIBFFI_AUTORECONF = YES
 
-# Newer CS MIPS toolchains use a different (compact) eh_frame format
-# libffi don't like them, just switch to the older format
-ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201209)$(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201203),y)
-LIBFFI_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) -mno-compact-eh"
-endif
-
 # Move the headers to the usual location, and adjust the .pc file
 # accordingly.
 define LIBFFI_MOVE_STAGING_HEADERS
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH v2 1/1 libffi: Add -mno-compact-eh when compiling for Mips

Hi J?r?me,

Quoted 28 lines · J?r?me Pouiller

Fix compilation on Mips. Resolve issues detected here:

    http://autobuild.buildroot.net/results/f0c9db496233f53c26e92294d7305aa4511ec7b3/
    http://autobuild.buildroot.net/results/8968690c248df86b040218867f92b573721e872c/
    http://autobuild.buildroot.net/results/a35db8e6a49d022133b486b12f6a8e40b3c95b6e/

Also remove previous special case handling defined in libffi.mk.

---
It looks like I sent wrong version of the patch. Sorry for disturbance.

 ...-002-Fix-use-of-compact-eh-frames-on-MIPS.patch |   25 ++++++++++++++++++++
 package/libffi/libffi.mk                           |    6 -----
 2 files changed, 25 insertions(+), 6 deletions(-)
 create mode 100644 package/libffi/libffi-002-Fix-use-of-compact-eh-frames-on-MIPS.patch
package/libffi/libffi-002-Fix-use-of-compact-eh-frames-on-MIPS.patch new file +6 -0
new file mode 100644
index 0000000..552f735
@@ -0,0 +1,25 @@
+Newer MIPS toolchains use a different (compact) eh_frame format.
+libffi don't like them, so we have to switch to the older format.
+
+This patch add -mno-compact-eh to CFLAGS when compiling for
+Mips and compiler support it.
+

package/libffi/libffi-002-Fix-use-of-compact-eh-frames-on-MIPS.patch line 16

Quoted 10 lines
package/libffi/libffi-002-Fix-use-of-compact-eh-frames-on-MIPS.patch new file +10 -0
+--- a/configure.ac     2013-08-08 14:53:11.884267155 +0200
++++ b/configure.ac     2013-08-08 14:54:14.437493244 +0200
+@@ -430,6 +430,16 @@
+ AM_CONDITIONAL(FFI_EXEC_TRAMPOLINE_TABLE, test x$FFI_EXEC_TRAMPOLINE_TABLE = x1)
+ AC_SUBST(FFI_EXEC_TRAMPOLINE_TABLE)
+
++if test x$TARGET = xMIPS; then
++    save_CFLAGS="$CFLAGS"
++    CFLAGS=-mno-compact-eh
++    AC_MSG_CHECKING([whether CC need -mno-compact-eh])

Not that it is critical, but I would reformulate this message to better match the standard autoconf strings, something like:
"whether the C compiler needs -mno-compact-eh"

Quoted 16 lines
package/libffi/libffi-002-Fix-use-of-compact-eh-frames-on-MIPS.patch new file +9 -0
++    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
++                      [AC_MSG_RESULT([yes])]; [save_CFLAGS="$save_CFLAGS -mno-compact-eh"],
++                      [AC_MSG_RESULT([no])])
++    CFLAGS="$save_CFLAGS"
++fi
++
+ if test x$TARGET = xX86_64; then
+     AC_CACHE_CHECK([assembler supports unwind section type],
+       libffi_cv_as_x86_64_unwind_section_type, [
package/libffi/libffi.mk +0 -0
index 51cbbce..0ad5c84 100644
@@ -11,12 +11,6 @@ LIBFFI_LICENSE_FILES = LICENSE
 LIBFFI_INSTALL_STAGING = YES
 LIBFFI_AUTORECONF = YES

package/libffi/libffi.mk LIBFFI_LICENSE_FILES = LICENSE · line 16

Quoted 10 lines
package/libffi/libffi.mk +0 -6
 
-# Newer CS MIPS toolchains use a different (compact) eh_frame format
-# libffi don't like them, just switch to the older format
-ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201209)$(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201203),y)
-LIBFFI_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) -mno-compact-eh"
-endif
-
 # Move the headers to the usual location, and adjust the .pc file
 # accordingly.
 define LIBFFI_MOVE_STAGING_HEADERS

Other than that:

Reviewed-and-tested-by: Thomas De Schampheleire
<[email protected]>
[tested on the last autobuild link mentioned]

#4 lore raw

PATCH v3 1/1 libffi: Add -mno-compact-eh when compiling for Mips

Fix compilation on Mips. Resolve issues detected here:

    http://autobuild.buildroot.net/results/f0c9db496233f53c26e92294d7305aa4511ec7b3/
    http://autobuild.buildroot.net/results/8968690c248df86b040218867f92b573721e872c/
    http://autobuild.buildroot.net/results/a35db8e6a49d022133b486b12f6a8e40b3c95b6e/

Also remove previous special case handling defined in libffi.mk.

---
V3:
Change test message as suggested by Thomas.

 ...-002-Fix-use-of-compact-eh-frames-on-MIPS.patch |   25 ++++++++++++++++++++
 package/libffi/libffi.mk                           |    6 -----
 2 files changed, 25 insertions(+), 6 deletions(-)
 create mode 100644 package/libffi/libffi-002-Fix-use-of-compact-eh-frames-on-MIPS.patch
package/libffi/libffi-002-Fix-use-of-compact-eh-frames-on-MIPS.patch new file +25 -0
new file mode 100644
index 0000000..e1a4c8b
@@ -0,0 +1,25 @@
+Newer MIPS toolchains use a different (compact) eh_frame format.
+libffi don't like them, so we have to switch to the older format.
+
+This patch add -mno-compact-eh to CFLAGS when compiling for 
+Mips and compiler support it.
+
+--- a/configure.ac	2013-08-08 14:53:11.884267155 +0200
++++ b/configure.ac	2013-08-08 14:54:14.437493244 +0200
+@@ -430,6 +430,16 @@
+ AM_CONDITIONAL(FFI_EXEC_TRAMPOLINE_TABLE, test x$FFI_EXEC_TRAMPOLINE_TABLE = x1)
+ AC_SUBST(FFI_EXEC_TRAMPOLINE_TABLE)
+ 
++if test x$TARGET = xMIPS; then
++    save_CFLAGS="$CFLAGS"
++    CFLAGS=-mno-compact-eh
++    AC_MSG_CHECKING([whether the C compiler needs -mno-compact-eh])
++    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
++                      [AC_MSG_RESULT([yes])]; [save_CFLAGS="$save_CFLAGS -mno-compact-eh"],
++                      [AC_MSG_RESULT([no])])
++    CFLAGS="$save_CFLAGS"
++fi
++
+ if test x$TARGET = xX86_64; then
+     AC_CACHE_CHECK([assembler supports unwind section type],
+ 	libffi_cv_as_x86_64_unwind_section_type, [
package/libffi/libffi.mk +0 -6
index 51cbbce..0ad5c84 100644
@@ -11,12 +11,6 @@ LIBFFI_LICENSE_FILES = LICENSE
 LIBFFI_INSTALL_STAGING = YES
 LIBFFI_AUTORECONF = YES
 
-# Newer CS MIPS toolchains use a different (compact) eh_frame format
-# libffi don't like them, just switch to the older format
-ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201209)$(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201203),y)
-LIBFFI_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) -mno-compact-eh"
-endif
-
 # Move the headers to the usual location, and adjust the .pc file
 # accordingly.
 define LIBFFI_MOVE_STAGING_HEADERS
Signature · 1 line
1.7.9.5