updated on Mon Jan 23 20:11:11 UTC 2012
[aur-mirror.git] / gcc-gcj / libjava-sjlj.dpatch
blob95b4673b3f1433088ec1c79c16e66ecc5fb5cbb1
1 #! /bin/sh -e
3 # DP: Don't try to use _Unwind_Backtrace on SJLJ targets.
4 # DP: See bug #387875, #388505, GCC PR 29206.
6 dir=
7 if [ $# -eq 3 -a "$2" = '-d' ]; then
8 pdir="-d $3"
9 dir="$3/"
10 elif [ $# -ne 1 ]; then
11 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
12 exit 1
14 case "$1" in
15 -patch)
16 patch $pdir -f --no-backup-if-mismatch -p1 < $0
17 #cd ${dir}gcc && autoconf
19 -unpatch)
20 patch $pdir -f --no-backup-if-mismatch -R -p1 < $0
21 #rm ${dir}gcc/configure
24 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
25 exit 1
26 esac
27 exit 0
29 ---
30 libjava/sysdep/generic/backtrace.h | 17 +++++++++++++++++
31 1 file changed, 17 insertions(+)
33 Index: src/libjava/sysdep/generic/backtrace.h
34 ===================================================================
35 --- src.orig/libjava/sysdep/generic/backtrace.h 2006-11-06 14:00:32.000000000 -0500
36 +++ src/libjava/sysdep/generic/backtrace.h 2006-11-06 14:04:38.000000000 -0500
37 @@ -13,6 +13,20 @@ details. */
39 #include <java-stack.h>
41 +#ifdef SJLJ_EXCEPTIONS
43 +#undef _Unwind_GetIPInfo
44 +#define _Unwind_GetIPInfo(ctx,ip_before_insn) \
45 + (abort (), (void) (ctx), *ip_before_insn = 1, 0)
47 +#undef _Unwind_GetRegionStart
48 +#define _Unwind_GetRegionStart(ctx) \
49 + (abort (), (void) (ctx), 0)
51 +#undef _Unwind_Backtrace
52 +#define _Unwind_Backtrace(trace_fn,state_ptr) \
53 + (fallback_backtrace (trace_fn, state_ptr))
55 /* Unwind through the call stack calling TRACE_FN with STATE for every stack
56 frame. Returns the reason why the unwinding was stopped. */
57 _Unwind_Reason_Code
58 @@ -20,4 +34,7 @@ fallback_backtrace (_Unwind_Trace_Fn, _J
60 return _URC_NO_REASON;
63 +#endif /* SJLJ_EXCEPTIONS */
65 #endif