Use named variable instead of $2
[harbours.git] / pcc / pcc-helenos.patch
blobb9c0bc2a30c4bff86b9c64bcf7c1210841a8b9b0
1 diff -ur --unidirectional-new-file pcc-1.0.0/cc/cc/cc.c pcc/cc/cc/cc.c
2 --- pcc-1.0.0/cc/cc/cc.c 2011-03-15 20:25:36.000000000 +0100
3 +++ pcc/cc/cc/cc.c 2013-09-11 19:46:33.156788000 +0200
4 @@ -284,6 +284,7 @@
5 /*
6 * Wide char defines.
7 */
8 + #if 0
9 #if WCHAR_TYPE == USHORT
10 #define WCT "short unsigned int"
11 #define WCM "65535U"
12 @@ -305,6 +306,11 @@
13 #else
14 #error WCHAR_TYPE not defined or invalid
15 #endif
16 + #endif
18 +#define WCT "int"
19 +#define WCM "2147483647"
22 #ifdef GCC_COMPAT
23 #ifndef REGISTER_PREFIX
24 @@ -1143,6 +1149,11 @@
28 +#ifdef __helenos__
29 + av[j++] = "-T";
30 + av[j++] = "/inc/_link.ld";
31 +#endif
33 av[j++] = 0;
34 eflag |= callsys(ld, av);
35 if (nc==1 && nxo==1 && eflag==0)
36 @@ -1326,6 +1337,63 @@
37 return (exitCode != 0);
40 +#elif defined(__helenos__)
42 +#include <task.h>
44 +int callsys(char *f, char *v[])
46 + size_t len;
47 + char *path = NULL;
48 + const char *s;
49 + int t;
50 + task_exit_t texit;
51 + int retval;
53 + task_id_t tid;
55 + if (vflag) {
56 + fprintf(stderr, "%s ", f);
57 + for (t = 1; v[t]; t++)
58 + fprintf(stderr, "%s ", v[t]);
59 + fprintf(stderr, "\n");
60 + }
62 + if (Bflag) {
63 + len = strlen (Bflag) + 8;
64 + path = malloc (len);
65 + if (path == NULL) {
66 + error("callsys: malloc failed");
67 + exit(1);
68 + }
69 + if ((s = strrchr(f, '/'))) {
70 + strlcpy(path, Bflag, len);
71 + strlcat(path, s, len);
72 + if (task_spawnv(&tid, path, v) == 0)
73 + goto _wait;
74 + }
75 + }
77 + if (task_spawnv(&tid, f, v) == 0)
78 + goto _wait;
80 + if ((s = strrchr(f, '/')) && task_spawnv (&tid, s + 1, v) == 0)
81 + goto _wait;
83 + errorx(8, "Can't find %s\n", f);
84 + return 0;
86 +_wait:
89 + if (task_wait (tid, &texit, &retval) != 0) {
90 + error("Couldn't wait on task");
91 + return 0;
92 + }
94 + return retval;
97 #else
99 int
100 diff -ur --unidirectional-new-file pcc-1.0.0/cc/cc/Makefile pcc/cc/cc/Makefile
101 --- pcc-1.0.0/cc/cc/Makefile 1970-01-01 01:00:00.000000000 +0100
102 +++ pcc/cc/cc/Makefile 2013-09-11 19:46:33.156788000 +0200
103 @@ -0,0 +1,49 @@
105 +# Copyright (c) 2011 Jiri Zarevucky
106 +# All rights reserved.
108 +# Redistribution and use in source and binary forms, with or without
109 +# modification, are permitted provided that the following conditions
110 +# are met:
112 +# - Redistributions of source code must retain the above copyright
113 +# notice, this list of conditions and the following disclaimer.
114 +# - Redistributions in binary form must reproduce the above copyright
115 +# notice, this list of conditions and the following disclaimer in the
116 +# documentation and/or other materials provided with the distribution.
117 +# - The name of the author may not be used to endorse or promote products
118 +# derived from this software without specific prior written permission.
120 +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
121 +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
122 +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
123 +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
124 +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
125 +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
126 +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
127 +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
128 +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
129 +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
132 +MIPDIR = ../../mip
133 +ARCHDIR = ../../arch/$(PLATFORM)
134 +OSDIR = ../../os/helenos
135 +EXTRA_CFLAGS = -I$(MIPDIR) -I$(ARCHDIR) -I$(OSDIR) -w
136 +DEFS = -Dmach_$(PLATFORM) -D__helenos__
137 +BINARY = cc
139 +PRE_DEPEND = compat.c
140 +EXTRA_CLEAN = compat.c
142 +POSIX_COMPAT = y
144 +SOURCES = \
145 + cc.c \
146 + compat.c
148 +include $(USPACE_PREFIX)/Makefile.common
150 +compat.c: $(MIPDIR)/compat.c
151 + ln -s -f $^ $@
153 diff -ur --unidirectional-new-file pcc-1.0.0/cc/ccom/arch/amd64/external.c pcc/cc/ccom/arch/amd64/external.c
154 --- pcc-1.0.0/cc/ccom/arch/amd64/external.c 1970-01-01 01:00:00.000000000 +0100
155 +++ pcc/cc/ccom/arch/amd64/external.c 2013-09-11 19:46:33.156788000 +0200
156 @@ -0,0 +1,244 @@
157 +#include "pass2.h"
158 +static int op0[] = { -1 };
159 +static int op1[] = { -1 };
160 +static int op2[] = { 193, 194, 195, 196, 197, 198, 199, 200, 201, 218, 220, -1 };
161 +static int op3[] = { -1 };
162 +static int op4[] = { 193, 194, 195, 196, 197, 198, 199, 200, 201, 218, 220, -1 };
163 +static int op5[] = { 193, 194, 195, 196, 197, 198, 199, 200, 201, 218, 220, -1 };
164 +static int op6[] = { 193, 194, 195, 196, 197, 198, 199, 200, 201, 218, 220, -1 };
165 +static int op7[] = { 193, 194, 195, 196, 197, 198, 199, 200, 201, 218, 220, -1 };
166 +static int op8[] = { 193, 194, 195, 196, 197, 198, 199, 200, 201, 218, 220, -1 };
167 +static int op9[] = { 219, 220, -1 };
168 +static int op10[] = { 70, 71, 72, 73, 74, 75, 76, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 220, -1 };
169 +static int op11[] = { 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 220, -1 };
170 +static int op12[] = { 146, 147, 148, 149, 150, 151, 152, 153, 220, -1 };
171 +static int op13[] = { 154, 155, 156, 157, 158, 159, 220, -1 };
172 +static int op14[] = { 160, 161, 162, 163, 164, 165, 220, -1 };
173 +static int op15[] = { 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 182, 183, 184, 185, 186, 187, 188, 189, 190, 220, -1 };
174 +static int op16[] = { 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 220, -1 };
175 +static int op17[] = { 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 220, -1 };
176 +static int op18[] = { 95, 96, 97, 98, 99, 100, 101, 102, 220, -1 };
177 +static int op19[] = { 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 220, -1 };
178 +static int op20[] = { 208, 209, 210, 211, 219, 220, -1 };
179 +static int op21[] = { -1 };
180 +static int op22[] = { -1 };
181 +static int op23[] = { 166, 167, 168, 169, 170, 171, 214, 219, 220, -1 };
182 +static int op24[] = { 202, 203, 204, 205, 206, 207, 219, 220, -1 };
183 +static int op25[] = { 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 220, -1 };
184 +static int op26[] = { 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 220, -1 };
185 +static int op27[] = { 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 220, -1 };
186 +static int op28[] = { 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 220, -1 };
187 +static int op29[] = { 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 220, -1 };
188 +static int op30[] = { 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 220, -1 };
189 +static int op31[] = { 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 220, -1 };
190 +static int op32[] = { 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 220, -1 };
191 +static int op33[] = { 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 220, -1 };
192 +static int op34[] = { 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 220, -1 };
193 +static int op35[] = { 220, -1 };
194 +static int op36[] = { 217, 219, 220, -1 };
195 +static int op37[] = { 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, 219, 220, -1 };
196 +static int op38[] = { 1, 2, 219, 220, -1 };
197 +static int op39[] = { 220, -1 };
198 +static int op40[] = { 220, -1 };
199 +static int op41[] = { 48, 50, 52, 54, 56, 58, 60, 62, 220, -1 };
200 +static int op42[] = { 49, 51, 53, 55, 57, 59, 61, 63, 219, 220, -1 };
201 +static int op43[] = { 220, -1 };
202 +static int op44[] = { 219, 220, -1 };
203 +static int op45[] = { 67, 68, 69, 220, -1 };
204 +static int op46[] = { 64, 65, 66, 219, 220, -1 };
205 +static int op47[] = { 218, 220, -1 };
206 +static int op48[] = { 220, -1 };
207 +static int op49[] = { 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 215, -1 };
208 +static int op50[] = { 145, 216, -1 };
209 +static int op51[] = { 212, 219, 220, -1 };
210 +static int op52[] = { 219, 220, -1 };
211 +static int op53[] = { 220, -1 };
212 +static int op54[] = { 191, 192, 219, 220, -1 };
213 +static int op55[] = { -1 };
214 +static int op56[] = { 220, -1 };
215 +static int op57[] = { 219, 220, -1 };
216 +static int op58[] = { 213, 219, 220, -1 };
218 +int *qtable[] = {
219 + op0,
220 + op1,
221 + op2,
222 + op3,
223 + op4,
224 + op5,
225 + op6,
226 + op7,
227 + op8,
228 + op9,
229 + op10,
230 + op11,
231 + op12,
232 + op13,
233 + op14,
234 + op15,
235 + op16,
236 + op17,
237 + op18,
238 + op19,
239 + op20,
240 + op21,
241 + op22,
242 + op23,
243 + op24,
244 + op25,
245 + op26,
246 + op27,
247 + op28,
248 + op29,
249 + op30,
250 + op31,
251 + op32,
252 + op33,
253 + op34,
254 + op35,
255 + op36,
256 + op37,
257 + op38,
258 + op39,
259 + op40,
260 + op41,
261 + op42,
262 + op43,
263 + op44,
264 + op45,
265 + op46,
266 + op47,
267 + op48,
268 + op49,
269 + op50,
270 + op51,
271 + op52,
272 + op53,
273 + op54,
274 + op55,
275 + op56,
276 + op57,
277 + op58,
279 +int tempregs[] = { 0, 1, 2, 4, 5, 8, 9, 10, 11, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, -1 };
280 +int permregs[] = { 3, 12, 13, 14, 15, -1 };
281 +bittype validregs[] = {
282 + 0xffffffff3f,
284 +static int amap[MAXREGS][NUMCLASS] = {
285 + /* 0 */{ 0x1,0x0,0x0 },
286 + /* 1 */{ 0x2,0x0,0x0 },
287 + /* 2 */{ 0x4,0x0,0x0 },
288 + /* 3 */{ 0x8,0x0,0x0 },
289 + /* 4 */{ 0x10,0x0,0x0 },
290 + /* 5 */{ 0x20,0x0,0x0 },
291 + /* 6 */{ 0x0,0x0,0x0 },
292 + /* 7 */{ 0x0,0x0,0x0 },
293 + /* 8 */{ 0x40,0x0,0x0 },
294 + /* 9 */{ 0x80,0x0,0x0 },
295 + /* 10 */{ 0x100,0x0,0x0 },
296 + /* 11 */{ 0x200,0x0,0x0 },
297 + /* 12 */{ 0x400,0x0,0x0 },
298 + /* 13 */{ 0x800,0x0,0x0 },
299 + /* 14 */{ 0x1000,0x0,0x0 },
300 + /* 15 */{ 0x2000,0x0,0x0 },
301 + /* 16 */{ 0x0,0x1,0x0 },
302 + /* 17 */{ 0x0,0x2,0x0 },
303 + /* 18 */{ 0x0,0x4,0x0 },
304 + /* 19 */{ 0x0,0x8,0x0 },
305 + /* 20 */{ 0x0,0x10,0x0 },
306 + /* 21 */{ 0x0,0x20,0x0 },
307 + /* 22 */{ 0x0,0x40,0x0 },
308 + /* 23 */{ 0x0,0x80,0x0 },
309 + /* 24 */{ 0x0,0x100,0x0 },
310 + /* 25 */{ 0x0,0x200,0x0 },
311 + /* 26 */{ 0x0,0x400,0x0 },
312 + /* 27 */{ 0x0,0x800,0x0 },
313 + /* 28 */{ 0x0,0x1000,0x0 },
314 + /* 29 */{ 0x0,0x2000,0x0 },
315 + /* 30 */{ 0x0,0x4000,0x0 },
316 + /* 31 */{ 0x0,0x8000,0x0 },
317 + /* 32 */{ 0x0,0x0,0x1 },
318 + /* 33 */{ 0x0,0x0,0x2 },
319 + /* 34 */{ 0x0,0x0,0x4 },
320 + /* 35 */{ 0x0,0x0,0x8 },
321 + /* 36 */{ 0x0,0x0,0x10 },
322 + /* 37 */{ 0x0,0x0,0x20 },
323 + /* 38 */{ 0x0,0x0,0x40 },
324 + /* 39 */{ 0x0,0x0,0x80 },
326 +int
327 +aliasmap(int class, int regnum)
329 + return amap[regnum][class-1];
331 +static int rmap[NUMCLASS][16] = {
332 + { 0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, },
333 + { 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, },
334 + { 32, 33, 34, 35, 36, 37, 38, 39, },
337 +int
338 +color2reg(int color, int class)
340 + return rmap[class-1][color];
342 +int regK[] = { 0, 14, 16, 8, 0, 0, 0, 0 };
343 +int
344 +classmask(int class)
346 + if(class == CLASSA) return 0x3fff;
347 + if(class == CLASSB) return 0xffff;
348 + if(class == CLASSC) return 0xff;
349 + if(class == CLASSD) return 0x0;
350 + if(class == CLASSE) return 0x0;
351 + if(class == CLASSF) return 0x0;
352 + return 0x0;
354 +static bittype ovlarr[MAXREGS][1] = {
355 +{ 0x1, },
356 +{ 0x2, },
357 +{ 0x4, },
358 +{ 0x8, },
359 +{ 0x10, },
360 +{ 0x20, },
361 +{ 0x40, },
362 +{ 0x80, },
363 +{ 0x100, },
364 +{ 0x200, },
365 +{ 0x400, },
366 +{ 0x800, },
367 +{ 0x1000, },
368 +{ 0x2000, },
369 +{ 0x4000, },
370 +{ 0x8000, },
371 +{ 0x10000, },
372 +{ 0x20000, },
373 +{ 0x40000, },
374 +{ 0x80000, },
375 +{ 0x100000, },
376 +{ 0x200000, },
377 +{ 0x400000, },
378 +{ 0x800000, },
379 +{ 0x1000000, },
380 +{ 0x2000000, },
381 +{ 0x4000000, },
382 +{ 0x8000000, },
383 +{ 0x10000000, },
384 +{ 0x20000000, },
385 +{ 0x40000000, },
386 +{ 0x80000000, },
387 +{ 0x1, },
388 +{ 0x2, },
389 +{ 0x4, },
390 +{ 0x8, },
391 +{ 0x10, },
392 +{ 0x20, },
393 +{ 0x40, },
394 +{ 0x80, },
396 +int
397 +interferes(int reg1, int reg2)
399 +return (TESTBIT(ovlarr[reg1], reg2)) != 0;
401 diff -ur --unidirectional-new-file pcc-1.0.0/cc/ccom/arch/amd64/external.h pcc/cc/ccom/arch/amd64/external.h
402 --- pcc-1.0.0/cc/ccom/arch/amd64/external.h 1970-01-01 01:00:00.000000000 +0100
403 +++ pcc/cc/ccom/arch/amd64/external.h 2013-09-11 19:46:33.156788000 +0200
404 @@ -0,0 +1,35 @@
405 +#ifndef _EXTERNAL_H_
406 +#define _EXTERNAL_H_
407 +#define NEED_SMULLL
408 +#define NEED_SDIVLL
409 +#define NEED_SMODLL
410 +#define NEED_SPLUSLL
411 +#define NEED_SMINUSLL
412 +#define NEED_UMULLL
413 +#define NEED_UDIVLL
414 +#define NEED_UMODLL
415 +#define NEED_UPLUSLL
416 +#define NEED_UMINUSLL
417 +#define MAXOPLEN 48
418 +#define NUMBITS 64
419 +#define BIT2BYTE(bits) ((((bits)+NUMBITS-1)/NUMBITS)*(NUMBITS/8))
420 +#define BITSET(arr, bit) (arr[bit/NUMBITS] |= ((long)1 << (bit & (NUMBITS-1))))
421 +#define BITCLEAR(arr, bit) (arr[bit/NUMBITS] &= ~((long)1 << (bit & (NUMBITS-1))))
422 +#define TESTBIT(arr, bit) (arr[bit/NUMBITS] & ((long)1 << (bit & (NUMBITS-1))))
423 +typedef long bittype;
424 +extern int tempregs[], permregs[];
425 +#define NTEMPREG 26
426 +#define FREGS 25
427 +#define NPERMREG 6
428 +extern bittype validregs[];
429 +#define AREGCNT 14
430 +#define BREGCNT 16
431 +#define CREGCNT 8
432 +#define DREGCNT 0
433 +#define EREGCNT 0
434 +#define FREGCNT 0
435 +#define GREGCNT 0
436 +int aliasmap(int class, int regnum);
437 +int color2reg(int color, int class);
438 +int interferes(int reg1, int reg2);
439 +#endif /* _EXTERNAL_H_ */
440 diff -ur --unidirectional-new-file pcc-1.0.0/cc/ccom/arch/arm32/external.c pcc/cc/ccom/arch/arm32/external.c
441 --- pcc-1.0.0/cc/ccom/arch/arm32/external.c 1970-01-01 01:00:00.000000000 +0100
442 +++ pcc/cc/ccom/arch/arm32/external.c 2013-09-11 19:46:33.156788000 +0200
443 @@ -0,0 +1,246 @@
444 +#include "pass2.h"
446 +// TODO: replace with file generated by ccom_mkext
448 +static int op0[] = { -1 };
449 +static int op1[] = { -1 };
450 +static int op2[] = { -1 };
451 +static int op3[] = { -1 };
452 +static int op4[] = { -1 };
453 +static int op5[] = { -1 };
454 +static int op6[] = { -1 };
455 +static int op7[] = { -1 };
456 +static int op8[] = { -1 };
457 +static int op9[] = { -1 };
458 +static int op10[] = { -1 };
459 +static int op11[] = { -1 };
460 +static int op12[] = { -1 };
461 +static int op13[] = { -1 };
462 +static int op14[] = { -1 };
463 +static int op15[] = { -1 };
464 +static int op16[] = { -1 };
465 +static int op17[] = { -1 };
466 +static int op18[] = { -1 };
467 +static int op19[] = { -1 };
468 +static int op20[] = { -1 };
469 +static int op21[] = { -1 };
470 +static int op22[] = { -1 };
471 +static int op23[] = { -1 };
472 +static int op24[] = { -1 };
473 +static int op25[] = { -1 };
474 +static int op26[] = { -1 };
475 +static int op27[] = { -1 };
476 +static int op28[] = { -1 };
477 +static int op29[] = { -1 };
478 +static int op30[] = { -1 };
479 +static int op31[] = { -1 };
480 +static int op32[] = { -1 };
481 +static int op33[] = { -1 };
482 +static int op34[] = { -1 };
483 +static int op35[] = { -1 };
484 +static int op36[] = { -1 };
485 +static int op37[] = { -1 };
486 +static int op38[] = { -1 };
487 +static int op39[] = { -1 };
488 +static int op40[] = { -1 };
489 +static int op41[] = { -1 };
490 +static int op42[] = { -1 };
491 +static int op43[] = { -1 };
492 +static int op44[] = { -1 };
493 +static int op45[] = { -1 };
494 +static int op46[] = { -1 };
495 +static int op47[] = { -1 };
496 +static int op48[] = { -1 };
497 +static int op49[] = { -1 };
498 +static int op50[] = { -1 };
499 +static int op51[] = { -1 };
500 +static int op52[] = { -1 };
501 +static int op53[] = { -1 };
502 +static int op54[] = { -1 };
503 +static int op55[] = { -1 };
504 +static int op56[] = { -1 };
505 +static int op57[] = { -1 };
506 +static int op58[] = { -1 };
508 +int *qtable[] = {
509 + op0,
510 + op1,
511 + op2,
512 + op3,
513 + op4,
514 + op5,
515 + op6,
516 + op7,
517 + op8,
518 + op9,
519 + op10,
520 + op11,
521 + op12,
522 + op13,
523 + op14,
524 + op15,
525 + op16,
526 + op17,
527 + op18,
528 + op19,
529 + op20,
530 + op21,
531 + op22,
532 + op23,
533 + op24,
534 + op25,
535 + op26,
536 + op27,
537 + op28,
538 + op29,
539 + op30,
540 + op31,
541 + op32,
542 + op33,
543 + op34,
544 + op35,
545 + op36,
546 + op37,
547 + op38,
548 + op39,
549 + op40,
550 + op41,
551 + op42,
552 + op43,
553 + op44,
554 + op45,
555 + op46,
556 + op47,
557 + op48,
558 + op49,
559 + op50,
560 + op51,
561 + op52,
562 + op53,
563 + op54,
564 + op55,
565 + op56,
566 + op57,
567 + op58,
569 +int tempregs[] = { -1 };
570 +int permregs[] = { -1 };
571 +bittype validregs[] = {
572 + 0x7fffffffff,
574 +static int amap[MAXREGS][NUMCLASS] = {
575 + /* 0 */{ 0x0,0x0,0x0,0x0 },
576 + /* 1 */{ 0x0,0x0,0x0,0x0 },
577 + /* 2 */{ 0x0,0x0,0x0,0x0 },
578 + /* 3 */{ 0x0,0x0,0x0,0x0 },
579 + /* 4 */{ 0x0,0x0,0x0,0x0 },
580 + /* 5 */{ 0x0,0x0,0x0,0x0 },
581 + /* 6 */{ 0x0,0x0,0x0,0x0 },
582 + /* 7 */{ 0x0,0x0,0x0,0x0 },
583 + /* 8 */{ 0x0,0x0,0x0,0x0 },
584 + /* 9 */{ 0x0,0x0,0x0,0x0 },
585 + /* 10 */{ 0x0,0x0,0x0,0x0 },
586 + /* 11 */{ 0x0,0x0,0x0,0x0 },
587 + /* 12 */{ 0x0,0x0,0x0,0x0 },
588 + /* 13 */{ 0x0,0x0,0x0,0x0 },
589 + /* 14 */{ 0x0,0x0,0x0,0x0 },
590 + /* 15 */{ 0x0,0x0,0x0,0x0 },
591 + /* 16 */{ 0x0,0x0,0x0,0x0 },
592 + /* 17 */{ 0x0,0x0,0x0,0x0 },
593 + /* 18 */{ 0x0,0x0,0x0,0x0 },
594 + /* 19 */{ 0x0,0x0,0x0,0x0 },
595 + /* 20 */{ 0x0,0x0,0x0,0x0 },
596 + /* 21 */{ 0x0,0x0,0x0,0x0 },
597 + /* 22 */{ 0x0,0x0,0x0,0x0 },
598 + /* 23 */{ 0x0,0x0,0x0,0x0 },
599 + /* 24 */{ 0x0,0x0,0x0,0x0 },
600 + /* 25 */{ 0x0,0x0,0x0,0x0 },
601 + /* 26 */{ 0x0,0x0,0x0,0x0 },
602 + /* 27 */{ 0x0,0x0,0x0,0x0 },
603 + /* 28 */{ 0x0,0x0,0x0,0x0 },
604 + /* 29 */{ 0x0,0x0,0x0,0x0 },
605 + /* 30 */{ 0x0,0x0,0x0,0x0 },
606 + /* 31 */{ 0x0,0x0,0x0,0x0 },
607 + /* 32 */{ 0x0,0x0,0x0,0x0 },
608 + /* 33 */{ 0x0,0x0,0x0,0x0 },
609 + /* 34 */{ 0x0,0x0,0x0,0x0 },
610 + /* 35 */{ 0x0,0x0,0x0,0x0 },
611 + /* 36 */{ 0x0,0x0,0x0,0x0 },
612 + /* 37 */{ 0x0,0x0,0x0,0x0 },
613 + /* 38 */{ 0x0,0x0,0x0,0x0 }
615 +int
616 +aliasmap(int class, int regnum)
618 + return amap[regnum][class-1];
620 +static int rmap[NUMCLASS][15] = {
621 + { 0, 1, 2, 3, 4, 5, },
622 + { 8, 9, 10, 11, 12, 13, 14, 15, },
623 + { 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, },
624 + { 31, 32, 33, 34, 35, 36, 37, 38, },
627 +int
628 +color2reg(int color, int class)
630 + return rmap[class-1][color];
632 +int regK[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
633 +int
634 +classmask(int class)
636 + if(class == CLASSA) return 0x0;
637 + if(class == CLASSB) return 0x0;
638 + if(class == CLASSC) return 0x0;
639 + if(class == CLASSD) return 0x0;
640 + if(class == CLASSE) return 0x0;
641 + if(class == CLASSF) return 0x0;
642 + return 0x0;
644 +static bittype ovlarr[MAXREGS][1] = {
645 +{ 0x1f0301, },
646 +{ 0x1e10c02, },
647 +{ 0xe223004, },
648 +{ 0x3244c008, },
649 +{ 0x54880010, },
650 +{ 0x69100020, },
651 +{ 0x40, },
652 +{ 0x80, },
653 +{ 0x1f0101, },
654 +{ 0x1f0201, },
655 +{ 0x1e10402, },
656 +{ 0x1e10802, },
657 +{ 0xe221004, },
658 +{ 0xe222004, },
659 +{ 0x32444008, },
660 +{ 0x32448008, },
661 +{ 0x1ff0f03, },
662 +{ 0xe3f3305, },
663 +{ 0x325fc309, },
664 +{ 0x549f0311, },
665 +{ 0x691f0321, },
666 +{ 0xfe33c06, },
667 +{ 0x33e5cc0a, },
668 +{ 0x55e90c12, },
669 +{ 0x69f10c22, },
670 +{ 0x3e66f00c, },
671 +{ 0x5eaa3014, },
672 +{ 0x6f323024, },
673 +{ 0x76ccc018, },
674 +{ 0x7b54c028, },
675 +{ 0x7d980030, },
676 +{ 0x80000000, },
677 +{ 0x1, },
678 +{ 0x2, },
679 +{ 0x4, },
680 +{ 0x8, },
681 +{ 0x10, },
682 +{ 0x20, },
683 +{ 0x40, },
685 +int
686 +interferes(int reg1, int reg2)
688 +return (TESTBIT(ovlarr[reg1], reg2)) != 0;
690 diff -ur --unidirectional-new-file pcc-1.0.0/cc/ccom/arch/arm32/external.h pcc/cc/ccom/arch/arm32/external.h
691 --- pcc-1.0.0/cc/ccom/arch/arm32/external.h 1970-01-01 01:00:00.000000000 +0100
692 +++ pcc/cc/ccom/arch/arm32/external.h 2013-09-11 19:46:33.156788000 +0200
693 @@ -0,0 +1,27 @@
694 +// TODO: replace with file generated by ccom_mkext
696 +#ifndef _EXTERNAL_H_
697 +#define _EXTERNAL_H_
698 +#define MAXOPLEN 0
699 +#define NUMBITS 32
700 +#define BIT2BYTE(bits) ((((bits)+NUMBITS-1)/NUMBITS)*(NUMBITS/8))
701 +#define BITSET(arr, bit) (arr[bit/NUMBITS] |= ((int)1 << (bit & (NUMBITS-1))))
702 +#define BITCLEAR(arr, bit) (arr[bit/NUMBITS] &= ~((int)1 << (bit & (NUMBITS-1))))
703 +#define TESTBIT(arr, bit) (arr[bit/NUMBITS] & ((int)1 << (bit & (NUMBITS-1))))
704 +typedef int bittype;
705 +extern int tempregs[], permregs[];
706 +#define NTEMPREG 0
707 +#define FREGS 0
708 +#define NPERMREG 0
709 +extern bittype validregs[];
710 +#define AREGCNT 0
711 +#define BREGCNT 0
712 +#define CREGCNT 0
713 +#define DREGCNT 0
714 +#define EREGCNT 0
715 +#define FREGCNT 0
716 +#define GREGCNT 0
717 +int aliasmap(int class, int regnum);
718 +int color2reg(int color, int class);
719 +int interferes(int reg1, int reg2);
720 +#endif /* _EXTERNAL_H_ */
721 diff -ur --unidirectional-new-file pcc-1.0.0/cc/ccom/arch/ia32/external.c pcc/cc/ccom/arch/ia32/external.c
722 --- pcc-1.0.0/cc/ccom/arch/ia32/external.c 1970-01-01 01:00:00.000000000 +0100
723 +++ pcc/cc/ccom/arch/ia32/external.c 2013-09-11 19:46:33.156788000 +0200
724 @@ -0,0 +1,244 @@
725 +#include "pass2.h"
726 +static int op0[] = { -1 };
727 +static int op1[] = { -1 };
728 +static int op2[] = { 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 232, 234, -1 };
729 +static int op3[] = { -1 };
730 +static int op4[] = { 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 232, 234, -1 };
731 +static int op5[] = { 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 232, 234, -1 };
732 +static int op6[] = { 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 232, 234, -1 };
733 +static int op7[] = { 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 232, 234, -1 };
734 +static int op8[] = { 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 232, 234, -1 };
735 +static int op9[] = { 233, 234, -1 };
736 +static int op10[] = { 68, 69, 70, 71, 72, 73, 74, 75, 76, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 234, -1 };
737 +static int op11[] = { 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96, 234, -1 };
738 +static int op12[] = { 151, 152, 153, 154, 155, 156, 157, 234, -1 };
739 +static int op13[] = { 158, 159, 160, 161, 162, 234, -1 };
740 +static int op14[] = { 163, 164, 165, 166, 167, 168, 234, -1 };
741 +static int op15[] = { 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 183, 184, 185, 186, 187, 188, 189, 234, -1 };
742 +static int op16[] = { 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 234, -1 };
743 +static int op17[] = { 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 234, -1 };
744 +static int op18[] = { 97, 98, 99, 100, 101, 102, 103, 234, -1 };
745 +static int op19[] = { 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 234, -1 };
746 +static int op20[] = { 211, 212, 213, 214, 233, 234, -1 };
747 +static int op21[] = { -1 };
748 +static int op22[] = { -1 };
749 +static int op23[] = { 169, 170, 171, 172, 173, 174, 175, 228, 233, 234, -1 };
750 +static int op24[] = { 206, 207, 208, 209, 210, 233, 234, -1 };
751 +static int op25[] = { 176, 177, 178, 179, 180, 181, 182, 234, -1 };
752 +static int op26[] = { 176, 177, 178, 179, 180, 181, 182, 234, -1 };
753 +static int op27[] = { 176, 177, 178, 179, 180, 181, 182, 234, -1 };
754 +static int op28[] = { 176, 177, 178, 179, 180, 181, 182, 234, -1 };
755 +static int op29[] = { 176, 177, 178, 179, 180, 181, 182, 234, -1 };
756 +static int op30[] = { 176, 177, 178, 179, 180, 181, 182, 234, -1 };
757 +static int op31[] = { 176, 177, 178, 179, 180, 181, 182, 234, -1 };
758 +static int op32[] = { 176, 177, 178, 179, 180, 181, 182, 234, -1 };
759 +static int op33[] = { 176, 177, 178, 179, 180, 181, 182, 234, -1 };
760 +static int op34[] = { 176, 177, 178, 179, 180, 181, 182, 234, -1 };
761 +static int op35[] = { 234, -1 };
762 +static int op36[] = { 231, 233, 234, -1 };
763 +static int op37[] = { 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, 233, 234, -1 };
764 +static int op38[] = { 1, 233, 234, -1 };
765 +static int op39[] = { 234, -1 };
766 +static int op40[] = { 234, -1 };
767 +static int op41[] = { 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 234, -1 };
768 +static int op42[] = { 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 233, 234, -1 };
769 +static int op43[] = { 234, -1 };
770 +static int op44[] = { 233, 234, -1 };
771 +static int op45[] = { 65, 66, 67, 234, -1 };
772 +static int op46[] = { 62, 63, 64, 233, 234, -1 };
773 +static int op47[] = { 232, 234, -1 };
774 +static int op48[] = { 234, -1 };
775 +static int op49[] = { 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 229, -1 };
776 +static int op50[] = { 150, 230, -1 };
777 +static int op51[] = { 227, 233, 234, -1 };
778 +static int op52[] = { 233, 234, -1 };
779 +static int op53[] = { 234, -1 };
780 +static int op54[] = { 190, 191, 233, 234, -1 };
781 +static int op55[] = { -1 };
782 +static int op56[] = { 234, -1 };
783 +static int op57[] = { 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 233, 234, -1 };
784 +static int op58[] = { 233, 234, -1 };
786 +int *qtable[] = {
787 + op0,
788 + op1,
789 + op2,
790 + op3,
791 + op4,
792 + op5,
793 + op6,
794 + op7,
795 + op8,
796 + op9,
797 + op10,
798 + op11,
799 + op12,
800 + op13,
801 + op14,
802 + op15,
803 + op16,
804 + op17,
805 + op18,
806 + op19,
807 + op20,
808 + op21,
809 + op22,
810 + op23,
811 + op24,
812 + op25,
813 + op26,
814 + op27,
815 + op28,
816 + op29,
817 + op30,
818 + op31,
819 + op32,
820 + op33,
821 + op34,
822 + op35,
823 + op36,
824 + op37,
825 + op38,
826 + op39,
827 + op40,
828 + op41,
829 + op42,
830 + op43,
831 + op44,
832 + op45,
833 + op46,
834 + op47,
835 + op48,
836 + op49,
837 + op50,
838 + op51,
839 + op52,
840 + op53,
841 + op54,
842 + op55,
843 + op56,
844 + op57,
845 + op58,
847 +int tempregs[] = { 0, 1, 2, -1 };
848 +int permregs[] = { 3, 4, 5, -1 };
849 +bittype validregs[] = {
850 + 0xffffff3f,
851 + 0x0000007f,
853 +static int amap[MAXREGS][NUMCLASS] = {
854 + /* 0 */{ 0x1,0x3,0x1f,0x0 },
855 + /* 1 */{ 0x2,0xc,0x1e1,0x0 },
856 + /* 2 */{ 0x4,0x30,0xe22,0x0 },
857 + /* 3 */{ 0x8,0xc0,0x3244,0x0 },
858 + /* 4 */{ 0x10,0x0,0x5488,0x0 },
859 + /* 5 */{ 0x20,0x0,0x6910,0x0 },
860 + /* 6 */{ 0x0,0x0,0x0,0x0 },
861 + /* 7 */{ 0x0,0x0,0x0,0x0 },
862 + /* 8 */{ 0x1,0x1,0x1f,0x0 },
863 + /* 9 */{ 0x1,0x2,0x1f,0x0 },
864 + /* 10 */{ 0x2,0x4,0x1e1,0x0 },
865 + /* 11 */{ 0x2,0x8,0x1e1,0x0 },
866 + /* 12 */{ 0x4,0x10,0xe22,0x0 },
867 + /* 13 */{ 0x4,0x20,0xe22,0x0 },
868 + /* 14 */{ 0x8,0x40,0x3244,0x0 },
869 + /* 15 */{ 0x8,0x80,0x3244,0x0 },
870 + /* 16 */{ 0x3,0xf,0x1ff,0x0 },
871 + /* 17 */{ 0x5,0x33,0xe3f,0x0 },
872 + /* 18 */{ 0x9,0xc3,0x325f,0x0 },
873 + /* 19 */{ 0x11,0x3,0x549f,0x0 },
874 + /* 20 */{ 0x21,0x3,0x691f,0x0 },
875 + /* 21 */{ 0x6,0x3c,0xfe3,0x0 },
876 + /* 22 */{ 0xa,0xcc,0x33e5,0x0 },
877 + /* 23 */{ 0x12,0xc,0x55e9,0x0 },
878 + /* 24 */{ 0x22,0xc,0x69f1,0x0 },
879 + /* 25 */{ 0xc,0xf0,0x3e66,0x0 },
880 + /* 26 */{ 0x14,0x30,0x5eaa,0x0 },
881 + /* 27 */{ 0x24,0x30,0x6f32,0x0 },
882 + /* 28 */{ 0x18,0xc0,0x76cc,0x0 },
883 + /* 29 */{ 0x28,0xc0,0x7b54,0x0 },
884 + /* 30 */{ 0x30,0x0,0x7d98,0x0 },
885 + /* 31 */{ 0x0,0x0,0x0,0x1 },
886 + /* 32 */{ 0x0,0x0,0x0,0x2 },
887 + /* 33 */{ 0x0,0x0,0x0,0x4 },
888 + /* 34 */{ 0x0,0x0,0x0,0x8 },
889 + /* 35 */{ 0x0,0x0,0x0,0x10 },
890 + /* 36 */{ 0x0,0x0,0x0,0x20 },
891 + /* 37 */{ 0x0,0x0,0x0,0x40 },
892 + /* 38 */{ 0x0,0x0,0x0,0x80 },
894 +int
895 +aliasmap(int class, int regnum)
897 + return amap[regnum][class-1];
899 +static int rmap[NUMCLASS][15] = {
900 + { 0, 1, 2, 3, 4, 5, },
901 + { 8, 9, 10, 11, 12, 13, 14, 15, },
902 + { 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, },
903 + { 31, 32, 33, 34, 35, 36, 37, 38, },
906 +int
907 +color2reg(int color, int class)
909 + return rmap[class-1][color];
911 +int regK[] = { 0, 6, 8, 15, 8, 0, 0, 0 };
912 +int
913 +classmask(int class)
915 + if(class == CLASSA) return 0x3f;
916 + if(class == CLASSB) return 0xff;
917 + if(class == CLASSC) return 0x7fff;
918 + if(class == CLASSD) return 0xff;
919 + if(class == CLASSE) return 0x0;
920 + if(class == CLASSF) return 0x0;
921 + return 0x0;
923 +static bittype ovlarr[MAXREGS][2] = {
924 +{ 0x1f0301, 0x0, },
925 +{ 0x1e10c02, 0x0, },
926 +{ 0xe223004, 0x0, },
927 +{ 0x3244c008, 0x0, },
928 +{ 0x54880010, 0x0, },
929 +{ 0x69100020, 0x0, },
930 +{ 0x40, 0x0, },
931 +{ 0x80, 0x0, },
932 +{ 0x1f0101, 0x0, },
933 +{ 0x1f0201, 0x0, },
934 +{ 0x1e10402, 0x0, },
935 +{ 0x1e10802, 0x0, },
936 +{ 0xe221004, 0x0, },
937 +{ 0xe222004, 0x0, },
938 +{ 0x32444008, 0x0, },
939 +{ 0x32448008, 0x0, },
940 +{ 0x1ff0f03, 0x0, },
941 +{ 0xe3f3305, 0x0, },
942 +{ 0x325fc309, 0x0, },
943 +{ 0x549f0311, 0x0, },
944 +{ 0x691f0321, 0x0, },
945 +{ 0xfe33c06, 0x0, },
946 +{ 0x33e5cc0a, 0x0, },
947 +{ 0x55e90c12, 0x0, },
948 +{ 0x69f10c22, 0x0, },
949 +{ 0x3e66f00c, 0x0, },
950 +{ 0x5eaa3014, 0x0, },
951 +{ 0x6f323024, 0x0, },
952 +{ 0x76ccc018, 0x0, },
953 +{ 0x7b54c028, 0x0, },
954 +{ 0x7d980030, 0x0, },
955 +{ 0x80000000, 0x0, },
956 +{ 0x0, 0x1, },
957 +{ 0x0, 0x2, },
958 +{ 0x0, 0x4, },
959 +{ 0x0, 0x8, },
960 +{ 0x0, 0x10, },
961 +{ 0x0, 0x20, },
962 +{ 0x0, 0x40, },
964 +int
965 +interferes(int reg1, int reg2)
967 +return (TESTBIT(ovlarr[reg1], reg2)) != 0;
969 diff -ur --unidirectional-new-file pcc-1.0.0/cc/ccom/arch/ia32/external.h pcc/cc/ccom/arch/ia32/external.h
970 --- pcc-1.0.0/cc/ccom/arch/ia32/external.h 1970-01-01 01:00:00.000000000 +0100
971 +++ pcc/cc/ccom/arch/ia32/external.h 2013-09-11 19:46:33.156788000 +0200
972 @@ -0,0 +1,25 @@
973 +#ifndef _EXTERNAL_H_
974 +#define _EXTERNAL_H_
975 +#define MAXOPLEN 42
976 +#define NUMBITS 32
977 +#define BIT2BYTE(bits) ((((bits)+NUMBITS-1)/NUMBITS)*(NUMBITS/8))
978 +#define BITSET(arr, bit) (arr[bit/NUMBITS] |= ((int)1 << (bit & (NUMBITS-1))))
979 +#define BITCLEAR(arr, bit) (arr[bit/NUMBITS] &= ~((int)1 << (bit & (NUMBITS-1))))
980 +#define TESTBIT(arr, bit) (arr[bit/NUMBITS] & ((int)1 << (bit & (NUMBITS-1))))
981 +typedef int bittype;
982 +extern int tempregs[], permregs[];
983 +#define NTEMPREG 4
984 +#define FREGS 3
985 +#define NPERMREG 4
986 +extern bittype validregs[];
987 +#define AREGCNT 6
988 +#define BREGCNT 8
989 +#define CREGCNT 15
990 +#define DREGCNT 8
991 +#define EREGCNT 0
992 +#define FREGCNT 0
993 +#define GREGCNT 0
994 +int aliasmap(int class, int regnum);
995 +int color2reg(int color, int class);
996 +int interferes(int reg1, int reg2);
997 +#endif /* _EXTERNAL_H_ */
998 diff -ur --unidirectional-new-file pcc-1.0.0/cc/ccom/arch/mips32/external.c pcc/cc/ccom/arch/mips32/external.c
999 --- pcc-1.0.0/cc/ccom/arch/mips32/external.c 1970-01-01 01:00:00.000000000 +0100
1000 +++ pcc/cc/ccom/arch/mips32/external.c 2013-09-11 19:46:33.156788000 +0200
1001 @@ -0,0 +1,246 @@
1002 +#include "pass2.h"
1004 +// TODO: replace with file generated by ccom_mkext
1006 +static int op0[] = { -1 };
1007 +static int op1[] = { -1 };
1008 +static int op2[] = { -1 };
1009 +static int op3[] = { -1 };
1010 +static int op4[] = { -1 };
1011 +static int op5[] = { -1 };
1012 +static int op6[] = { -1 };
1013 +static int op7[] = { -1 };
1014 +static int op8[] = { -1 };
1015 +static int op9[] = { -1 };
1016 +static int op10[] = { -1 };
1017 +static int op11[] = { -1 };
1018 +static int op12[] = { -1 };
1019 +static int op13[] = { -1 };
1020 +static int op14[] = { -1 };
1021 +static int op15[] = { -1 };
1022 +static int op16[] = { -1 };
1023 +static int op17[] = { -1 };
1024 +static int op18[] = { -1 };
1025 +static int op19[] = { -1 };
1026 +static int op20[] = { -1 };
1027 +static int op21[] = { -1 };
1028 +static int op22[] = { -1 };
1029 +static int op23[] = { -1 };
1030 +static int op24[] = { -1 };
1031 +static int op25[] = { -1 };
1032 +static int op26[] = { -1 };
1033 +static int op27[] = { -1 };
1034 +static int op28[] = { -1 };
1035 +static int op29[] = { -1 };
1036 +static int op30[] = { -1 };
1037 +static int op31[] = { -1 };
1038 +static int op32[] = { -1 };
1039 +static int op33[] = { -1 };
1040 +static int op34[] = { -1 };
1041 +static int op35[] = { -1 };
1042 +static int op36[] = { -1 };
1043 +static int op37[] = { -1 };
1044 +static int op38[] = { -1 };
1045 +static int op39[] = { -1 };
1046 +static int op40[] = { -1 };
1047 +static int op41[] = { -1 };
1048 +static int op42[] = { -1 };
1049 +static int op43[] = { -1 };
1050 +static int op44[] = { -1 };
1051 +static int op45[] = { -1 };
1052 +static int op46[] = { -1 };
1053 +static int op47[] = { -1 };
1054 +static int op48[] = { -1 };
1055 +static int op49[] = { -1 };
1056 +static int op50[] = { -1 };
1057 +static int op51[] = { -1 };
1058 +static int op52[] = { -1 };
1059 +static int op53[] = { -1 };
1060 +static int op54[] = { -1 };
1061 +static int op55[] = { -1 };
1062 +static int op56[] = { -1 };
1063 +static int op57[] = { -1 };
1064 +static int op58[] = { -1 };
1066 +int *qtable[] = {
1067 + op0,
1068 + op1,
1069 + op2,
1070 + op3,
1071 + op4,
1072 + op5,
1073 + op6,
1074 + op7,
1075 + op8,
1076 + op9,
1077 + op10,
1078 + op11,
1079 + op12,
1080 + op13,
1081 + op14,
1082 + op15,
1083 + op16,
1084 + op17,
1085 + op18,
1086 + op19,
1087 + op20,
1088 + op21,
1089 + op22,
1090 + op23,
1091 + op24,
1092 + op25,
1093 + op26,
1094 + op27,
1095 + op28,
1096 + op29,
1097 + op30,
1098 + op31,
1099 + op32,
1100 + op33,
1101 + op34,
1102 + op35,
1103 + op36,
1104 + op37,
1105 + op38,
1106 + op39,
1107 + op40,
1108 + op41,
1109 + op42,
1110 + op43,
1111 + op44,
1112 + op45,
1113 + op46,
1114 + op47,
1115 + op48,
1116 + op49,
1117 + op50,
1118 + op51,
1119 + op52,
1120 + op53,
1121 + op54,
1122 + op55,
1123 + op56,
1124 + op57,
1125 + op58,
1127 +int tempregs[] = { -1 };
1128 +int permregs[] = { -1 };
1129 +bittype validregs[] = {
1130 + 0x7fffffffff,
1132 +static int amap[MAXREGS][NUMCLASS] = {
1133 + /* 0 */{ 0x0,0x0,0x0,0x0 },
1134 + /* 1 */{ 0x0,0x0,0x0,0x0 },
1135 + /* 2 */{ 0x0,0x0,0x0,0x0 },
1136 + /* 3 */{ 0x0,0x0,0x0,0x0 },
1137 + /* 4 */{ 0x0,0x0,0x0,0x0 },
1138 + /* 5 */{ 0x0,0x0,0x0,0x0 },
1139 + /* 6 */{ 0x0,0x0,0x0,0x0 },
1140 + /* 7 */{ 0x0,0x0,0x0,0x0 },
1141 + /* 8 */{ 0x0,0x0,0x0,0x0 },
1142 + /* 9 */{ 0x0,0x0,0x0,0x0 },
1143 + /* 10 */{ 0x0,0x0,0x0,0x0 },
1144 + /* 11 */{ 0x0,0x0,0x0,0x0 },
1145 + /* 12 */{ 0x0,0x0,0x0,0x0 },
1146 + /* 13 */{ 0x0,0x0,0x0,0x0 },
1147 + /* 14 */{ 0x0,0x0,0x0,0x0 },
1148 + /* 15 */{ 0x0,0x0,0x0,0x0 },
1149 + /* 16 */{ 0x0,0x0,0x0,0x0 },
1150 + /* 17 */{ 0x0,0x0,0x0,0x0 },
1151 + /* 18 */{ 0x0,0x0,0x0,0x0 },
1152 + /* 19 */{ 0x0,0x0,0x0,0x0 },
1153 + /* 20 */{ 0x0,0x0,0x0,0x0 },
1154 + /* 21 */{ 0x0,0x0,0x0,0x0 },
1155 + /* 22 */{ 0x0,0x0,0x0,0x0 },
1156 + /* 23 */{ 0x0,0x0,0x0,0x0 },
1157 + /* 24 */{ 0x0,0x0,0x0,0x0 },
1158 + /* 25 */{ 0x0,0x0,0x0,0x0 },
1159 + /* 26 */{ 0x0,0x0,0x0,0x0 },
1160 + /* 27 */{ 0x0,0x0,0x0,0x0 },
1161 + /* 28 */{ 0x0,0x0,0x0,0x0 },
1162 + /* 29 */{ 0x0,0x0,0x0,0x0 },
1163 + /* 30 */{ 0x0,0x0,0x0,0x0 },
1164 + /* 31 */{ 0x0,0x0,0x0,0x0 },
1165 + /* 32 */{ 0x0,0x0,0x0,0x0 },
1166 + /* 33 */{ 0x0,0x0,0x0,0x0 },
1167 + /* 34 */{ 0x0,0x0,0x0,0x0 },
1168 + /* 35 */{ 0x0,0x0,0x0,0x0 },
1169 + /* 36 */{ 0x0,0x0,0x0,0x0 },
1170 + /* 37 */{ 0x0,0x0,0x0,0x0 },
1171 + /* 38 */{ 0x0,0x0,0x0,0x0 }
1173 +int
1174 +aliasmap(int class, int regnum)
1176 + return amap[regnum][class-1];
1178 +static int rmap[NUMCLASS][15] = {
1179 + { 0, 1, 2, 3, 4, 5, },
1180 + { 8, 9, 10, 11, 12, 13, 14, 15, },
1181 + { 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, },
1182 + { 31, 32, 33, 34, 35, 36, 37, 38, },
1185 +int
1186 +color2reg(int color, int class)
1188 + return rmap[class-1][color];
1190 +int regK[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
1191 +int
1192 +classmask(int class)
1194 + if(class == CLASSA) return 0x0;
1195 + if(class == CLASSB) return 0x0;
1196 + if(class == CLASSC) return 0x0;
1197 + if(class == CLASSD) return 0x0;
1198 + if(class == CLASSE) return 0x0;
1199 + if(class == CLASSF) return 0x0;
1200 + return 0x0;
1202 +static bittype ovlarr[MAXREGS][1] = {
1203 +{ 0x1f0301, },
1204 +{ 0x1e10c02, },
1205 +{ 0xe223004, },
1206 +{ 0x3244c008, },
1207 +{ 0x54880010, },
1208 +{ 0x69100020, },
1209 +{ 0x40, },
1210 +{ 0x80, },
1211 +{ 0x1f0101, },
1212 +{ 0x1f0201, },
1213 +{ 0x1e10402, },
1214 +{ 0x1e10802, },
1215 +{ 0xe221004, },
1216 +{ 0xe222004, },
1217 +{ 0x32444008, },
1218 +{ 0x32448008, },
1219 +{ 0x1ff0f03, },
1220 +{ 0xe3f3305, },
1221 +{ 0x325fc309, },
1222 +{ 0x549f0311, },
1223 +{ 0x691f0321, },
1224 +{ 0xfe33c06, },
1225 +{ 0x33e5cc0a, },
1226 +{ 0x55e90c12, },
1227 +{ 0x69f10c22, },
1228 +{ 0x3e66f00c, },
1229 +{ 0x5eaa3014, },
1230 +{ 0x6f323024, },
1231 +{ 0x76ccc018, },
1232 +{ 0x7b54c028, },
1233 +{ 0x7d980030, },
1234 +{ 0x80000000, },
1235 +{ 0x1, },
1236 +{ 0x2, },
1237 +{ 0x4, },
1238 +{ 0x8, },
1239 +{ 0x10, },
1240 +{ 0x20, },
1241 +{ 0x40, },
1243 +int
1244 +interferes(int reg1, int reg2)
1246 +return (TESTBIT(ovlarr[reg1], reg2)) != 0;
1248 diff -ur --unidirectional-new-file pcc-1.0.0/cc/ccom/arch/mips32/external.h pcc/cc/ccom/arch/mips32/external.h
1249 --- pcc-1.0.0/cc/ccom/arch/mips32/external.h 1970-01-01 01:00:00.000000000 +0100
1250 +++ pcc/cc/ccom/arch/mips32/external.h 2013-09-11 19:46:33.156788000 +0200
1251 @@ -0,0 +1,27 @@
1252 +// TODO: replace with file generated by ccom_mkext
1254 +#ifndef _EXTERNAL_H_
1255 +#define _EXTERNAL_H_
1256 +#define MAXOPLEN 0
1257 +#define NUMBITS 32
1258 +#define BIT2BYTE(bits) ((((bits)+NUMBITS-1)/NUMBITS)*(NUMBITS/8))
1259 +#define BITSET(arr, bit) (arr[bit/NUMBITS] |= ((int)1 << (bit & (NUMBITS-1))))
1260 +#define BITCLEAR(arr, bit) (arr[bit/NUMBITS] &= ~((int)1 << (bit & (NUMBITS-1))))
1261 +#define TESTBIT(arr, bit) (arr[bit/NUMBITS] & ((int)1 << (bit & (NUMBITS-1))))
1262 +typedef int bittype;
1263 +extern int tempregs[], permregs[];
1264 +#define NTEMPREG 0
1265 +#define FREGS 0
1266 +#define NPERMREG 0
1267 +extern bittype validregs[];
1268 +#define AREGCNT 0
1269 +#define BREGCNT 0
1270 +#define CREGCNT 0
1271 +#define DREGCNT 0
1272 +#define EREGCNT 0
1273 +#define FREGCNT 0
1274 +#define GREGCNT 0
1275 +int aliasmap(int class, int regnum);
1276 +int color2reg(int color, int class);
1277 +int interferes(int reg1, int reg2);
1278 +#endif /* _EXTERNAL_H_ */
1279 diff -ur --unidirectional-new-file pcc-1.0.0/cc/ccom/arch/ppc32/external.c pcc/cc/ccom/arch/ppc32/external.c
1280 --- pcc-1.0.0/cc/ccom/arch/ppc32/external.c 1970-01-01 01:00:00.000000000 +0100
1281 +++ pcc/cc/ccom/arch/ppc32/external.c 2013-09-11 19:46:33.156788000 +0200
1282 @@ -0,0 +1,246 @@
1283 +#include "pass2.h"
1285 +// TODO: replace with file generated by ccom_mkext
1287 +static int op0[] = { -1 };
1288 +static int op1[] = { -1 };
1289 +static int op2[] = { -1 };
1290 +static int op3[] = { -1 };
1291 +static int op4[] = { -1 };
1292 +static int op5[] = { -1 };
1293 +static int op6[] = { -1 };
1294 +static int op7[] = { -1 };
1295 +static int op8[] = { -1 };
1296 +static int op9[] = { -1 };
1297 +static int op10[] = { -1 };
1298 +static int op11[] = { -1 };
1299 +static int op12[] = { -1 };
1300 +static int op13[] = { -1 };
1301 +static int op14[] = { -1 };
1302 +static int op15[] = { -1 };
1303 +static int op16[] = { -1 };
1304 +static int op17[] = { -1 };
1305 +static int op18[] = { -1 };
1306 +static int op19[] = { -1 };
1307 +static int op20[] = { -1 };
1308 +static int op21[] = { -1 };
1309 +static int op22[] = { -1 };
1310 +static int op23[] = { -1 };
1311 +static int op24[] = { -1 };
1312 +static int op25[] = { -1 };
1313 +static int op26[] = { -1 };
1314 +static int op27[] = { -1 };
1315 +static int op28[] = { -1 };
1316 +static int op29[] = { -1 };
1317 +static int op30[] = { -1 };
1318 +static int op31[] = { -1 };
1319 +static int op32[] = { -1 };
1320 +static int op33[] = { -1 };
1321 +static int op34[] = { -1 };
1322 +static int op35[] = { -1 };
1323 +static int op36[] = { -1 };
1324 +static int op37[] = { -1 };
1325 +static int op38[] = { -1 };
1326 +static int op39[] = { -1 };
1327 +static int op40[] = { -1 };
1328 +static int op41[] = { -1 };
1329 +static int op42[] = { -1 };
1330 +static int op43[] = { -1 };
1331 +static int op44[] = { -1 };
1332 +static int op45[] = { -1 };
1333 +static int op46[] = { -1 };
1334 +static int op47[] = { -1 };
1335 +static int op48[] = { -1 };
1336 +static int op49[] = { -1 };
1337 +static int op50[] = { -1 };
1338 +static int op51[] = { -1 };
1339 +static int op52[] = { -1 };
1340 +static int op53[] = { -1 };
1341 +static int op54[] = { -1 };
1342 +static int op55[] = { -1 };
1343 +static int op56[] = { -1 };
1344 +static int op57[] = { -1 };
1345 +static int op58[] = { -1 };
1347 +int *qtable[] = {
1348 + op0,
1349 + op1,
1350 + op2,
1351 + op3,
1352 + op4,
1353 + op5,
1354 + op6,
1355 + op7,
1356 + op8,
1357 + op9,
1358 + op10,
1359 + op11,
1360 + op12,
1361 + op13,
1362 + op14,
1363 + op15,
1364 + op16,
1365 + op17,
1366 + op18,
1367 + op19,
1368 + op20,
1369 + op21,
1370 + op22,
1371 + op23,
1372 + op24,
1373 + op25,
1374 + op26,
1375 + op27,
1376 + op28,
1377 + op29,
1378 + op30,
1379 + op31,
1380 + op32,
1381 + op33,
1382 + op34,
1383 + op35,
1384 + op36,
1385 + op37,
1386 + op38,
1387 + op39,
1388 + op40,
1389 + op41,
1390 + op42,
1391 + op43,
1392 + op44,
1393 + op45,
1394 + op46,
1395 + op47,
1396 + op48,
1397 + op49,
1398 + op50,
1399 + op51,
1400 + op52,
1401 + op53,
1402 + op54,
1403 + op55,
1404 + op56,
1405 + op57,
1406 + op58,
1408 +int tempregs[] = { -1 };
1409 +int permregs[] = { -1 };
1410 +bittype validregs[] = {
1411 + 0x7fffffffff,
1413 +static int amap[MAXREGS][NUMCLASS] = {
1414 + /* 0 */{ 0x0,0x0,0x0,0x0 },
1415 + /* 1 */{ 0x0,0x0,0x0,0x0 },
1416 + /* 2 */{ 0x0,0x0,0x0,0x0 },
1417 + /* 3 */{ 0x0,0x0,0x0,0x0 },
1418 + /* 4 */{ 0x0,0x0,0x0,0x0 },
1419 + /* 5 */{ 0x0,0x0,0x0,0x0 },
1420 + /* 6 */{ 0x0,0x0,0x0,0x0 },
1421 + /* 7 */{ 0x0,0x0,0x0,0x0 },
1422 + /* 8 */{ 0x0,0x0,0x0,0x0 },
1423 + /* 9 */{ 0x0,0x0,0x0,0x0 },
1424 + /* 10 */{ 0x0,0x0,0x0,0x0 },
1425 + /* 11 */{ 0x0,0x0,0x0,0x0 },
1426 + /* 12 */{ 0x0,0x0,0x0,0x0 },
1427 + /* 13 */{ 0x0,0x0,0x0,0x0 },
1428 + /* 14 */{ 0x0,0x0,0x0,0x0 },
1429 + /* 15 */{ 0x0,0x0,0x0,0x0 },
1430 + /* 16 */{ 0x0,0x0,0x0,0x0 },
1431 + /* 17 */{ 0x0,0x0,0x0,0x0 },
1432 + /* 18 */{ 0x0,0x0,0x0,0x0 },
1433 + /* 19 */{ 0x0,0x0,0x0,0x0 },
1434 + /* 20 */{ 0x0,0x0,0x0,0x0 },
1435 + /* 21 */{ 0x0,0x0,0x0,0x0 },
1436 + /* 22 */{ 0x0,0x0,0x0,0x0 },
1437 + /* 23 */{ 0x0,0x0,0x0,0x0 },
1438 + /* 24 */{ 0x0,0x0,0x0,0x0 },
1439 + /* 25 */{ 0x0,0x0,0x0,0x0 },
1440 + /* 26 */{ 0x0,0x0,0x0,0x0 },
1441 + /* 27 */{ 0x0,0x0,0x0,0x0 },
1442 + /* 28 */{ 0x0,0x0,0x0,0x0 },
1443 + /* 29 */{ 0x0,0x0,0x0,0x0 },
1444 + /* 30 */{ 0x0,0x0,0x0,0x0 },
1445 + /* 31 */{ 0x0,0x0,0x0,0x0 },
1446 + /* 32 */{ 0x0,0x0,0x0,0x0 },
1447 + /* 33 */{ 0x0,0x0,0x0,0x0 },
1448 + /* 34 */{ 0x0,0x0,0x0,0x0 },
1449 + /* 35 */{ 0x0,0x0,0x0,0x0 },
1450 + /* 36 */{ 0x0,0x0,0x0,0x0 },
1451 + /* 37 */{ 0x0,0x0,0x0,0x0 },
1452 + /* 38 */{ 0x0,0x0,0x0,0x0 }
1454 +int
1455 +aliasmap(int class, int regnum)
1457 + return amap[regnum][class-1];
1459 +static int rmap[NUMCLASS][15] = {
1460 + { 0, 1, 2, 3, 4, 5, },
1461 + { 8, 9, 10, 11, 12, 13, 14, 15, },
1462 + { 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, },
1463 + { 31, 32, 33, 34, 35, 36, 37, 38, },
1466 +int
1467 +color2reg(int color, int class)
1469 + return rmap[class-1][color];
1471 +int regK[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
1472 +int
1473 +classmask(int class)
1475 + if(class == CLASSA) return 0x0;
1476 + if(class == CLASSB) return 0x0;
1477 + if(class == CLASSC) return 0x0;
1478 + if(class == CLASSD) return 0x0;
1479 + if(class == CLASSE) return 0x0;
1480 + if(class == CLASSF) return 0x0;
1481 + return 0x0;
1483 +static bittype ovlarr[MAXREGS][1] = {
1484 +{ 0x1f0301, },
1485 +{ 0x1e10c02, },
1486 +{ 0xe223004, },
1487 +{ 0x3244c008, },
1488 +{ 0x54880010, },
1489 +{ 0x69100020, },
1490 +{ 0x40, },
1491 +{ 0x80, },
1492 +{ 0x1f0101, },
1493 +{ 0x1f0201, },
1494 +{ 0x1e10402, },
1495 +{ 0x1e10802, },
1496 +{ 0xe221004, },
1497 +{ 0xe222004, },
1498 +{ 0x32444008, },
1499 +{ 0x32448008, },
1500 +{ 0x1ff0f03, },
1501 +{ 0xe3f3305, },
1502 +{ 0x325fc309, },
1503 +{ 0x549f0311, },
1504 +{ 0x691f0321, },
1505 +{ 0xfe33c06, },
1506 +{ 0x33e5cc0a, },
1507 +{ 0x55e90c12, },
1508 +{ 0x69f10c22, },
1509 +{ 0x3e66f00c, },
1510 +{ 0x5eaa3014, },
1511 +{ 0x6f323024, },
1512 +{ 0x76ccc018, },
1513 +{ 0x7b54c028, },
1514 +{ 0x7d980030, },
1515 +{ 0x80000000, },
1516 +{ 0x1, },
1517 +{ 0x2, },
1518 +{ 0x4, },
1519 +{ 0x8, },
1520 +{ 0x10, },
1521 +{ 0x20, },
1522 +{ 0x40, },
1524 +int
1525 +interferes(int reg1, int reg2)
1527 +return (TESTBIT(ovlarr[reg1], reg2)) != 0;
1529 diff -ur --unidirectional-new-file pcc-1.0.0/cc/ccom/arch/ppc32/external.h pcc/cc/ccom/arch/ppc32/external.h
1530 --- pcc-1.0.0/cc/ccom/arch/ppc32/external.h 1970-01-01 01:00:00.000000000 +0100
1531 +++ pcc/cc/ccom/arch/ppc32/external.h 2013-09-11 19:46:33.156788000 +0200
1532 @@ -0,0 +1,27 @@
1533 +// TODO: replace with file generated by ccom_mkext
1535 +#ifndef _EXTERNAL_H_
1536 +#define _EXTERNAL_H_
1537 +#define MAXOPLEN 0
1538 +#define NUMBITS 32
1539 +#define BIT2BYTE(bits) ((((bits)+NUMBITS-1)/NUMBITS)*(NUMBITS/8))
1540 +#define BITSET(arr, bit) (arr[bit/NUMBITS] |= ((int)1 << (bit & (NUMBITS-1))))
1541 +#define BITCLEAR(arr, bit) (arr[bit/NUMBITS] &= ~((int)1 << (bit & (NUMBITS-1))))
1542 +#define TESTBIT(arr, bit) (arr[bit/NUMBITS] & ((int)1 << (bit & (NUMBITS-1))))
1543 +typedef int bittype;
1544 +extern int tempregs[], permregs[];
1545 +#define NTEMPREG 0
1546 +#define FREGS 0
1547 +#define NPERMREG 0
1548 +extern bittype validregs[];
1549 +#define AREGCNT 0
1550 +#define BREGCNT 0
1551 +#define CREGCNT 0
1552 +#define DREGCNT 0
1553 +#define EREGCNT 0
1554 +#define FREGCNT 0
1555 +#define GREGCNT 0
1556 +int aliasmap(int class, int regnum);
1557 +int color2reg(int color, int class);
1558 +int interferes(int reg1, int reg2);
1559 +#endif /* _EXTERNAL_H_ */
1560 diff -ur --unidirectional-new-file pcc-1.0.0/cc/ccom/main.c pcc/cc/ccom/main.c
1561 --- pcc-1.0.0/cc/ccom/main.c 2011-01-22 23:08:23.000000000 +0100
1562 +++ pcc/cc/ccom/main.c 2013-09-11 19:46:33.156788000 +0200
1563 @@ -299,6 +299,9 @@
1564 perror(NULL);
1565 exit(1);
1567 + } else {
1568 + fprintf(stderr, "Reading from standard input is disabled on HelenOS\n");
1569 + exit(1);
1571 if (argc > 1 && strcmp(argv[1], "-") != 0) {
1572 if (freopen(argv[1], "w", stdout) == NULL) {
1573 @@ -310,7 +313,9 @@
1576 mkdope();
1577 +#ifndef __helenos__
1578 signal(SIGSEGV, segvcatch);
1579 +#endif
1580 #ifdef SIGBUS
1581 signal(SIGBUS, segvcatch);
1582 #endif
1583 diff -ur --unidirectional-new-file pcc-1.0.0/cc/ccom/Makefile pcc/cc/ccom/Makefile
1584 --- pcc-1.0.0/cc/ccom/Makefile 1970-01-01 01:00:00.000000000 +0100
1585 +++ pcc/cc/ccom/Makefile 2013-09-11 19:46:33.156788000 +0200
1586 @@ -0,0 +1,94 @@
1588 +# Copyright (c) 2011 Jiri Zarevucky
1589 +# All rights reserved.
1591 +# Redistribution and use in source and binary forms, with or without
1592 +# modification, are permitted provided that the following conditions
1593 +# are met:
1595 +# - Redistributions of source code must retain the above copyright
1596 +# notice, this list of conditions and the following disclaimer.
1597 +# - Redistributions in binary form must reproduce the above copyright
1598 +# notice, this list of conditions and the following disclaimer in the
1599 +# documentation and/or other materials provided with the distribution.
1600 +# - The name of the author may not be used to endorse or promote products
1601 +# derived from this software without specific prior written permission.
1603 +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1604 +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1605 +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1606 +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1607 +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1608 +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1609 +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
1610 +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1611 +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1612 +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1615 +MIPDIR = ../../mip
1616 +MDIR = ../../arch/$(PLATFORM)
1617 +OSDIR = ../../os/helenos
1618 +EXTRA_CFLAGS = -I$(MIPDIR) -I$(MDIR) -I$(OSDIR) -I. -w
1619 +DEFS = -Dmach_$(PLATFORM) -D__helenos__ -DPCC_DEBUG -DGCC_COMPAT -Dfree=free
1620 +LIBS = $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a
1621 +BINARY = ccom
1623 +PRE_DEPEND = cgram.c scan.c external.c external.h common.c compat.c
1624 +EXTRA_CLEAN = cgram.c cgram.h scan.c external.c external.h common.c compat.c \
1625 + $(MIPDIR)/*.o $(MDIR)/*.o
1627 +POSIX_COMPAT = y
1629 +# FIXME: external.{c,h} must be generated for each target system
1631 +SOURCES = \
1632 + external.c \
1633 + $(MDIR)/local.c \
1634 + $(MDIR)/local2.c \
1635 + $(MDIR)/code.c \
1636 + $(MDIR)/order.c \
1637 + $(MDIR)/table.c \
1638 + $(MIPDIR)/match.c \
1639 + $(MIPDIR)/reader.c \
1640 + $(MIPDIR)/optim2.c \
1641 + $(MIPDIR)/regs.c \
1642 + common.c \
1643 + compat.c \
1644 + cgram.c \
1645 + scan.c \
1646 + builtins.c \
1647 + gcc_compat.c \
1648 + init.c \
1649 + inline.c \
1650 + main.c \
1651 + optim.c \
1652 + pftn.c \
1653 + softfloat.c \
1654 + stabs.c \
1655 + symtabs.c \
1656 + trees.c
1658 +include $(USPACE_PREFIX)/Makefile.common
1660 +cgram.c: cgram.y
1661 + $(YACC) $(YFLAGS) -d $<
1662 + mv y.tab.c cgram.c
1663 + mv y.tab.h cgram.h
1665 +scan.c: scan.l cgram.c
1666 + $(LEX) $(LFLAGS) $<
1667 + mv lex.yy.c scan.c
1669 +compat.c: $(MIPDIR)/compat.c
1670 + ln -s -f $^ $@
1672 +common.c: $(MIPDIR)/common.c
1673 + ln -s -f $^ $@
1675 +external.c: arch/$(PLATFORM)/external.c
1676 + ln -s -f $^ $@
1678 +external.h: arch/$(PLATFORM)/external.h
1679 + ln -s -f $^ $@
1681 diff -ur --unidirectional-new-file pcc-1.0.0/cc/ccom/mkext/Makefile pcc/cc/ccom/mkext/Makefile
1682 --- pcc-1.0.0/cc/ccom/mkext/Makefile 1970-01-01 01:00:00.000000000 +0100
1683 +++ pcc/cc/ccom/mkext/Makefile 2013-09-11 19:46:33.156788000 +0200
1684 @@ -0,0 +1,58 @@
1686 +# Copyright (c) 2011 Jiri Zarevucky
1687 +# All rights reserved.
1689 +# Redistribution and use in source and binary forms, with or without
1690 +# modification, are permitted provided that the following conditions
1691 +# are met:
1693 +# - Redistributions of source code must retain the above copyright
1694 +# notice, this list of conditions and the following disclaimer.
1695 +# - Redistributions in binary form must reproduce the above copyright
1696 +# notice, this list of conditions and the following disclaimer in the
1697 +# documentation and/or other materials provided with the distribution.
1698 +# - The name of the author may not be used to endorse or promote products
1699 +# derived from this software without specific prior written permission.
1701 +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1702 +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1703 +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1704 +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1705 +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1706 +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1707 +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
1708 +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1709 +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1710 +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1713 +MIPDIR = ../../../mip
1714 +MDIR = ../../../arch/$(PLATFORM)
1715 +OSDIR = ../../../os/helenos
1716 +EXTRA_CFLAGS = -I$(MIPDIR) -I$(MDIR) -I$(OSDIR) -I. -w
1717 +DEFS = -DGCC_COMPAT -DPCC_DEBUG -DMKEXT -Dmach_$(PLATFORM) -D__helenos__
1718 +BINARY = cc_mkext
1720 +POSIX_COMPAT = y
1722 +PRE_DEPEND = mkext.c table.c common.c
1723 +EXTRA_CLEAN = mkext.c table.c common.c
1725 +# FIXME: external.{c,h} must be generated for each target system
1727 +SOURCES = \
1728 + mkext.c \
1729 + table.c \
1730 + common.c
1732 +include $(USPACE_PREFIX)/Makefile.common
1734 +mkext.c: $(MIPDIR)/mkext.c
1735 + ln -s -f $^ $@
1737 +table.c: $(MDIR)/table.c
1738 + ln -s -f $^ $@
1740 +common.c: $(MIPDIR)/common.c
1741 + ln -s -f $^ $@
1743 diff -ur --unidirectional-new-file pcc-1.0.0/cc/ccom/pftn.c pcc/cc/ccom/pftn.c
1744 --- pcc-1.0.0/cc/ccom/pftn.c 2011-02-20 11:19:07.000000000 +0100
1745 +++ pcc/cc/ccom/pftn.c 2013-09-11 19:46:33.156788000 +0200
1746 @@ -1139,6 +1139,12 @@
1749 ap = attr_find(apl, ATTR_BASETYP);
1751 + if (ap == NULL) {
1752 + cerror("unknown type");
1753 + return SZINT;
1756 sz = ap->atypsz;
1758 #ifdef GCC_COMPAT
1759 diff -ur --unidirectional-new-file pcc-1.0.0/cc/ccom/trees.c pcc/cc/ccom/trees.c
1760 --- pcc-1.0.0/cc/ccom/trees.c 2011-03-01 18:39:28.000000000 +0100
1761 +++ pcc/cc/ccom/trees.c 2013-09-11 19:46:33.156788000 +0200
1762 @@ -72,6 +72,12 @@
1763 # include <stdarg.h>
1764 # include <string.h>
1766 +/* standard macros conflict with identifiers in this file */
1767 +#ifdef true
1768 + #undef true
1769 + #undef false
1770 +#endif
1772 static void chkpun(NODE *p);
1773 static int opact(NODE *p);
1774 static int moditype(TWORD);
1775 diff -ur --unidirectional-new-file pcc-1.0.0/cc/cpp/config.h pcc/cc/cpp/config.h
1776 --- pcc-1.0.0/cc/cpp/config.h 1970-01-01 01:00:00.000000000 +0100
1777 +++ pcc/cc/cpp/config.h 2013-09-11 19:46:33.156788000 +0200
1778 @@ -0,0 +1,182 @@
1779 +/* Hard-coded, because wiring up configure script would just not be worth the effort. */
1781 +/* Using a.out ABI */
1782 +//#undef AOUTABI
1784 +/* Define path to alternate assembler */
1785 +#define ASSEMBLER "/app/as"
1787 +/* Using Classic 68k ABI */
1788 +//#undef CLASSIC68K
1790 +/* Using COFF ABI */
1791 +//#undef COFFABI
1793 +/* Define path to alternate compiler */
1794 +//#undef COMPILER
1796 +/* Using ECOFF ABI */
1797 +//#undef ECOFFABI
1799 +/* Using ELF ABI */
1800 +#define ELFABI 1
1802 +/* Define to 1 if you have the `basename' function. */
1803 +//#define HAVE_BASENAME 1
1805 +/* Define to 1 if printf supports C99 size specifiers */
1806 +//#define HAVE_C99_FORMAT 1
1808 +/* Define to 1 if your compiler supports C99 variadic macros */
1809 +#define HAVE_CPP_VARARG_MACRO_GCC 1
1811 +/* Define to 1 if you have the `ffs' function. */
1812 +#define HAVE_FFS 1
1814 +/* Define to 1 if you have the `getopt' function. */
1815 +#define HAVE_GETOPT 1
1817 +/* Define to 1 if you have the <inttypes.h> header file. */
1818 +#define HAVE_INTTYPES_H 1
1820 +/* Define to 1 if you have the <libgen.h> header file. */
1821 +//#define HAVE_LIBGEN_H 1
1823 +/* Define to 1 if you have the <malloc.h> header file. */
1824 +#define HAVE_MALLOC_H 1
1826 +/* Define to 1 if you have the <memory.h> header file. */
1827 +#define HAVE_MEMORY_H 1
1829 +/* Define to 1 if you have the `mkstemp' function. */
1830 +#define HAVE_MKSTEMP 1
1832 +/* Define to 1 if you have the `snprintf' function. */
1833 +#define HAVE_SNPRINTF 1
1835 +/* Define to 1 if you have the <stdint.h> header file. */
1836 +#define HAVE_STDINT_H 1
1838 +/* Define to 1 if you have the <stdlib.h> header file. */
1839 +#define HAVE_STDLIB_H 1
1841 +/* Define to 1 if you have the <strings.h> header file. */
1842 +#define HAVE_STRINGS_H 1
1844 +/* Define to 1 if you have the <string.h> header file. */
1845 +#define HAVE_STRING_H 1
1847 +/* Define to 1 if you have the `strlcat' function. */
1848 +//#define HAVE_STRLCAT 1
1850 +/* Define to 1 if you have the `strlcpy' function. */
1851 +//#define HAVE_STRLCPY 1
1853 +/* Define to 1 if you have the `strtold' function. */
1854 +#define HAVE_STRTOLD 1
1856 +/* Define to 1 if you have the <sys/stat.h> header file. */
1857 +#define HAVE_SYS_STAT_H 1
1859 +/* Define to 1 if you have the <sys/types.h> header file. */
1860 +#define HAVE_SYS_TYPES_H 1
1862 +/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
1863 +//#define HAVE_SYS_WAIT_H 1
1865 +/* Define to 1 if you have the <unistd.h> header file. */
1866 +#define HAVE_UNISTD_H 1
1868 +/* Define to 1 if you have the `vfork' function. */
1869 +//#define HAVE_VFORK 1
1871 +/* Define to 1 if you have the `vsnprintf' function. */
1872 +#define HAVE_VSNPRINTF 1
1874 +#ifdef __BE__
1875 + /* Define if host is BIG endian */
1876 + #define HOST_BIG_ENDIAN
1877 + /* Define if target defaults to BIG endian */
1878 + #undef TARGET_BIG_ENDIAN
1879 +#endif
1881 +#ifdef __LE__
1882 + /* Define if host is LITTLE endian */
1883 + #define HOST_LITTLE_ENDIAN
1884 + /* Define if target defaults to LITTLE endian */
1885 + #define TARGET_LITTLE_ENDIAN
1886 +#endif
1888 +/* lex is flex */
1889 +#define ISFLEX 1
1891 +/* Define alternate standard lib directory */
1892 +#define LIBDIR "/lib/"
1894 +/* Define path to alternate linker */
1895 +#define LINKER "/app/ld"
1897 +/* Using Mach-O ABI */
1898 +//#undef MACHOABI
1900 +/* Define to the address where bug reports for this package should be sent. */
1901 +#define PACKAGE_BUGREPORT "<zarevucky.jiri@gmail.com>"
1903 +/* Define to the full name of this package. */
1904 +#define PACKAGE_NAME "pcc"
1906 +/* Define to the full name and version of this package. */
1907 +#define PACKAGE_STRING "pcc 1.0.0.RELEASE"
1909 +/* Define to the one symbol short name of this package. */
1910 +#define PACKAGE_TARNAME "pcc"
1912 +/* Define to the version of this package. */
1913 +#define PACKAGE_VERSION "1.0.0.RELEASE"
1915 +/* Major version no */
1916 +#define PCC_MAJOR 1
1918 +/* Minor version no */
1919 +#define PCC_MINOR 0
1921 +/* Minor minor version no */
1922 +#define PCC_MINORMINOR 0
1924 +/* Using PE/COFF ABI */
1925 +//#undef PECOFFABI
1927 +/* Define path to alternate preprocessor */
1928 +#undef PREPROCESSOR
1930 +/* Define to 1 if you have the ANSI C header files. */
1931 +#define STDC_HEADERS 1
1933 +/* Define alternate standard include directory */
1934 +#define STDINC "/inc/c"
1937 +/* Target OS */
1938 +#define TARGOS helenos
1940 +/* Target OS version */
1941 +#define TARGOSVER 0
1943 +/* Enable thread-local storage (TLS). */
1944 +#define TLS 1
1946 +/* Version string */
1947 +#define VERSSTR "pcc 1.0.0.RELEASE 20110221 for HelenOS"
1949 +/* Size of wide character type */
1950 +#define WCHAR_SIZE 4
1952 +/* Type to use for wide characters */
1953 +#define WCHAR_TYPE INT
1955 +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
1956 + `char[]'. */
1957 +//#define YYTEXT_POINTER 1
1959 +#undef COMPILER
1961 diff -ur --unidirectional-new-file pcc-1.0.0/cc/cpp/cpp.c pcc/cc/cpp/cpp.c
1962 --- pcc-1.0.0/cc/cpp/cpp.c 2011-03-27 15:17:19.000000000 +0200
1963 +++ pcc/cc/cpp/cpp.c 2013-09-11 19:46:33.156788000 +0200
1964 @@ -274,7 +274,7 @@
1965 if ((ofd = open(argv[1], O_WRONLY|O_CREAT, 0600)) < 0)
1966 error("Can't creat %s", argv[1]);
1967 } else
1968 - ofd = 1; /* stdout */
1969 + ofd = fileno(stdout);
1970 istty = isatty(ofd);
1972 if (argc && strcmp(argv[0], "-")) {
1973 @@ -402,7 +402,7 @@
1974 struct symtab *nl;
1975 usch *osp;
1976 usch *fn, *safefn;
1977 - int c, it;
1978 + int c;
1980 if (flslvl)
1981 return;
1982 @@ -436,7 +436,7 @@
1984 if (c != '\n')
1985 goto bad;
1986 - it = SYSINC;
1987 + (void) SYSINC;
1988 safefn = fn;
1989 } else {
1990 usch *nm = stringbuf;
1991 @@ -869,7 +869,6 @@
1993 usch *t;
1994 usch *sb = stringbuf;
1995 - int dummy;
1997 flbuf();
1998 savch(0);
1999 @@ -877,8 +876,8 @@
2000 t = sheap("%s:%d: warning: ", ifiles->fname, ifiles->lineno);
2001 write (2, t, strlen((char *)t));
2003 - dummy = write (2, s, strlen((char *)s));
2004 - dummy = write (2, "\n", 1);
2005 + write (2, s, strlen((char *)s));
2006 + write (2, "\n", 1);
2007 stringbuf = sb;
2010 @@ -886,16 +885,15 @@
2011 xerror(usch *s)
2013 usch *t;
2014 - int dummy;
2016 flbuf();
2017 savch(0);
2018 if (ifiles != NULL) {
2019 t = sheap("%s:%d: error: ", ifiles->fname, ifiles->lineno);
2020 - dummy = write (2, t, strlen((char *)t));
2021 + write (2, t, strlen((char *)t));
2023 - dummy = write (2, s, strlen((char *)s));
2024 - dummy = write (2, "\n", 1);
2025 + write (2, s, strlen((char *)s));
2026 + write (2, "\n", 1);
2027 exit(1);
2030 @@ -1709,12 +1707,27 @@
2034 +static ssize_t
2035 +_write_all(int fd, const void* buffer, size_t count)
2037 + size_t remaining = count;
2038 + while (remaining > 0) {
2039 + ssize_t retval = write(ofd, buffer, remaining);
2040 + if (retval < 0) {
2041 + return retval;
2043 + remaining -= retval;
2044 + buffer += retval;
2046 + return count;
2049 void
2050 flbuf()
2052 if (obufp == 0)
2053 return;
2054 - if (Mflag == 0 && write(ofd, outbuf, obufp) < 0)
2055 + if (Mflag == 0 && _write_all(ofd, outbuf, obufp) < 0)
2056 error("obuf write error");
2057 lastoch = outbuf[obufp-1];
2058 obufp = 0;
2059 @@ -1862,7 +1875,7 @@
2060 struct symtab *sp;
2061 struct tree *w, *new, *last;
2062 int len, cix, bit, fbit, svbit, ix, bitno;
2063 - const usch *k, *m, *sm;
2064 + const usch *k, *m;
2066 /* Count full string length */
2067 for (k = key, len = 0; *k; k++, len++)
2068 @@ -1897,7 +1910,7 @@
2070 sp = (struct symtab *)w;
2072 - sm = m = sp->namep;
2073 + m = sp->namep;
2074 k = key;
2076 /* Check for correct string and return */
2077 diff -ur --unidirectional-new-file pcc-1.0.0/cc/cpp/Makefile pcc/cc/cpp/Makefile
2078 --- pcc-1.0.0/cc/cpp/Makefile 1970-01-01 01:00:00.000000000 +0100
2079 +++ pcc/cc/cpp/Makefile 2013-09-11 19:46:33.156788000 +0200
2080 @@ -0,0 +1,55 @@
2082 +# Copyright (c) 2011 Jiri Zarevucky
2083 +# All rights reserved.
2085 +# Redistribution and use in source and binary forms, with or without
2086 +# modification, are permitted provided that the following conditions
2087 +# are met:
2089 +# - Redistributions of source code must retain the above copyright
2090 +# notice, this list of conditions and the following disclaimer.
2091 +# - Redistributions in binary form must reproduce the above copyright
2092 +# notice, this list of conditions and the following disclaimer in the
2093 +# documentation and/or other materials provided with the distribution.
2094 +# - The name of the author may not be used to endorse or promote products
2095 +# derived from this software without specific prior written permission.
2097 +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
2098 +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
2099 +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2100 +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2101 +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2102 +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2103 +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2104 +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2105 +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2106 +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2109 +MIPDIR = ../../mip
2110 +ARCHDIR = ../../arch/$(PLATFORM)
2111 +EXTRA_CFLAGS = -I$(MIPDIR) -I$(ARCHDIR) -w
2112 +DEFS = -DCPP_DEBUG -Dfree=free -DCPPBUF=16384
2113 +BINARY = cpp
2115 +PRE_DEPEND = compat.c
2116 +EXTRA_CLEAN = compat.c y.tab.c y.tab.h
2118 +POSIX_COMPAT = y
2120 +YACC = yacc
2122 +SOURCES = \
2123 + y.tab.c \
2124 + cpp.c \
2125 + token.c \
2126 + compat.c
2128 +include $(USPACE_PREFIX)/Makefile.common
2130 +y.tab.c:
2131 + $(YACC) -d cpy.y
2133 +compat.c: $(MIPDIR)/compat.c
2134 + ln -s -f $^ $@
2136 diff -ur --unidirectional-new-file pcc-1.0.0/cc/cpp/token.c pcc/cc/cpp/token.c
2137 --- pcc-1.0.0/cc/cpp/token.c 2011-03-12 18:08:26.000000000 +0100
2138 +++ pcc/cc/cpp/token.c 2013-09-11 19:46:33.156788000 +0200
2139 @@ -182,7 +182,7 @@
2140 fastscan(void)
2142 struct symtab *nl;
2143 - int ch, i, ccnt, onemore;
2144 + int ch, i, ccnt;
2145 usch *cp;
2147 goto run;
2148 @@ -356,7 +356,7 @@
2149 ch = NXTCH();
2150 goto xloop;
2152 - onemore = i = ccnt = 0;
2153 + i = ccnt = 0;
2154 do {
2155 yytext[i++] = (usch)ch;
2156 ch = NXTCH();
2157 @@ -799,7 +799,8 @@
2158 if (++inclevel > MAX_INCLEVEL)
2159 error("Limit for nested includes exceeded");
2160 } else {
2161 - ic->infil = 0;
2162 + error("Reading from stdin is disabled on HelenOS.");
2163 + ic->infil = fileno(stdin);
2164 ic->orgfn = ic->fname = (const usch *)"<stdin>";
2166 #ifndef BUF_STACK
2167 diff -ur --unidirectional-new-file pcc-1.0.0/config.h pcc/config.h
2168 --- pcc-1.0.0/config.h 1970-01-01 01:00:00.000000000 +0100
2169 +++ pcc/config.h 2013-09-11 19:46:33.156788000 +0200
2170 @@ -0,0 +1,182 @@
2171 +/* Hard-coded, because wiring up configure script would just not be worth the effort. */
2173 +/* Using a.out ABI */
2174 +//#undef AOUTABI
2176 +/* Define path to alternate assembler */
2177 +#define ASSEMBLER "/app/as"
2179 +/* Using Classic 68k ABI */
2180 +//#undef CLASSIC68K
2182 +/* Using COFF ABI */
2183 +//#undef COFFABI
2185 +/* Define path to alternate compiler */
2186 +//#undef COMPILER
2188 +/* Using ECOFF ABI */
2189 +//#undef ECOFFABI
2191 +/* Using ELF ABI */
2192 +#define ELFABI 1
2194 +/* Define to 1 if you have the `basename' function. */
2195 +//#define HAVE_BASENAME 1
2197 +/* Define to 1 if printf supports C99 size specifiers */
2198 +//#define HAVE_C99_FORMAT 1
2200 +/* Define to 1 if your compiler supports C99 variadic macros */
2201 +#define HAVE_CPP_VARARG_MACRO_GCC 1
2203 +/* Define to 1 if you have the `ffs' function. */
2204 +#define HAVE_FFS 1
2206 +/* Define to 1 if you have the `getopt' function. */
2207 +#define HAVE_GETOPT 1
2209 +/* Define to 1 if you have the <inttypes.h> header file. */
2210 +#define HAVE_INTTYPES_H 1
2212 +/* Define to 1 if you have the <libgen.h> header file. */
2213 +//#define HAVE_LIBGEN_H 1
2215 +/* Define to 1 if you have the <malloc.h> header file. */
2216 +#define HAVE_MALLOC_H 1
2218 +/* Define to 1 if you have the <memory.h> header file. */
2219 +#define HAVE_MEMORY_H 1
2221 +/* Define to 1 if you have the `mkstemp' function. */
2222 +#define HAVE_MKSTEMP 1
2224 +/* Define to 1 if you have the `snprintf' function. */
2225 +#define HAVE_SNPRINTF 1
2227 +/* Define to 1 if you have the <stdint.h> header file. */
2228 +#define HAVE_STDINT_H 1
2230 +/* Define to 1 if you have the <stdlib.h> header file. */
2231 +#define HAVE_STDLIB_H 1
2233 +/* Define to 1 if you have the <strings.h> header file. */
2234 +#define HAVE_STRINGS_H 1
2236 +/* Define to 1 if you have the <string.h> header file. */
2237 +#define HAVE_STRING_H 1
2239 +/* Define to 1 if you have the `strlcat' function. */
2240 +//#define HAVE_STRLCAT 1
2242 +/* Define to 1 if you have the `strlcpy' function. */
2243 +//#define HAVE_STRLCPY 1
2245 +/* Define to 1 if you have the `strtold' function. */
2246 +#define HAVE_STRTOLD 1
2248 +/* Define to 1 if you have the <sys/stat.h> header file. */
2249 +#define HAVE_SYS_STAT_H 1
2251 +/* Define to 1 if you have the <sys/types.h> header file. */
2252 +#define HAVE_SYS_TYPES_H 1
2254 +/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
2255 +//#define HAVE_SYS_WAIT_H 1
2257 +/* Define to 1 if you have the <unistd.h> header file. */
2258 +#define HAVE_UNISTD_H 1
2260 +/* Define to 1 if you have the `vfork' function. */
2261 +//#define HAVE_VFORK 1
2263 +/* Define to 1 if you have the `vsnprintf' function. */
2264 +#define HAVE_VSNPRINTF 1
2266 +#ifdef __BE__
2267 + /* Define if host is BIG endian */
2268 + #define HOST_BIG_ENDIAN
2269 + /* Define if target defaults to BIG endian */
2270 + #undef TARGET_BIG_ENDIAN
2271 +#endif
2273 +#ifdef __LE__
2274 + /* Define if host is LITTLE endian */
2275 + #define HOST_LITTLE_ENDIAN
2276 + /* Define if target defaults to LITTLE endian */
2277 + #define TARGET_LITTLE_ENDIAN
2278 +#endif
2280 +/* lex is flex */
2281 +#define ISFLEX 1
2283 +/* Define alternate standard lib directory */
2284 +#define LIBDIR "/lib/"
2286 +/* Define path to alternate linker */
2287 +#define LINKER "/app/ld"
2289 +/* Using Mach-O ABI */
2290 +//#undef MACHOABI
2292 +/* Define to the address where bug reports for this package should be sent. */
2293 +#define PACKAGE_BUGREPORT "<zarevucky.jiri@gmail.com>"
2295 +/* Define to the full name of this package. */
2296 +#define PACKAGE_NAME "pcc"
2298 +/* Define to the full name and version of this package. */
2299 +#define PACKAGE_STRING "pcc 1.0.0.RELEASE"
2301 +/* Define to the one symbol short name of this package. */
2302 +#define PACKAGE_TARNAME "pcc"
2304 +/* Define to the version of this package. */
2305 +#define PACKAGE_VERSION "1.0.0.RELEASE"
2307 +/* Major version no */
2308 +#define PCC_MAJOR 1
2310 +/* Minor version no */
2311 +#define PCC_MINOR 0
2313 +/* Minor minor version no */
2314 +#define PCC_MINORMINOR 0
2316 +/* Using PE/COFF ABI */
2317 +//#undef PECOFFABI
2319 +/* Define path to alternate preprocessor */
2320 +#undef PREPROCESSOR
2322 +/* Define to 1 if you have the ANSI C header files. */
2323 +#define STDC_HEADERS 1
2325 +/* Define alternate standard include directory */
2326 +#define STDINC "/inc/c"
2329 +/* Target OS */
2330 +#define TARGOS helenos
2332 +/* Target OS version */
2333 +#define TARGOSVER 0
2335 +/* Enable thread-local storage (TLS). */
2336 +#define TLS 1
2338 +/* Version string */
2339 +#define VERSSTR "pcc 1.0.0.RELEASE 20110221 for HelenOS"
2341 +/* Size of wide character type */
2342 +#define WCHAR_SIZE 4
2344 +/* Type to use for wide characters */
2345 +#define WCHAR_TYPE INT
2347 +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
2348 + `char[]'. */
2349 +//#define YYTEXT_POINTER 1
2351 +#undef COMPILER
2353 diff -ur --unidirectional-new-file pcc-1.0.0/mip/config.h pcc/mip/config.h
2354 --- pcc-1.0.0/mip/config.h 1970-01-01 01:00:00.000000000 +0100
2355 +++ pcc/mip/config.h 2013-09-11 19:46:33.156788000 +0200
2356 @@ -0,0 +1,182 @@
2357 +/* Hard-coded, because wiring up configure script would just not be worth the effort. */
2359 +/* Using a.out ABI */
2360 +//#undef AOUTABI
2362 +/* Define path to alternate assembler */
2363 +#define ASSEMBLER "/app/as"
2365 +/* Using Classic 68k ABI */
2366 +//#undef CLASSIC68K
2368 +/* Using COFF ABI */
2369 +//#undef COFFABI
2371 +/* Define path to alternate compiler */
2372 +//#undef COMPILER
2374 +/* Using ECOFF ABI */
2375 +//#undef ECOFFABI
2377 +/* Using ELF ABI */
2378 +#define ELFABI 1
2380 +/* Define to 1 if you have the `basename' function. */
2381 +//#define HAVE_BASENAME 1
2383 +/* Define to 1 if printf supports C99 size specifiers */
2384 +//#define HAVE_C99_FORMAT 1
2386 +/* Define to 1 if your compiler supports C99 variadic macros */
2387 +#define HAVE_CPP_VARARG_MACRO_GCC 1
2389 +/* Define to 1 if you have the `ffs' function. */
2390 +#define HAVE_FFS 1
2392 +/* Define to 1 if you have the `getopt' function. */
2393 +#define HAVE_GETOPT 1
2395 +/* Define to 1 if you have the <inttypes.h> header file. */
2396 +#define HAVE_INTTYPES_H 1
2398 +/* Define to 1 if you have the <libgen.h> header file. */
2399 +//#define HAVE_LIBGEN_H 1
2401 +/* Define to 1 if you have the <malloc.h> header file. */
2402 +#define HAVE_MALLOC_H 1
2404 +/* Define to 1 if you have the <memory.h> header file. */
2405 +#define HAVE_MEMORY_H 1
2407 +/* Define to 1 if you have the `mkstemp' function. */
2408 +#define HAVE_MKSTEMP 1
2410 +/* Define to 1 if you have the `snprintf' function. */
2411 +#define HAVE_SNPRINTF 1
2413 +/* Define to 1 if you have the <stdint.h> header file. */
2414 +#define HAVE_STDINT_H 1
2416 +/* Define to 1 if you have the <stdlib.h> header file. */
2417 +#define HAVE_STDLIB_H 1
2419 +/* Define to 1 if you have the <strings.h> header file. */
2420 +#define HAVE_STRINGS_H 1
2422 +/* Define to 1 if you have the <string.h> header file. */
2423 +#define HAVE_STRING_H 1
2425 +/* Define to 1 if you have the `strlcat' function. */
2426 +//#define HAVE_STRLCAT 1
2428 +/* Define to 1 if you have the `strlcpy' function. */
2429 +//#define HAVE_STRLCPY 1
2431 +/* Define to 1 if you have the `strtold' function. */
2432 +#define HAVE_STRTOLD 1
2434 +/* Define to 1 if you have the <sys/stat.h> header file. */
2435 +#define HAVE_SYS_STAT_H 1
2437 +/* Define to 1 if you have the <sys/types.h> header file. */
2438 +#define HAVE_SYS_TYPES_H 1
2440 +/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
2441 +//#define HAVE_SYS_WAIT_H 1
2443 +/* Define to 1 if you have the <unistd.h> header file. */
2444 +#define HAVE_UNISTD_H 1
2446 +/* Define to 1 if you have the `vfork' function. */
2447 +//#define HAVE_VFORK 1
2449 +/* Define to 1 if you have the `vsnprintf' function. */
2450 +#define HAVE_VSNPRINTF 1
2452 +#ifdef __BE__
2453 + /* Define if host is BIG endian */
2454 + #define HOST_BIG_ENDIAN
2455 + /* Define if target defaults to BIG endian */
2456 + #undef TARGET_BIG_ENDIAN
2457 +#endif
2459 +#ifdef __LE__
2460 + /* Define if host is LITTLE endian */
2461 + #define HOST_LITTLE_ENDIAN
2462 + /* Define if target defaults to LITTLE endian */
2463 + #define TARGET_LITTLE_ENDIAN
2464 +#endif
2466 +/* lex is flex */
2467 +#define ISFLEX 1
2469 +/* Define alternate standard lib directory */
2470 +#define LIBDIR "/lib/"
2472 +/* Define path to alternate linker */
2473 +#define LINKER "/app/ld"
2475 +/* Using Mach-O ABI */
2476 +//#undef MACHOABI
2478 +/* Define to the address where bug reports for this package should be sent. */
2479 +#define PACKAGE_BUGREPORT "<zarevucky.jiri@gmail.com>"
2481 +/* Define to the full name of this package. */
2482 +#define PACKAGE_NAME "pcc"
2484 +/* Define to the full name and version of this package. */
2485 +#define PACKAGE_STRING "pcc 1.0.0.RELEASE"
2487 +/* Define to the one symbol short name of this package. */
2488 +#define PACKAGE_TARNAME "pcc"
2490 +/* Define to the version of this package. */
2491 +#define PACKAGE_VERSION "1.0.0.RELEASE"
2493 +/* Major version no */
2494 +#define PCC_MAJOR 1
2496 +/* Minor version no */
2497 +#define PCC_MINOR 0
2499 +/* Minor minor version no */
2500 +#define PCC_MINORMINOR 0
2502 +/* Using PE/COFF ABI */
2503 +//#undef PECOFFABI
2505 +/* Define path to alternate preprocessor */
2506 +#undef PREPROCESSOR
2508 +/* Define to 1 if you have the ANSI C header files. */
2509 +#define STDC_HEADERS 1
2511 +/* Define alternate standard include directory */
2512 +#define STDINC "/inc/c"
2515 +/* Target OS */
2516 +#define TARGOS helenos
2518 +/* Target OS version */
2519 +#define TARGOSVER 0
2521 +/* Enable thread-local storage (TLS). */
2522 +#define TLS 1
2524 +/* Version string */
2525 +#define VERSSTR "pcc 1.0.0.RELEASE 20110221 for HelenOS"
2527 +/* Size of wide character type */
2528 +#define WCHAR_SIZE 4
2530 +/* Type to use for wide characters */
2531 +#define WCHAR_TYPE INT
2533 +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
2534 + `char[]'. */
2535 +//#define YYTEXT_POINTER 1
2537 +#undef COMPILER
2539 diff -ur --unidirectional-new-file pcc-1.0.0/os/helenos/ccconfig.h pcc/os/helenos/ccconfig.h
2540 --- pcc-1.0.0/os/helenos/ccconfig.h 1970-01-01 01:00:00.000000000 +0100
2541 +++ pcc/os/helenos/ccconfig.h 2013-09-11 19:46:33.156788000 +0200
2542 @@ -0,0 +1,87 @@
2543 +/* $Id: ccconfig.h,v 1.19 2010/11/09 08:40:50 ragge Exp $ */
2546 + * Copyright (c) 2011 Jiri Zarevucky
2547 + * All rights reserved.
2549 + * Redistribution and use in source and binary forms, with or without
2550 + * modification, are permitted provided that the following conditions
2551 + * are met:
2552 + * 1. Redistributions of source code must retain the above copyright
2553 + * notice, this list of conditions and the following disclaimer.
2554 + * 2. Redistributions in binary form must reproduce the above copyright
2555 + * notice, this list of conditions and the following disclaimer in the
2556 + * documentation and/or other materials provided with the distribution.
2557 + * 3. The name of the author may not be used to endorse or promote products
2558 + * derived from this software without specific prior written permission
2560 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
2561 + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
2562 + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2563 + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2564 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2565 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2566 + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2567 + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2568 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2569 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2570 + */
2573 + * Various settings that controls how the C compiler works.
2574 + */
2576 +/* common cpp predefines */
2577 +#define CPPADD { "-D__helenos__", "-D__ELF__", NULL, }
2579 +#undef CRT0FILE
2580 +#undef CRT0FILE_PROFILE
2582 +#define LIBCLIBS { "/lib/libc.a", "/lib/libsoftfloat.a", "/lib/libsoftint.a", NULL }
2583 +#define LIBCLIBS_PROFILE LIBCLIBS
2585 +#define STARTFILES { NULL }
2586 +#define ENDFILES { NULL }
2588 +#define STARTFILES_S { NULL }
2589 +#define ENDFILES_S { NULL }
2591 +#define STARTLABEL "__entry"
2593 +#if defined(mach_ia32)
2594 +#define CPPMDADD { "-D__i386__", NULL, }
2595 +#define DYNLINKER { NULL }
2596 +#elif defined(mach_ppc32)
2597 +#define CPPMDADD { "-D__ppc__", NULL, }
2598 +#define DYNLINKER { NULL }
2599 +#elif defined(mach_amd64)
2600 +#define CPPMDADD { "-D__x86_64__", NULL, }
2601 +#define DYNLINKER { NULL }
2602 +#elif defined(mach_mips32)
2603 +#define CPPMDADD { "-D__mips__", NULL, }
2604 +#define DYNLINKER { NULL }
2605 +#else
2606 +#error defines for arch missing
2607 +#endif
2609 +#ifndef LIBDIR
2610 +#define LIBDIR "/lib/"
2611 +#endif
2613 +#ifndef LIBEXECDIR
2614 +#define LIBEXECDIR "/app/"
2615 +#endif
2617 +#ifndef STDINC
2618 +#define STDINC "/inc/c/"
2619 +#endif
2621 +#ifndef INCLUDEDIR
2622 +#define INCLUDEDIR STDINC
2623 +#endif
2625 +#define STABS
2627 +#ifndef ELFABI
2628 +#define ELFABI
2629 +#endif