+2011-11-09 Richard Henderson <rth@redhat.com>
+
+ * asmcfi.m4: New file.
+
2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* mh-interix (LIBGCC2_DEBUG_CFLAGS): Remove.
--- /dev/null
+;; Cribbed from libffi
+
+AC_DEFUN([GCC_AS_CFI_PSEUDO_OP],
+[AC_CACHE_CHECK([assembler .cfi pseudo-op support],
+ gcc_cv_as_cfi_pseudo_op, [
+ gcc_cv_as_cfi_pseudo_op=unknown
+ AC_TRY_COMPILE([asm (".cfi_startproc\n\t.cfi_endproc");],,
+ [gcc_cv_as_cfi_pseudo_op=yes],
+ [gcc_cv_as_cfi_pseudo_op=no])
+ ])
+ if test "x$gcc_cv_as_cfi_pseudo_op" = xyes; then
+ AC_DEFINE(HAVE_AS_CFI_PSEUDO_OP, 1,
+ [Define if your assembler supports .cfi_* directives.])
+ fi
+])
+2011-11-09 Richard Henderson <rth@redhat.com>
+
+ * configure.ac (GCC_AS_CFI_PSEUDO_OP): Test it.
+ * configure, aclocal.m4, config.h.in: Rebuild.
+ * config/generic/asmcfi.h: New file.
+ * config/x86/sjlj.S: Use it.
+
2011-11-08 Richard Henderson <rth@redhat.com>
* local.cc (_ITM_LB): Use a normal call, not a function alias.
]) # _AM_PROG_TAR
m4_include([../config/acx.m4])
+m4_include([../config/asmcfi.m4])
m4_include([../config/depstand.m4])
m4_include([../config/enable.m4])
m4_include([../config/futex.m4])
/* Define to 1 if the target supports 64-bit __sync_*_compare_and_swap */
#undef HAVE_64BIT_SYNC_BUILTINS
+/* Define if your assembler supports .cfi_* directives. */
+#undef HAVE_AS_CFI_PSEUDO_OP
+
/* Define to 1 if the target supports __attribute__((alias(...))). */
#undef HAVE_ATTRIBUTE_ALIAS
--- /dev/null
+
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Richard Henderson <rth@redhat.com>.
+
+ This file is part of the GNU Transactional Memory Library (libitm).
+
+ Libitm is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ Libitm is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+
+#ifdef HAVE_AS_CFI_PSEUDO_OP
+
+#define cfi_startproc .cfi_startproc
+#define cfi_endproc .cfi_endproc
+#define cfi_def_cfa_offset(n) .cfi_def_cfa_offset n
+#define cfi_def_cfa(r,n) .cfi_def_cfa r, n
+#define cfi_register(o,n) .cfi_register o, n
+
+#else
+
+#define cfi_startproc
+#define cfi_endproc
+#define cfi_def_cfa_offset(n)
+#define cfi_def_cfa(r,n)
+#define cfi_register(o,n)
+
+#endif /* HAVE_ASM_CFI */
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
+
+#include "asmcfi.h"
+
.text
.p2align 4
.globl _ITM_beginTransaction
.type _ITM_beginTransaction, @function
_ITM_beginTransaction:
- .cfi_startproc
+ cfi_startproc
#ifdef __x86_64__
leaq 8(%rsp), %rax
movq (%rsp), %r8
subq $72, %rsp
- .cfi_def_cfa_offset 80
+ cfi_def_cfa_offset(80)
movq %rax, (%rsp)
movq %r8, 8(%rsp)
movq %rbx, 16(%rsp)
movq %rsp, %rsi
call GTM_begin_transaction
addq $72, %rsp
- .cfi_def_cfa_offset 8
+ cfi_def_cfa_offset(8)
ret
#else
leal 4(%esp), %ecx
subl $28, %esp
- .cfi_def_cfa_offset 32
+ cfi_def_cfa_offset(32)
movl %ecx, 8(%esp)
movl %ebx, 12(%esp)
movl %esi, 16(%esp)
leal 8(%esp), %edx
call GTM_begin_transaction
addl $28, %esp
- .cfi_def_cfa_offset 4
+ cfi_def_cfa_offset(4)
ret
#endif
- .cfi_endproc
+ cfi_endproc
.size _ITM_beginTransaction, .-_ITM_beginTransaction
.p2align 4
.hidden GTM_longjmp
GTM_longjmp:
- .cfi_startproc
+ cfi_startproc
#ifdef __x86_64__
movq (%rdi), %rcx
movq 8(%rdi), %rdx
movq 48(%rdi), %r14
movq 56(%rdi), %r15
movl %esi, %eax
- .cfi_def_cfa %rcx, 0
- .cfi_register %rip, %rdx
+ cfi_def_cfa(%rcx, 0)
+ cfi_register(%rip, %rdx)
movq %rcx, %rsp
jmp *%rdx
#else
movl 12(%edx), %edi
movl 16(%edx), %ebp
movl 20(%edx), %edx
- .cfi_def_cfa %ecx, 0
- .cfi_register %eip, %edx
+ cfi_def_cfa(%ecx, 0)
+ cfi_register(%eip, %edx)
movl %ecx, %esp
jmp *%edx
#endif
- .cfi_endproc
+ cfi_endproc
.size GTM_longjmp, .-GTM_longjmp
.section .note.GNU-stack, "", @progbits
fi
+# See if we can emit unwind info in the sjlj stub.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler .cfi pseudo-op support" >&5
+$as_echo_n "checking assembler .cfi pseudo-op support... " >&6; }
+if test "${gcc_cv_as_cfi_pseudo_op+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ gcc_cv_as_cfi_pseudo_op=unknown
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+asm (".cfi_startproc\n\t.cfi_endproc");
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gcc_cv_as_cfi_pseudo_op=yes
+else
+ gcc_cv_as_cfi_pseudo_op=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_cfi_pseudo_op" >&5
+$as_echo "$gcc_cv_as_cfi_pseudo_op" >&6; }
+ if test "x$gcc_cv_as_cfi_pseudo_op" = xyes; then
+
+$as_echo "#define HAVE_AS_CFI_PSEUDO_OP 1" >>confdefs.h
+
+ fi
+
+
# Determine the proper ABI type for size_t.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how size_t is mangled" >&5
[Define to 1 if GNU symbol versioning is used for libitm.])
fi
+# See if we can emit unwind info in the sjlj stub.
+GCC_AS_CFI_PSEUDO_OP
+
# Determine the proper ABI type for size_t.
LIBITM_CHECK_SIZE_T_MANGLING