summaryrefslogtreecommitdiff
path: root/recipes/gcc/gcc-4.4.0/debian/pr27880.dpatch
blob: f8f08b069510469650ec8d048d44d5b7096a234c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#! /bin/sh -e

dir=
if [ $# -eq 3 -a "$2" = '-d' ]; then
    pdir="-d $3"
    dir="$3/"
elif [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch)
        patch $pdir -f --no-backup-if-mismatch -p0 < $0
        ;;
    -unpatch)
        patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
        ;;
    *)
        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
        exit 1
esac
exit 0

# DP: PR target/27880: Restore static linking on ia64 with system libunwind
# DP: by adding unwind-compat to the static libgcc.

2006-06-19  Andreas Schwab  <schwab@suse.de>

	PR target/27880
	* unwind-compat.c: Wrap everything except _Unwind_GetIPInfo inside
	SHARED.
	* config/t-libunwind (LIB2ADDEHSTATIC): Add
	$(srcdir)/unwind-compat.c.

Index: gcc/config/t-libunwind
===================================================================
--- gcc/config/t-libunwind	(revision 114767)
+++ gcc/config/t-libunwind	(working copy)
@@ -6,7 +6,8 @@
 SHLIB_LC = -lunwind -lc
 LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
   $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c
-LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
+LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
+  $(srcdir)/unwind-compat.c
 
 T_CFLAGS += -DUSE_LIBUNWIND_EXCEPTIONS
 TARGET_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER
Index: gcc/unwind-compat.c
===================================================================
--- gcc/unwind-compat.c	(revision 114767)
+++ gcc/unwind-compat.c	(working copy)
@@ -35,6 +35,7 @@
 #include "unwind-dw2-fde.h"
 #include "unwind-compat.h"
 
+#ifdef SHARED
 extern _Unwind_Reason_Code __libunwind_Unwind_Backtrace
   (_Unwind_Trace_Fn, void *);
 
@@ -136,13 +137,6 @@ _Unwind_GetIP (struct _Unwind_Context *c
 }
 symver (_Unwind_GetIP, GCC_3.0);
 
-_Unwind_Ptr
-_Unwind_GetIPInfo (struct _Unwind_Context *context, int *ip_before_insn)
-{
-  *ip_before_insn = 0;
-  return __libunwind_Unwind_GetIP (context);
-}
-
 extern void *__libunwind_Unwind_GetLanguageSpecificData
   (struct _Unwind_Context *);
 
@@ -212,4 +206,14 @@ _Unwind_SetIP (struct _Unwind_Context *c
   return __libunwind_Unwind_SetIP (context, val);
 }
 symver (_Unwind_SetIP, GCC_3.0);
+#endif /* SHARED */
+
+extern _Unwind_Ptr __libunwind_Unwind_GetIP (struct _Unwind_Context *);
+
+_Unwind_Ptr
+_Unwind_GetIPInfo (struct _Unwind_Context *context, int *ip_before_insn)
+{
+  *ip_before_insn = 0;
+  return __libunwind_Unwind_GetIP (context);
+}
 #endif