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