~ubuntu-branches/ubuntu/hardy/gcj-4.2/hardy-proposed

« back to all changes in this revision

Viewing changes to debian/patches/libjava-armeabi.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-08-27 19:03:56 UTC
  • Revision ID: james.westby@ubuntu.com-20070827190356-mhz77izmwht6vcx7
Tags: 4.2.1-4ubuntu1
Upload as gcj-4.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
 
89
89
Index: configure
90
90
===================================================================
91
 
--- configure   (revision 127222)
92
 
+++ configure   (working copy)
93
 
@@ -1322,8 +1322,8 @@
94
 
     noconfigdirs="$noconfigdirs target-libffi target-qthreads"
95
 
     ;;
96
 
   arm*-*-linux-gnueabi)
97
 
-    noconfigdirs="$noconfigdirs target-libffi target-qthreads"
98
 
-    noconfigdirs="$noconfigdirs target-libjava target-libobjc"
99
 
+    noconfigdirs="$noconfigdirs target-qthreads"
100
 
+    noconfigdirs="$noconfigdirs target-libobjc"
101
 
     ;;
102
 
   arm*-*-symbianelf*)
103
 
     noconfigdirs="$noconfigdirs ${libgcj} target-libiberty"
104
 
Index: configure.in
105
 
===================================================================
106
 
--- configure.in        (revision 127222)
107
 
+++ configure.in        (working copy)
108
 
@@ -482,8 +482,8 @@
109
 
     noconfigdirs="$noconfigdirs target-libffi target-qthreads"
110
 
     ;;
111
 
   arm*-*-linux-gnueabi)
112
 
-    noconfigdirs="$noconfigdirs target-libffi target-qthreads"
113
 
-    noconfigdirs="$noconfigdirs target-libjava target-libobjc"
114
 
+    noconfigdirs="$noconfigdirs target-qthreads"
115
 
+    noconfigdirs="$noconfigdirs target-libobjc"
116
 
     ;;
117
 
   arm*-*-symbianelf*)
118
 
     noconfigdirs="$noconfigdirs ${libgcj} target-libiberty"
 
91
--- configure   (revision 126979)
 
92
+++ configure   (revision 127340)
 
93
@@ -2236,8 +2236,8 @@
 
94
     noconfigdirs="$noconfigdirs target-libffi target-qthreads"
 
95
     ;;
 
96
   arm*-*-linux-gnueabi)
 
97
-    noconfigdirs="$noconfigdirs target-libffi target-qthreads"
 
98
-    noconfigdirs="$noconfigdirs target-libjava target-libobjc"
 
99
+    noconfigdirs="$noconfigdirs target-qthreads"
 
100
+    noconfigdirs="$noconfigdirs target-libobjc"
 
101
     case ${with_newlib} in
 
102
       no) noconfigdirs="$noconfigdirs target-newlib target-libgloss"
 
103
     esac
 
104
Index: configure.ac
 
105
===================================================================
 
106
--- configure.ac        (revision 126979)
 
107
+++ configure.ac        (revision 127340)
 
108
@@ -514,8 +514,8 @@
 
109
     noconfigdirs="$noconfigdirs target-libffi target-qthreads"
 
110
     ;;
 
111
   arm*-*-linux-gnueabi)
 
112
-    noconfigdirs="$noconfigdirs target-libffi target-qthreads"
 
113
-    noconfigdirs="$noconfigdirs target-libjava target-libobjc"
 
114
+    noconfigdirs="$noconfigdirs target-qthreads"
 
115
+    noconfigdirs="$noconfigdirs target-libobjc"
 
116
     case ${with_newlib} in
 
117
       no) noconfigdirs="$noconfigdirs target-newlib target-libgloss"
 
118
     esac
 
119
Index: gcc/config/arm/libunwind.S
 
120
===================================================================
 
121
--- gcc/config/arm/libunwind.S  (revision 126979)
 
