0002-Fix-use-of-compact-eh-frames-on-MIPS.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. From 31b6b6bc14197cd4183bdbd311fddeb36b5ae100 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?J=C3=B6rg=20Krause?= <joerg.krause@embedded.rocks>
  3. Date: Sat, 19 Sep 2015 22:53:29 +0200
  4. Subject: [PATCH] Fix use of compact eh frames on MIPS
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Newer MIPS toolchains use a different (compact) eh_frame format.
  9. libffi don't like them, so we have to switch to the older format.
  10. This patch add -mno-compact-eh to CFLAGS when compiling for
  11. Mips and compiler support it.
  12. Signed-off-by: Jérôme Pouiller <jezz@sysmic.org>
  13. [unfuzz for 3.2.1]
  14. Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
  15. ---
  16. configure.ac | 10 ++++++++++
  17. 1 file changed, 10 insertions(+)
  18. diff --git a/configure.ac b/configure.ac
  19. index a7bf5ee..36cd0d4 100644
  20. --- a/configure.ac
  21. +++ b/configure.ac
  22. @@ -469,6 +469,16 @@ esac
  23. AM_CONDITIONAL(FFI_EXEC_TRAMPOLINE_TABLE, test x$FFI_EXEC_TRAMPOLINE_TABLE = x1)
  24. AC_SUBST(FFI_EXEC_TRAMPOLINE_TABLE)
  25. +if test x$TARGET = xMIPS; then
  26. + save_CFLAGS="$CFLAGS"
  27. + CFLAGS=-mno-compact-eh
  28. + AC_MSG_CHECKING([whether the C compiler needs -mno-compact-eh])
  29. + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
  30. + [AC_MSG_RESULT([yes])]; [save_CFLAGS="$save_CFLAGS -mno-compact-eh"],
  31. + [AC_MSG_RESULT([no])])
  32. + CFLAGS="$save_CFLAGS"
  33. +fi
  34. +
  35. if test x$TARGET = xX86_64; then
  36. AC_CACHE_CHECK([toolchain supports unwind section type],
  37. libffi_cv_as_x86_64_unwind_section_type, [
  38. --
  39. 2.5.3