]> git.pld-linux.org Git - packages/Glide_V2.git/blob - glide-morearchs.patch
- added format patch (fixes build with -Werror=format-security)
[packages/Glide_V2.git] / glide-morearchs.patch
1 --- GlideV2/glide2x/cvg/init/sst1init.h.orig    2013-09-21 07:41:42.484397830 +0200
2 +++ GlideV2/glide2x/cvg/init/sst1init.h 2013-09-21 07:46:29.837739823 +0200
3 @@ -163,4 +163,16 @@
4  #elif defined (__GNUC__) && defined(__i386__)
5  #  define P6FENCE asm("xchg %%eax,%0" : /*outputs*/ : "m" (p6FenceVar) : \
6                                         "eax");
7 +#elif defined(__ia64__)
8 +#define P6FENCE asm volatile ("mf.a" ::: "memory");
9 +#elif defined(__alpha__)
10 +# define P6FENCE asm volatile("mb" ::: "memory");
11 +#elif defined(__powerpc__)
12 +# define P6FENCE asm volatile ("sync" ::: "memory");
13 +#elif defined (__x86_64__)
14 +# define P6FENCE asm volatile("mfence" ::: "memory");
15 +#elif defined(__sparc64__)
16 +# define P6FENCE asm volatile("membar #LoadLoad | #LoadStore | #StoreStore | #StoreLoad" ::: "memory");
17 +#elif defined(__sparc__)
18 +# define P6FENCE asm volatile("" ::: "memory");
19  #else
20 --- GlideV2/glide2x/cvg/glide/src/cpudetect.c.orig      2000-04-20 23:26:36.000000000 +0200
21 +++ GlideV2/glide2x/cvg/glide/src/cpudetect.c   2013-09-21 08:28:32.804847399 +0200
22 @@ -34,14 +34,25 @@
23  }
24  
25  void single_precision_asm() {
26 +#if defined(__x86_64__)
27 +  asm("push %rax \n fnclex \n fstcw (%rsp) \n movl (%rsp), %eax \n "
28 +      "and $0x0000fcff, %eax \n movl %eax, (%rsp) \n fldcw (%rsp) \n pop %rax");
29 +#elif defined(__i386__)
30    asm("push %eax \n fnclex \n fstcw (%esp) \n movl (%esp), %eax \n "
31        "and $0x0000fcff, %eax \n movl %eax, (%esp) \n fldcw (%esp) \n pop %eax");
32 +#endif
33  }
34  
35  
36  void double_precision_asm() {
37 -  asm("push %eax \n fnclex \n fstcw (%esp) \n movw (%esp), %eax \n "
38 +#if defined(__x86_64__)
39 +  asm("push %rax \n fnclex \n fstcw (%rsp) \n movl (%rsp), %eax \n "
40 +      "and $0x0000fcff, %eax \n or $0x000002ff, %eax \n mov %eax, (%rsp) \n "
41 +      "fldcw (%rsp) \n pop %rax");
42 +#elif defined(__i386__)
43 +  asm("push %eax \n fnclex \n fstcw (%esp) \n movl (%esp), %eax \n "
44        "and $0x0000fcff, %eax \n or $0x000002ff, %eax \n mov %eax, (%esp) \n "
45        "fldcw (%esp) \n pop %eax");
46 +#endif
47  }
48  
49 --- GlideV2/glide2x/cvg/init/makefile.linux.orig        2000-04-20 23:26:36.000000000 +0200
50 +++ GlideV2/glide2x/cvg/init/makefile.linux     2013-09-21 10:33:25.196185785 +0200
51 @@ -52,5 +52,5 @@
52  # for some strange reason
53  #
54  ifndef DEBUG
55 -CFLAGS = -g $(GCFLAGS) $(LCFLAGS) $(VCFLAGS)
56 +CFLAGS = -g $(GCFLAGS) $(LCFLAGS) $(VCFLAGS) -fPIC
57  endif
58 --- GlideV2/glide3x/cvg/init/sst1init.h.orig    2013-09-21 07:41:42.484397830 +0200
59 +++ GlideV2/glide3x/cvg/init/sst1init.h 2013-09-21 07:46:29.837739823 +0200
60 @@ -163,4 +163,16 @@
61  #elif defined (__GNUC__) && defined(__i386__)
62  #  define P6FENCE asm("xchg %%eax,%0" : /*outputs*/ : "m" (p6FenceVar) : \
63                                         "eax");
64 +#elif defined(__ia64__)
65 +#define P6FENCE asm volatile ("mf.a" ::: "memory");
66 +#elif defined(__alpha__)
67 +# define P6FENCE asm volatile("mb" ::: "memory");
68 +#elif defined(__powerpc__)
69 +# define P6FENCE asm volatile ("sync" ::: "memory");
70 +#elif defined (__x86_64__)
71 +# define P6FENCE asm volatile("mfence" ::: "memory");
72 +#elif defined(__sparc64__)
73 +# define P6FENCE asm volatile("membar #LoadLoad | #LoadStore | #StoreStore | #StoreLoad" ::: "memory");
74 +#elif defined(__sparc__)
75 +# define P6FENCE asm volatile("" ::: "memory");
76  #else
77 --- GlideV2/glide3x/cvg/glide3/src/makefile.linux.orig  2000-04-20 23:26:39.000000000 +0200
78 +++ GlideV2/glide3x/cvg/glide3/src/makefile.linux       2013-09-21 14:30:15.403246286 +0200
79 @@ -144,7 +144,7 @@
80  CFILES          =       gxdraw.c
81  else
82  CFILES          =       gxdraw.c
83 -ASMTRISETUP     =       xdraw2.S xdraw3.S
84 +ASMTRISETUP     =       xdraw2.S xdraw3.S cpudtect.S
85  DSPOPTS         +=       -DGLIDE_PACKED_RGB=0 -DGLIDE_TRI_CULLING=1
86  endif
87  
88 @@ -193,7 +193,7 @@
89  LAINCS          =       -I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include
90  LAOPTS          =       $(DBGOPTS) $(DSPOPTS) $(OPTOPTS)
91  
92 -AFILES          =       $(ASMTRISETUP) cpudtect.S
93 +AFILES          =       $(ASMTRISETUP)
94  
95  # sources
96  HEADERS         =       glide.h glidesys.h glideutl.h
97 --- GlideV2/glide3x/cvg/init/makefile.linux.orig        2000-04-20 23:26:36.000000000 +0200
98 +++ GlideV2/glide3x/cvg/init/makefile.linux     2013-09-21 10:33:25.196185785 +0200
99 @@ -52,5 +52,5 @@
100  # for some strange reason
101  #
102  ifndef DEBUG
103 -CFLAGS = -g $(GCFLAGS) $(LCFLAGS) $(VCFLAGS)
104 +CFLAGS = -g $(GCFLAGS) $(LCFLAGS) $(VCFLAGS) -fPIC
105  endif
106 --- GlideV2/glide3x/cvg/glide3/src/gdraw.c.orig 2013-09-22 19:48:44.822836076 +0200
107 +++ GlideV2/glide3x/cvg/glide3/src/gdraw.c      2013-09-23 19:53:38.014765302 +0200
108 @@ -243,7 +243,7 @@
109      vlist[0] = (float *)a;
110      vlist[1] = (float *)b;
111      vlist[2] = (float *)c;
112 -    _grDrawTriangles(GR_VTX_PTR_ARRAY, 3, vlist);
113 +    _grDrawTriangles_Default(GR_VTX_PTR_ARRAY, 3, vlist);
114    } else {
115      /* 
116      ** draw a simple triangle 
117 --- GlideV2/glide3x/cvg/glide3/src/gpci.c.orig  2000-04-20 23:26:39.000000000 +0200
118 +++ GlideV2/glide3x/cvg/glide3/src/gpci.c       2013-09-23 20:33:53.300359679 +0200
119 @@ -221,6 +221,16 @@
120  /* Collection of all of the known procs for a given system */
121  static GrTriSetupProc _triSetupProcs[][2][2] = 
122  {
123 +#ifdef GLIDE_USE_C_TRISETUP
124 +  {
125 +    { NULL, NULL },
126 +    { NULL, _vptrisetup_cull }
127 +  },
128 +  {
129 +    { NULL, NULL },
130 +    { NULL, _vptrisetup_cull }
131 +  }
132 +#else
133    /* Default Procs */
134    {
135      { _trisetup_Default_Default, _trisetup_Default_cull }, /* GR_WINDOW_COORDS */
136 @@ -233,10 +243,20 @@
137      { _trisetup_clip_coor_thunk, _trisetup_clip_coor_thunk }, /* GR_CLIP_COORDS */
138    },
139  #endif /* GL_AMD3D */
140 +#endif
141  };
142  
143 +#ifdef GLIDE_USE_C_TRISETUP
144 +void FX_CSTYLE
145 +_grDrawVertexList(FxU32 pktype, FxU32 type, FxI32 mode, FxI32 count, void *pointers);
146 +#endif
147 +
148  static GrVertexListProc _vertexListProcs[][2] = {
149 +#ifdef GLIDE_USE_C_TRISETUP
150 +  { _grDrawVertexList, _grDrawVertexList },
151 +#else
152    { _drawvertexlist, _vpdrawvertexlist },
153 +#endif
154  #if GL_AMD3D
155    { _grDrawVertexList_3DNow_Window, _grDrawVertexList_3DNow_Clip }
156  #endif /* GL_AMD3D */
157 @@ -577,7 +597,12 @@
158  
159    /* Setup the basic proc tables based on the cpu type. */
160    {
161 -    _GlideRoot.CPUType = _cpu_detect_asm();
162 +    _GlideRoot.CPUType =
163 +#ifdef __i386__
164 +      _cpu_detect_asm();
165 +#else
166 +      0;
167 +#endif
168      if (GETENV("FX_CPU")) _GlideRoot.CPUType = atoi(GETENV("FX_CPU"));
169  
170      /* Default case */
This page took 0.045908 seconds and 3 git commands to generate.