122
+++ gcc/config/arm/libunwind.S  (revision 127340)
 
123
@@ -237,5 +237,6 @@
 
124
 UNWIND_WRAPPER _Unwind_Resume 1
 
125
 UNWIND_WRAPPER _Unwind_Resume_or_Rethrow 1
 
126
 UNWIND_WRAPPER _Unwind_ForcedUnwind 3
 
127
+UNWIND_WRAPPER _Unwind_Backtrace 2
 
128
 
 
129
-#endif  /* __symbian__ */
 
130
+#endif  /* ndef __symbian__ */
 
131
Index: gcc/config/arm/unwind-arm.c
 
132
===================================================================
 
133
--- gcc/config/arm/unwind-arm.c (revision 126979)
 
134
+++ gcc/config/arm/unwind-arm.c (revision 127340)
 
135
@@ -950,6 +950,50 @@
 
136
 }
 
137
 
 
138
 
 
139
+/* Perform stack backtrace through unwind data.  */
 
140
+_Unwind_Reason_Code
 
141
+__gnu_Unwind_Backtrace(_Unwind_Trace_Fn trace, void * trace_argument,
 
142
+                      phase2_vrs * entry_vrs);
 
143
+_Unwind_Reason_Code
 
144
+__gnu_Unwind_Backtrace(_Unwind_Trace_Fn trace, void * trace_argument,
 
145
+                      phase2_vrs * entry_vrs)
 
146
+{
 
147
+  phase1_vrs saved_vrs;
 
148
+  _Unwind_Reason_Code code;
 
149
+
 
150
+  _Unwind_Control_Block ucb;
 
151
+  _Unwind_Control_Block *ucbp = &ucb;
 
152
+
 
153
+  /* Set the pc to the call site.  */
 
154
+  entry_vrs->core.r[R_PC] = entry_vrs->core.r[R_LR];
 
155
+
 
156
+  /* Save the core registers.  */
 
157
+  saved_vrs.core = entry_vrs->core;
 
158
+  /* Set demand-save flags.  */
 
159
+  saved_vrs.demand_save_flags = ~(_uw) 0;
 
160
+  
 
161
+  do
 
162
+    {
 
163
+      /* Find the entry for this routine.  */
 
164
+      if (get_eit_entry (ucbp, saved_vrs.core.r[R_PC]) != _URC_OK)
 
165
+       return _URC_FAILURE;
 
166
+
 
167
+      /* Call trace function.  */
 
168
+      if ((*trace) ((_Unwind_Context *) &saved_vrs, trace_argument) 
 
169
+         != _URC_NO_REASON)
 
170
+       return _URC_FAILURE;
 
171
+
 
172
+      /* Call the pr to decide what to do.  */
 
173
+      code = ((personality_routine) UCB_PR_ADDR (ucbp))
 
174
+       (_US_VIRTUAL_UNWIND_FRAME | _US_FORCE_UNWIND, 
 
175
+        ucbp, (void *) &saved_vrs);
 
176
+    }
 
177
+  while (code != _URC_END_OF_STACK);
 
178
+
 
179
+  return code;
 
180
+}
 
181
+
 
182
+
 
183
 /* Common implementation for ARM ABI defined personality routines.
 
184
    ID is the index of the personality routine, other arguments are as defined
 
185
    by __aeabi_unwind_cpp_pr{0,1,2}.  */
 
186
Index: gcc/config/arm/unwind-arm.h
 
187
===================================================================
 
188
--- gcc/config/arm/unwind-arm.h (revision 126979)
 
189
+++ gcc/config/arm/unwind-arm.h (revision 127340)
 
190
@@ -205,6 +205,13 @@
 
191
        _Unwind_Control_Block *, struct _Unwind_Context *, void *);
 
192
   _Unwind_Reason_Code _Unwind_ForcedUnwind (_Unwind_Control_Block *,
 
193
                                            _Unwind_Stop_Fn, void *);
 
194
+  /* @@@ Use unwind data to perform a stack backtrace.  The trace callback
 
195
+     is called for every stack frame in the call chain, but no cleanup
 
196
+     actions are performed.  */
 
197
+  typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn) (_Unwind_Context *, void *);
 
198
+  _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn,
 
199
+                                       void*);
 
200
+
 
201
   _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *);
 
202
   void _Unwind_Complete(_Unwind_Control_Block *ucbp);
 
203
   void _Unwind_DeleteException (_Unwind_Exception *);
 
204
Index: libffi/src/arm/ffi.c
 
205
===================================================================
 
206
--- libffi/src/arm/ffi.c        (revision 126979)
 
207
+++ libffi/src/arm/ffi.c        (revision 127340)
 
208
@@ -40,7 +40,7 @@
 
209
 
 
210
   argp = stack;
 
211
 
 
212
-  if ( ecif->cif->rtype->type == FFI_TYPE_STRUCT ) {
 
213
+  if ( ecif->cif->flags == FFI_TYPE_STRUCT ) {
 
214
     *(void **) argp = ecif->rvalue;
 
215
     argp += 4;
 
216
   }
 
217
@@ -58,6 +58,9 @@
 
218
        argp = (char *) ALIGN(argp, (*p_arg)->alignment);
 
219
       }
 
220
 
 
221
+      if ((*p_arg)->type == FFI_TYPE_STRUCT)
 
222
+       argp = (char *) ALIGN(argp, 4);
 
223
+
 
224
          z = (*p_arg)->size;
 
225
          if (z < sizeof(int))
 
