Commit e6fbf387 by Roman Zippel Committed by Roman Zippel

configure.ac (HAVE_AS_CFI_PSEUDO_OP): New test.

	* configure.ac (HAVE_AS_CFI_PSEUDO_OP): New test.
	* configure: Regenerate.
	* fficonfig.h.in: Regenerate.
	* src/m68k/sysv.S (CFI_STARTPROC,CFI_ENDPROC,
	CFI_OFFSET,CFI_DEF_CFA): New macros.
	(ffi_call_SYSV): Add callframe annotation.

From-SVN: r124600
parent b5296e52
2007-05-10 Roman Zippel <zippel@linux-m68k.org>
* configure.ac (HAVE_AS_CFI_PSEUDO_OP): New test.
* configure: Regenerate.
* fficonfig.h.in: Regenerate.
* src/m68k/sysv.S (CFI_STARTPROC,CFI_ENDPROC,
CFI_OFFSET,CFI_DEF_CFA): New macros.
(ffi_call_SYSV): Add callframe annotation.
2007-05-10 Roman Zippel <zippel@linux-m68k.org>
* src/m68k/ffi.c (ffi_prep_args,ffi_prep_cif_machdep): Fix
numerous test suite failures.
* src/m68k/sysv.S (ffi_call_SYSV): Likewise.
......
......@@ -7444,6 +7444,70 @@ presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
esac
echo "$as_me:$LINENO: checking assembler .cfi pseudo-op support" >&5
echo $ECHO_N "checking assembler .cfi pseudo-op support... $ECHO_C" >&6
if test "${libffi_cv_as_cfi_pseudo_op+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
libffi_cv_as_cfi_pseudo_op=unknown
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
asm (".cfi_startproc\n\t.cfi_endproc");
int
main ()
{
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
libffi_cv_as_cfi_pseudo_op=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
libffi_cv_as_cfi_pseudo_op=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $libffi_cv_as_cfi_pseudo_op" >&5
echo "${ECHO_T}$libffi_cv_as_cfi_pseudo_op" >&6
if test "x$libffi_cv_as_cfi_pseudo_op" = xyes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_AS_CFI_PSEUDO_OP 1
_ACEOF
fi
if test x$TARGET = xSPARC; then
echo "$as_me:$LINENO: checking assembler and linker support unaligned pc related relocs" >&5
echo $ECHO_N "checking assembler and linker support unaligned pc related relocs... $ECHO_C" >&6
......
......@@ -201,6 +201,18 @@ AC_SUBST(HAVE_LONG_DOUBLE)
AC_C_BIGENDIAN
AC_CACHE_CHECK([assembler .cfi pseudo-op support],
libffi_cv_as_cfi_pseudo_op, [
libffi_cv_as_cfi_pseudo_op=unknown
AC_TRY_COMPILE([asm (".cfi_startproc\n\t.cfi_endproc");],,
[libffi_cv_as_cfi_pseudo_op=yes],
[libffi_cv_as_cfi_pseudo_op=no])
])
if test "x$libffi_cv_as_cfi_pseudo_op" = xyes; then
AC_DEFINE(HAVE_AS_CFI_PSEUDO_OP, 1,
[Define if your assembler supports .cfi_* directives.])
fi
if test x$TARGET = xSPARC; then
AC_CACHE_CHECK([assembler and linker support unaligned pc related relocs],
libffi_cv_as_sparc_ua_pcrel, [
......
......@@ -27,6 +27,9 @@
*/
#undef HAVE_ALLOCA_H
/* Define if your assembler supports .cfi_* directives. */
#undef HAVE_AS_CFI_PSEUDO_OP
/* Define if your assembler supports .register. */
#undef HAVE_AS_REGISTER_PSEUDO_OP
......
......@@ -8,6 +8,18 @@
#include <fficonfig.h>
#include <ffi.h>
#ifdef HAVE_AS_CFI_PSEUDO_OP
#define CFI_STARTPROC() .cfi_startproc
#define CFI_OFFSET(reg,off) .cfi_offset reg,off
#define CFI_DEF_CFA(reg,off) .cfi_def_cfa reg,off
#define CFI_ENDPROC() .cfi_endproc
#else
#define CFI_STARTPROC()
#define CFI_OFFSET(reg,off)
#define CFI_DEF_CFA(reg,off)
#define CFI_ENDPROC()
#endif
.text
.globl ffi_call_SYSV
......@@ -15,8 +27,12 @@
.align 4
ffi_call_SYSV:
CFI_STARTPROC()
link %fp,#0
CFI_OFFSET(14,-8)
CFI_DEF_CFA(14,8)
move.l %d2,-(%sp)
CFI_OFFSET(2,-12)
| Make room for all of the new args.
sub.l 12(%fp),%sp
......@@ -103,4 +119,5 @@ epilogue:
move.l (%sp)+,%d2
unlk %fp
rts
CFI_ENDPROC()
.size ffi_call_SYSV,.-ffi_call_SYSV
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment