~ubuntu-branches/ubuntu/lucid/libsdl1.2/lucid

« back to all changes in this revision

Viewing changes to debian/patches/213_hermes_pic_support.diff

  • Committer: lool at dooz
  • Date: 2010-02-26 14:18:51 UTC
  • mfrom: (2.2.3 sid)
  • Revision ID: lool@dooz.org-20100226141851-c8vnqbycwx36z0w9
* Drop explicit -Wl,-Bsymbolic-functions LDFLAGS since that's the default in
  Ubuntu anyway.
* Re-add --disable-audio-arts to udeb_confflags, no need to diverge from
  Debian here since we don't have aRts anyway.
* Merge from Debian unstable, remaining changes:
  * Drop aRts support: drop libarts1-dev and libartsc0-dev build-deps,
    deps, drop libsdl1.2debian-arts package from control, drop alternate dep
    of libsdl1.2-debian on libsdl1.2debian-arts, pass --enable-arts=no in
    confflags, drop arts from FLAVOURS in rules.
  * Drop svgalib support: drop build-dep and deps on libsvga1-dev, drop
    mention of "svga" driver in libsdl1.2debian's description.
* Move -dev Recommends back to Depends, as other packages may want to 
  statically link with libsdl.a. (Closes: #565579).
* Add build-dep on libglu1-mesa-dev to enable OpenGL support. (LP: #328932)
* Disable Playstation 3 Cell driver on PPC. (Closes: #564846).
  + Thanks to Scott Kitterman at Ubuntu for finding fix from Gentoo.
* 222_joystick_crash.diff - Fix crash with dpad joystick. (Closes: #564831).
  + Thanks to Tarek Soliman for catching the fix from upstream.
* Upload to unstable.
* Update 215_kfreebsd_gnu.diff patch to fix FTBFS on kFreeBSD.
  + Thanks to Christoph Egger for the fix!
* Add ${misc:Depends} for binary packages for Debhelper package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Index: libsdl1.2-1.2.10/src/hermes/common.inc
 
2
===================================================================
 
3
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
 
4
+++ libsdl1.2-1.2.10/src/hermes/common.inc      2006-05-31 15:22:16.000000000 +0200
 
5
@@ -0,0 +1,84 @@
 
6
+;
 
7
+; PIC support for HERMES
 
8
+; Copyright (c) 2006 Sam Hocevar <sam@zoy.org>
 
9
+; This source code is licensed under the GNU LGPL
 
10
+; 
 
11
+; Please refer to the file COPYING.LIB contained in the distribution for
 
12
+; licensing conditions         
 
13
+
 
14
+
 
15
+; These macros are totally harmless when PIC is not defined but can ruin
 
16
+; everything if misused in PIC mode. On x86, shared objects cannot directly
 
17
+; access global variables by address, they need to go through the GOT (global
 
18
+; offset table). Most OSes do not care about it and let you load non-shared
 
19
+; .so objects (Linux, Win32...). However, OS X requires PIC code in its
 
20
+; .dylib objects.
 
21
+;
 
22
+; - GOT_* should be used as a suffix for global addressing, eg.
 
23
+;     mov eax, [foo GOT_ebx]
 
24
+;   instead of
 
25
+;     mov eax, [foo]
 
26
+;
 
27
+; - picgetgot computes the GOT address into the given register in PIC
 
28
+;   mode, otherwise does nothing. You need to do this before using GLOBAL.
 
29
+;
 
30
+; - picpush and picpop respectively push and pop the given register
 
31
+;   in PIC mode, otherwise do nothing. You should always use them around
 
32
+;   picgetgot except when sure that the register is no longer used and is
 
33
+;   being restored later by other means.
 
34
+;
 
35
+; - picesp is defined to compensate the changing of esp when pushing
 
36
+;   a register into the stack, eg.
 
37
+;     mov eax, [esp + 8]
 
38
+;     pushpic  ebx
 
39
+;     mov eax, [picesp + 12]
 
40
+;   instead of
 
41
+;     mov eax, [esp + 8]
 
42
+;     pushpic  ebx
 
43
+;     mov eax, [esp + 12]
 
44
+;
 
45
+; - picjmp jumps to a global address:
 
46
+;     picgetgot ebx
 
47
+;     picjmp ebx, far_address
 
48
+;   instead of
 
49
+;     jmp far_address
 
50
+;
 
51
+%ifdef PIC
 
52
+       EXTERN _GLOBAL_OFFSET_TABLE_
 
53
+       %define GOT_eax + eax wrt ..gotoff
 
54
+       %define GOT_ebx + ebx wrt ..gotoff
 
55
+       %define GOT_ecx + ecx wrt ..gotoff
 
56
+       %define GOT_edx + edx wrt ..gotoff
 
57
+       %macro picgetgot 1
 
58
+               call %%getgot
 
59
+           %%getgot:
 
60
+               pop %1
 
61
+               add %1, _GLOBAL_OFFSET_TABLE_ + $$ - %%getgot wrt ..gotpc
 
62
+       %endmacro
 
63
+       %macro picpush 1
 
64
+               push %1
 
65
+       %endmacro
 
66
+       %macro picpop 1
 
67
+               pop %1
 
68
+       %endmacro
 
69
+       %define picesp esp+4
 
70
+       %macro picjmp 2
 
71
+               jmp [%2 + %1 wrt ..got]
 
72
+       %endmacro
 
73
+%else
 
74
+       %define GOT_eax
 
75
+       %define GOT_ebx
 
76
+       %define GOT_ecx
 
77
+       %define GOT_edx
 
78
+       %macro picgetgot 1
 
79
+       %endmacro
 
80
+       %macro picpush 1
 
81
+       %endmacro
 
82
+       %macro picpop 1
 
83
+       %endmacro
 
84
+       %define picesp esp
 
85
+       %macro picjmp 2
 
86
+               jmp %2
 
87
+       %endmacro
 
88
+%endif
 
89
+
 
90
Index: libsdl1.2-1.2.10/src/hermes/mmxp2_32.asm
 
91
===================================================================
 
92
--- libsdl1.2-1.2.10.orig/src/hermes/mmxp2_32.asm       2006-05-01 10:02:38.000000000 +0200
 
93
+++ libsdl1.2-1.2.10/src/hermes/mmxp2_32.asm    2006-05-31 15:32:58.000000000 +0200
 
94
@@ -18,6 +18,8 @@
 
95
 ; are, they're terrible on p5 MMXs, but less so on pIIs.  Someone needs to
 
96
 ; optimise them for p5 MMXs..
 
97
 
 
98
+%include "common.inc"
 
99
+
 
100
 BITS 32
 
101
 
 
102
        
 
103
@@ -259,7 +263,8 @@
 
104
         jnz .L3
 
105
 
 
106
 .L4:
 
107
-        jmp _mmxreturn
 
108
+        picgetgot ecx
 
109
+        picjmp ecx, _mmxreturn
 
110
 
 
111
 _ConvertMMXpII32_16BGR555:
 
112
 
 
113
@@ -399,7 +404,8 @@
 
114
        jnz .L3 
 
115
 
 
116
 .L4:           
 
117
-       jmp _mmxreturn
 
118
+       picgetgot ecx
 
119
+       picjmp ecx, _mmxreturn
 
120
 
 
121
 %ifidn __OUTPUT_FORMAT__,elf
 
122
 section .note.GNU-stack noalloc noexec nowrite progbits
 
123
Index: libsdl1.2-1.2.10/src/hermes/x86_main.asm
 
124
===================================================================
 
125
--- libsdl1.2-1.2.10.orig/src/hermes/x86_main.asm       2006-05-01 10:02:38.000000000 +0200
 
126
+++ libsdl1.2-1.2.10/src/hermes/x86_main.asm    2006-05-31 15:22:16.000000000 +0200
 
127
@@ -9,6 +9,8 @@
 
128
 ; Most routines are (c) Glenn Fiedler (ptc@gaffer.org), used with permission
 
129
 ; 
 
130
 
 
131
+%include "common.inc"
 
132
+
 
133
 BITS 32
 
134
 
 
135
 GLOBAL _ConvertX86
 
136
Index: libsdl1.2-1.2.10/src/hermes/x86p_16.asm
 
137
===================================================================
 
138
--- libsdl1.2-1.2.10.orig/src/hermes/x86p_16.asm        2006-05-01 10:02:38.000000000 +0200
 
139
+++ libsdl1.2-1.2.10/src/hermes/x86p_16.asm     2006-05-31 15:22:16.000000000 +0200
 
140
@@ -10,7 +10,8 @@
 
141
 ; Used with permission.
 
142
 ; 
 
143
 
 
144
-       
 
145
+%include "common.inc"
 
146
+
 
147
 BITS 32
 
148
 
 
149
 GLOBAL _ConvertX86p16_32RGB888
 
150
@@ -54,7 +55,8 @@
 
151
     dec ecx
 
152
     jnz .L1
 
153
 .L2
 
154
-    jmp _x86return
 
155
+    picgetgot ebx
 
156
+    picjmp ebx, _x86return
 
157
 
 
158
 .L3 ; head
 
159
     mov eax,edi
 
160
@@ -132,7 +134,8 @@
 
161
     add edi,BYTE 2
 
162
 
 
163
 .L7
 
164
-    jmp _x86return
 
165
+    picgetgot ebx
 
166
+    picjmp ebx, _x86return
 
167
 
 
168
 
 
169
 
 
170
@@ -161,7 +164,8 @@
 
171
     dec ecx
 
172
     jnz .L1
 
173
 .L2
 
174
-    jmp _x86return
 
175
+    picgetgot ebx
 
176
+    picjmp ebx, _x86return
 
177
 
 
178
 .L3 ; head
 
179
     mov eax,edi
 
180
@@ -240,7 +244,8 @@
 
181
     jmp SHORT .L6
 
182
 
 
183
 .L7 pop ebp
 
184
-    jmp _x86return
 
185
+    picgetgot ebx
 
186
+    picjmp ebx, _x86return
 
187
 
 
188
 
 
189
 
 
190
@@ -274,7 +279,8 @@
 
191
     dec ecx
 
192
     jnz .L1
 
193
 .L2
 
194
-    jmp _x86return
 
195
+    picgetgot ebx
 
196
+    picjmp ebx, _x86return
 
197
 
 
198
 .L3 ; head
 
199
     mov eax,edi
 
200
@@ -358,7 +364,8 @@
 
201
     add edi,BYTE 2
 
202
 
 
203
 .L7
 
204
-    jmp _x86return
 
205
+    picgetgot ebx
 
206
+    picjmp ebx, _x86return
 
207
 
 
208
 
 
209
 
 
210
@@ -391,7 +398,8 @@
 
211
     dec ecx
 
212
     jnz .L1
 
213
 .L2
 
214
-    jmp _x86return
 
215
+    picgetgot ebx
 
216
+    picjmp ebx, _x86return
 
217
 
 
218
 .L3 mov eax,edi
 
219
     and eax,BYTE 11b
 
220
@@ -489,7 +497,8 @@
 
221
     jnz .L6
 
222
 
 
223
 .L7 pop ebp
 
224
-    jmp _x86return
 
225
+    picgetgot ebx
 
226
+    picjmp ebx, _x86return
 
227
 
 
228
 %ifidn __OUTPUT_FORMAT__,elf
 
229
 section .note.GNU-stack noalloc noexec nowrite progbits
 
230
Index: libsdl1.2-1.2.10/src/hermes/x86p_32.asm
 
231
===================================================================
 
232
--- libsdl1.2-1.2.10.orig/src/hermes/x86p_32.asm        2006-05-01 10:02:38.000000000 +0200
 
233
+++ libsdl1.2-1.2.10/src/hermes/x86p_32.asm     2006-05-31 15:22:16.000000000 +0200
 
234
@@ -9,6 +9,7 @@
 
235
 ; Most routines are (c) Glenn Fiedler (ptc@gaffer.org), used with permission
 
236
 ; 
 
237
 
 
238
+%include "common.inc"
 
239
        
 
240
 BITS 32
 
241
 
 
242
@@ -52,7 +53,8 @@
 
243
     dec ecx
 
244
     jnz .L1
 
245
 .L2
 
246
-    jmp _x86return
 
247
+    picgetgot ebx
 
248
+    picjmp ebx, _x86return
 
249
 
 
250
 .L3 ; save ebp
 
251
     push ebp
 
252
@@ -112,7 +114,8 @@
 
253
     jnz .L5
 
254
 
 
255
 .L6 pop ebp
 
256
-    jmp _x86return
 
257
+    picgetgot ebx
 
258
+    picjmp ebx, _x86return
 
259
        
 
260
 
 
261
        
 
262
@@ -132,7 +135,8 @@
 
263
     dec ecx
 
264
     jnz .L1
 
265
 .L2
 
266
-    jmp _x86return
 
267
+    picgetgot ebx
 
268
+    picjmp ebx, _x86return
 
269
 
 
270
 .L3 ; save ebp
 
271
     push ebp
 
272
@@ -183,7 +187,8 @@
 
273
     jnz .L5
 
274
 
 
275
 .L6 pop ebp
 
276
-    jmp _x86return
 
277
+    picgetgot ebx
 
278
+    picjmp ebx, _x86return
 
279
 
 
280
        
 
281
 
 
282
@@ -203,7 +208,8 @@
 
283
     dec ecx
 
284
     jnz .L1
 
285
 .L2
 
286
-    jmp _x86return
 
287
+    picgetgot ebx
 
288
+    picjmp ebx, _x86return
 
289
 
 
290
 .L3 ; save ebp
 
291
     push ebp
 
292
@@ -256,7 +262,8 @@
 
293
     jnz .L5
 
294
 
 
295
 .L6 pop ebp
 
296
-    jmp _x86return
 
297
+    picgetgot ebx
 
298
+    picjmp ebx, _x86return
 
299
 
 
300
 
 
301
        
 
302
@@ -281,7 +288,8 @@
 
303
        dec ecx
 
304
        jnz .L1
 
305
 .L2 
 
306
-       jmp _x86return
 
307
+       picgetgot ebx
 
308
+       picjmp ebx, _x86return
 
309
 
 
310
 .L3    ;        head
 
311
        mov edx,edi
 
312
@@ -353,7 +361,8 @@
 
313
        jnz .L6
 
314
 
 
315
 .L7    pop ebp
 
316
-       jmp _x86return
 
317
+       picgetgot ebx
 
318
+       picjmp ebx, _x86return
 
319
 
 
320
 
 
321
 
 
322
@@ -379,7 +388,8 @@
 
323
        dec ecx
 
324
        jnz .L1
 
325
 .L2
 
326
-       jmp _x86return
 
327
+       picgetgot ebx
 
328
+       picjmp ebx, _x86return
 
329
 
 
330
 .L3 ; head
 
331
        mov edx,edi
 
332
@@ -454,7 +464,8 @@
 
333
 
 
334
 .L7 
 
335
        pop ebp
 
336
-       jmp _x86return
 
337
+       picgetgot ebx
 
338
+       picjmp ebx, _x86return
 
339
  
 
340
 
 
341
        
 
342
@@ -483,7 +494,8 @@
 
343
        jnz .L1
 
344
 
 
345
 .L2:                           ; End of short loop
 
346
-       jmp _x86return
 
347
+       picgetgot ebx
 
348
+       picjmp ebx, _x86return
 
349
 
 
350
        
 
351
 .L3    ; head
 
352
@@ -569,7 +581,8 @@
 
353
        add edi,BYTE 2
 
354
 
 
355
 .L7:   
 
356
-       jmp _x86return
 
357
+       picgetgot ebx
 
358
+       picjmp ebx, _x86return
 
359
 
 
360
 
 
361
 
 
362
@@ -598,7 +611,8 @@
 
363
        dec ecx
 
364
        jnz .L1
 
365
 .L2
 
366
-       jmp _x86return
 
367
+       picgetgot ebx
 
368
+       picjmp ebx, _x86return
 
369
 
 
370
 .L3    ; head
 
371
        mov ebx,edi
 
372
@@ -683,7 +697,8 @@
 
373
        add edi,BYTE 2
 
374
 
 
375
 .L7 
 
376
-       jmp _x86return
 
377
+       picgetgot ebx
 
378
+       picjmp ebx, _x86return
 
379
 
 
380
 
 
381
        
 
382
@@ -712,7 +727,8 @@
 
383
        dec ecx
 
384
        jnz .L1
 
385
 .L2
 
386
-       jmp _x86return
 
387
+       picgetgot ebx
 
388
+       picjmp ebx, _x86return
 
389
 
 
390
 .L3    ; head
 
391
        mov ebx,edi
 
392
@@ -794,7 +810,8 @@
 
393
        add edi,BYTE 2
 
394
 
 
395
 .L7
 
396
-       jmp _x86return
 
397
+       picgetgot ebx
 
398
+       picjmp ebx, _x86return
 
399
 
 
400
 
 
401
 
 
402
@@ -824,7 +841,8 @@
 
403
        dec ecx
 
404
        jnz .L1
 
405
 .L2 
 
406
-       jmp _x86return
 
407
+       picgetgot ebx
 
408
+       picjmp ebx, _x86return
 
409
 
 
410
 .L3    ; head
 
411
        mov ebx,edi
 
412
@@ -909,7 +927,8 @@
 
413
        add edi,BYTE 2
 
414
 
 
415
 .L7
 
416
-       jmp _x86return
 
417
+       picgetgot ebx
 
418
+       picjmp ebx, _x86return
 
419
 
 
420
 
 
421
 
 
422
@@ -1039,7 +1058,8 @@
 
423
        jnz .L3
 
424
        
 
425
 .L4:   
 
426
-       jmp _x86return
 
427
+       picgetgot ebx
 
428
+       picjmp ebx, _x86return
 
429
 
 
430
 %ifidn __OUTPUT_FORMAT__,elf
 
431
 section .note.GNU-stack noalloc noexec nowrite progbits