226
            {
 
227
@@ -81,7 +84,7 @@
 
228
                  break;
 
229
                  
 
230
                case FFI_TYPE_STRUCT:
 
231
-                 *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
 
232
+                 memcpy(argp, *p_argv, (*p_arg)->size);
 
233
                  break;
 
234
 
 
235
                default:
 
236
@@ -115,7 +118,6 @@
 
237
   switch (cif->rtype->type)
 
238
     {
 
239
     case FFI_TYPE_VOID:
 
240
-    case FFI_TYPE_STRUCT:
 
241
     case FFI_TYPE_FLOAT:
 
242
     case FFI_TYPE_DOUBLE:
 
243
       cif->flags = (unsigned) cif->rtype->type;
 
244
@@ -126,6 +128,17 @@
 
245
       cif->flags = (unsigned) FFI_TYPE_SINT64;
 
246
       break;
 
247
 
 
248
+    case FFI_TYPE_STRUCT:
 
249
+      if (cif->rtype->size <= 4)
 
250
+       /* A Composite Type not larger than 4 bytes is returned in r0.  */
 
251
+       cif->flags = (unsigned)FFI_TYPE_INT;
 
252
+      else
 
253
+       /* A Composite Type larger than 4 bytes, or whose size cannot
 
254
+          be determined statically ... is stored in memory at an
 
255
+          address passed [in r0].  */
 
256
+       cif->flags = (unsigned)FFI_TYPE_STRUCT;
 
257
+      break;
 
258
+
 
259
     default:
 
260
       cif->flags = FFI_TYPE_INT;
 
261
       break;
 
262
@@ -141,21 +154,27 @@
 
263
 {
 
264
   extended_cif ecif;
 
265
 
 
266
+  int small_struct = (cif->flags == FFI_TYPE_INT 
 
267
+                     && cif->rtype->type == FFI_TYPE_STRUCT);
 
268
+
 
269
   ecif.cif = cif;
 
270
   ecif.avalue = avalue;
 
271
+
 
272
+  unsigned int temp;
 
273
   
 
274
   /* If the return value is a struct and we don't have a return        */
 
275
   /* value address then we need to make one                    */
 
276
 
 
277
   if ((rvalue == NULL) && 
 
278
-      (cif->rtype->type == FFI_TYPE_STRUCT))
 
279
+      (cif->flags == FFI_TYPE_STRUCT))
 
280
     {
 
281
       ecif.rvalue = alloca(cif->rtype->size);
 
282
     }
 
283
+  else if (small_struct)
 
284
+    ecif.rvalue = &temp;
 
285
   else
 
286
     ecif.rvalue = rvalue;
 
287
-    
 
288
-  
 
289
+
 
290
   switch (cif->abi) 
 
291
     {
 
292
     case FFI_SYSV:
 
293
@@ -167,6 +186,8 @@
 
294
       FFI_ASSERT(0);
 
295
       break;
 
296
     }
 
297
+  if (small_struct)
 
298
+    memcpy (rvalue, &temp, cif->rtype->size);
 
299
 }
 
300
 
 
301
 /** private members **/
 
302
@@ -228,9 +249,12 @@
 
303
     {
 
304
       size_t z;
 
305
 
 
306
+      size_t alignment = (*p_arg)->alignment;
 
307
+      if (alignment < 4)
 
308
+       alignment = 4;
 
309
       /* Align if necessary */
 
310
-      if ((sizeof(int) - 1) & (unsigned) argp) {
 
311
-       argp = (char *) ALIGN(argp, sizeof(int));
 
312
+      if ((alignment - 1) & (unsigned) argp) {
 
313
+       argp = (char *) ALIGN(argp, alignment);
 
314
       }
 
315
 
 
316
       z = (*p_arg)->size;
 
317
@@ -248,21 +272,16 @@
 
318
 
 
319
 /* How to make a trampoline.  */
 
320
 
 
321
-#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \
 
322
-({ unsigned char *__tramp = (unsigned char*)(TRAMP); \
 
323
-   unsigned int  __fun = (unsigned int)(FUN); \
 
324
-   unsigned int  __ctx = (unsigned int)(CTX); \
 
325
+#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX)                             \
 
326
+({ unsigned char *__tramp = (unsigned char*)(TRAMP);                   \
 
327
+   unsigned int  __fun = (unsigned int)(FUN);                          \
 
328
+   unsigned int  __ctx = (unsigned int)(CTX);                          \
 
329
    *(unsigned int*) &__tramp[0] = 0xe92d000f; /* stmfd sp!, {r0-r3} */ \
 
330
-   *(unsigned int*) &__tramp[4] = 0xe59f0000; /* ldr r0, [pc] */ \
 
331
-   *(unsigned int*) &__tramp[8] = 0xe59ff000; /* ldr pc, [pc] */ \
 
332
-   *(unsigned int*) &__tramp[12] = __ctx; \
 
333
-   *(unsigned int*) &__tramp[16] = __fun; \
 
334
-   register unsigned long _beg __asm ("a1") = (unsigned long) (&__tramp[0]);   \
 
335
-   register unsigned long _end __asm ("a2") = (unsigned long) (&__tramp[19]);  \
 
336
-   register unsigned long _flg __asm ("a3") = 0;                       \
 
337
-   __asm __volatile ("swi 0x9f0002             @ sys_cacheflush"       \
 
338
-                           : "=r" (_beg)                               \
 
339
-                           : "0" (_beg), "r" (_end), "r" (_flg));      \
 
340
+   *(unsigned int*) &__tramp[4] = 0xe59f0000; /* ldr r0, [pc] */       \
 
341
+   *(unsigned int*) &__tramp[8] = 0xe59ff000; /* ldr pc, [pc] */       \
 
342
+   *(unsigned int*) &__tramp[12] = __ctx;                              \
 
343
+   *(unsigned int*) &__tramp[16] = __fun;                              \
 
344
+   __clear_cache((&__tramp[0]), (&__tramp[19]));                       \
 
345
  })
 
346
 
 
347
 
119
348
Index: gcc/config/arm/libunwind.S
120
349
===================================================================
121
350
--- gcc/config/arm/libunwind.S  (revision 126979)