Gentoo Archives: gentoo-commits

From: "Joshua Kinard (kumba)" <kumba@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-boot/arcload/files: arcload-0.50-shut-gcc4x-up.patch arcload-0.50-makefile-targets.patch
Date: Mon, 02 Mar 2009 02:21:33
Message-Id: E1Ldxmb-0002c0-Mf@stork.gentoo.org
1 kumba 09/03/02 02:21:29
2
3 Added: arcload-0.50-shut-gcc4x-up.patch
4 arcload-0.50-makefile-targets.patch
5 Log:
6 Make arcload cross-compilable by altering the Makefile targets, and quiet down gcc-4.x's warnings. Modified ebuild accordingly and fixed minor QA Issues. Changed mips keyword to unstable.
7 (Portage version: 2.1.6.7/cvs/Linux mips64)
8
9 Revision Changes Path
10 1.1 sys-boot/arcload/files/arcload-0.50-shut-gcc4x-up.patch
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-boot/arcload/files/arcload-0.50-shut-gcc4x-up.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-boot/arcload/files/arcload-0.50-shut-gcc4x-up.patch?rev=1.1&content-type=text/plain
14
15 Index: arcload-0.50-shut-gcc4x-up.patch
16 ===================================================================
17 diff -Naurp arcload-0.5.orig/arcgrub/Makefile arcload-0.5/arcgrub/Makefile
18 --- arcload-0.5.orig/arcgrub/Makefile 2006-01-17 22:43:17.000000000 -0500
19 +++ arcload-0.5/arcgrub/Makefile 2009-03-01 20:34:01.258690486 -0500
20 @@ -2,11 +2,19 @@
21 # Copyright 2004 Stanislaw Skowronek
22 #
23 ifeq ($(MODE),M32)
24 -CFLAGS = -O -march=mips3 -mabi=32 -Wall -mno-abicalls -G 0 -fno-pic -fno-builtin -I.. -I. -D$(MODE)
25 +CFLAGS = -O -march=mips3 -mabi=32 \
26 + -Wall -Wno-pointer-sign \
27 + -mno-abicalls -G 0 -fno-pic -fno-builtin \
28 + -I.. -I. \
29 + -D$(MODE)
30 ASFLAGS= -march=mips3 -mabi=32 -mno-abicalls -G 0 -fno-pic -D$(MODE)
31 OUTPUTFMT = elf32-tradbigmips
32 else
33 -CFLAGS = -O -march=mips3 -mabi=64 -Wall -mno-abicalls -G 0 -fno-pic -fno-builtin -I.. -I. -D$(MODE)
34 +CFLAGS = -O -march=mips3 -mabi=64 \
35 + -Wall -Wno-pointer-sign \
36 + -mno-abicalls -G 0 -fno-pic -fno-builtin \
37 + -I.. -I. \
38 + -D$(MODE)
39 ASFLAGS= -march=mips3 -mabi=64 -mno-abicalls -G 0 -fno-pic -D$(MODE)
40 OUTPUTFMT = elf64-tradbigmips
41 endif
42 diff -Naurp arcload-0.5.orig/arclib/Makefile arcload-0.5/arclib/Makefile
43 --- arcload-0.5.orig/arclib/Makefile 2006-01-19 23:09:21.000000000 -0500
44 +++ arcload-0.5/arclib/Makefile 2009-03-01 20:35:21.407711034 -0500
45 @@ -2,11 +2,19 @@
46 # Copyright 1999 Silicon Graphics, Inc.
47 #
48 ifeq ($(MODE),M32)
49 -CFLAGS = -O -march=mips3 -mabi=32 -Wall -mno-abicalls -G 0 -fno-pic -fno-builtin -I.. -D$(MODE)
50 +CFLAGS = -O -march=mips3 -mabi=32 \
51 + -Wall -Wno-pointer-sign \
52 + -mno-abicalls -G 0 -fno-pic -fno-builtin \
53 + -I.. \
54 + -D$(MODE)
55 ASFLAGS= -march=mips3 -mabi=32 -mno-abicalls -G 0 -fno-pic
56 OUTPUTFMT = elf32-tradbigmips
57 else
58 -CFLAGS = -O -march=mips3 -mabi=64 -Wall -mno-abicalls -G 0 -fno-pic -fno-builtin -I.. -D$(MODE)
59 +CFLAGS = -O -march=mips3 -mabi=64 \
60 + -Wall -Wno-pointer-sign \
61 + -mno-abicalls -G 0 -fno-pic -fno-builtin \
62 + -I.. \
63 + -D$(MODE)
64 ASFLAGS= -march=mips3 -mabi=64 -mno-abicalls -G 0 -fno-pic
65 OUTPUTFMT = elf64-tradbigmips
66 endif
67 diff -Naurp arcload-0.5.orig/ecoff/Makefile arcload-0.5/ecoff/Makefile
68 --- arcload-0.5.orig/ecoff/Makefile 2005-05-31 03:08:10.000000000 -0400
69 +++ arcload-0.5/ecoff/Makefile 2009-03-01 20:31:38.246701883 -0500
70 @@ -5,7 +5,7 @@
71 all: wreckoff
72
73 wreckoff: ecoff.h elf32.h endian.h list.h wreckoff.c
74 - $(CC) -o $@ -O2 -Wall wreckoff.c -I..
75 + $(CC) -o $@ -O2 -Wall -Wno-pointer-sign wreckoff.c -I..
76
77 clean:
78 rm -f wreckoff
79 diff -Naurp arcload-0.5.orig/ecoff/wreckoff.c arcload-0.5/ecoff/wreckoff.c
80 --- arcload-0.5.orig/ecoff/wreckoff.c 2005-05-31 03:30:28.000000000 -0400
81 +++ arcload-0.5/ecoff/wreckoff.c 2009-03-01 20:31:38.246701883 -0500
82 @@ -112,6 +112,7 @@ void synthesize_ecoff(FILE *f)
83 int i, nsyms, nscns, vptr, rptr, sptr, align;
84 int strsize, sym_sc = scNil, sym_st = 0;
85 char *strtab;
86 + size_t ret = 0;
87
88 /* reindex sections and symbols */
89 nscns = 0;
90 @@ -151,7 +152,7 @@ void synthesize_ecoff(FILE *f)
91 fhdr.f_opthdr = 56;
92 fhdr.f_flags = (F_EXEC | F_MIPS_NO_REORG);
93 swap_filehdr(&fhdr);
94 - fwrite(&fhdr, sizeof(struct filehdr), 1, f);
95 + ret = fwrite(&fhdr, sizeof(struct filehdr), 1, f);
96
97 /* write a.out header */
98 ahdr.magic = OMAGIC;
99 @@ -196,7 +197,7 @@ void synthesize_ecoff(FILE *f)
100
101 ahdr.gp_value = reginfo.ri_gp_value;
102 swap_aouthdr(&ahdr);
103 - fwrite(&ahdr, sizeof(struct aouthdr), 1, f);
104 + ret = fwrite(&ahdr, sizeof(struct aouthdr), 1, f);
105
106 LIST_FOR(section, sections) {
107 strncpy(shdr.s_name, section->name, 8);
108 @@ -229,23 +230,23 @@ void synthesize_ecoff(FILE *f)
109 shdr.s_flags = STYP_BSS;
110
111 swap_scnhdr(&shdr);
112 - fwrite(&shdr, sizeof(struct scnhdr), 1, f);
113 + ret = fwrite(&shdr, sizeof(struct scnhdr), 1, f);
114 }
115
116 i = 0;
117 while(align--)
118 - fwrite(&i, 1, 1, f);
119 + ret = fwrite(&i, 1, 1, f);
120
121 /* save section contents */
122 LIST_FOR(section, sections)
123 if(section->data) {
124 if(section->gccfix) {
125 - fwrite(section->data, (section->size - 0x10), 1, f);
126 + ret = fwrite(section->data, (section->size - 0x10), 1, f);
127 align = 0;
128 for(i = 0; i < 4; i++)
129 - fwrite(&align, 4, 1, f);
130 + ret = fwrite(&align, 4, 1, f);
131 } else
132 - fwrite(section->data, section->size, 1, f);
133 + ret = fwrite(section->data, section->size, 1, f);
134 }
135
136 /* save section relocs */
137 @@ -275,7 +276,7 @@ void synthesize_ecoff(FILE *f)
138 rhdr.r_vaddr = reloc->offset;
139 rhdr.r = R_R(reloc->sym->index, i, 1);
140 swap_reloc(&rhdr);
141 - fwrite(&rhdr, sizeof(struct reloc), 1, f);
142 + ret = fwrite(&rhdr, sizeof(struct reloc), 1, f);
143 }
144
145 /* create strtab */
146 @@ -302,10 +303,10 @@ void synthesize_ecoff(FILE *f)
147 ghdr.iextMax = nsyms;
148 ghdr.cbExtOffset = (sptr + sizeof(struct sgihdrr) + strsize);
149 swap_sgihdrr(&ghdr);
150 - fwrite(&ghdr, sizeof(struct sgihdrr), 1, f);
151 + ret = fwrite(&ghdr, sizeof(struct sgihdrr), 1, f);
152
153 /* save strtab */
154 - fwrite(strtab, strsize, 1, f);
155 + ret = fwrite(strtab, strsize, 1, f);
156
157 /* save symbols */
158 LIST_FOR(symbol, symbols)
159 @@ -331,7 +332,7 @@ void synthesize_ecoff(FILE *f)
160 mhdr.value = symbol->offset;
161 mhdr.data = S_DATA(sym_st, sym_sc, 0xFFFFF);
162 swap_sgiextr(&mhdr);
163 - fwrite(&mhdr, sizeof(struct sgiextr), 1, f);
164 + ret = fwrite(&mhdr, sizeof(struct sgiextr), 1, f);
165 }
166 }
167
168 @@ -340,8 +341,9 @@ void synthesize_ecoff(FILE *f)
169 char *load_strtab(FILE *f, unsigned off, int sz)
170 {
171 char *p = malloc(sz);
172 + size_t ret = 0;
173 fseek(f, off, SEEK_SET);
174 - fread(p, sz, 1, f);
175 + ret = fread(p, sz, 1, f);
176 return p;
177 }
178
179 @@ -359,13 +361,14 @@ void analyze_elf32(FILE *f)
180 struct Reloc *reloc;
181 int i, j, symtab;
182 char **strtabs, **shnames;
183 + size_t ret = 0;
184
185 LIST_INIT(sections);
186 LIST_INIT(symbols);
187
188 /* load ELF header */
189 fseek(f, 0, SEEK_SET);
190 - fread(&ehdr, sizeof(Elf32_Ehdr), 1, f);
191 + ret = fread(&ehdr, sizeof(Elf32_Ehdr), 1, f);
192 swap_Ehdr(&ehdr);
193 for(i = 0; i < 6; i++)
194 if(ehdr.e_ident[i] != elf32_ident[i])
195 @@ -379,7 +382,7 @@ void analyze_elf32(FILE *f)
196 strtabs = calloc(sizeof(char *), ehdr.e_shnum);
197 for(i = 0; i < ehdr.e_shnum; i++) {
198 fseek(f, (ehdr.e_shoff + (ehdr.e_shentsize * i)), SEEK_SET);
199 - fread(&shdr, sizeof(Elf32_Shdr), 1, f);
200 + ret = fread(&shdr, sizeof(Elf32_Shdr), 1, f);
201 swap_Shdr(&shdr);
202
203 if(shdr.sh_type == SHT_STRTAB)
204 @@ -396,14 +399,14 @@ void analyze_elf32(FILE *f)
205 shnames=calloc(sizeof(char *),ehdr.e_shnum);
206 for(i = 0; i < ehdr.e_shnum; i++) {
207 fseek(f, (ehdr.e_shoff + (ehdr.e_shentsize * i)), SEEK_SET);
208 - fread(&shdr, sizeof(Elf32_Shdr), 1, f);
209 + ret = fread(&shdr, sizeof(Elf32_Shdr), 1, f);
210 swap_Shdr(&shdr);
211 shnames[i] = (strtabs[ehdr.e_shstrndx] + shdr.sh_name);
212
213 if((shdr.sh_flags & SHF_ALLOC)) {
214 if(shdr.sh_type == SHT_REGINFO) {
215 fseek(f, shdr.sh_offset, SEEK_SET);
216 - fread(&reginfo, sizeof(Elf32_RegInfo), 1, f);
217 + ret = fread(&reginfo, sizeof(Elf32_RegInfo), 1, f);
218 swap_RegInfo(&reginfo);
219 continue;
220 }
221 @@ -436,7 +439,7 @@ void analyze_elf32(FILE *f)
222 /* load symbols */
223 if(symtab != -1) {
224 fseek(f, (ehdr.e_shoff + (ehdr.e_shentsize * symtab)), SEEK_SET);
225 - fread(&shdr, sizeof(Elf32_Shdr), 1, f);
226 + ret = fread(&shdr, sizeof(Elf32_Shdr), 1, f);
227 swap_Shdr(&shdr);
228
229 if(!shdr.sh_entsize)
230 @@ -447,7 +450,7 @@ void analyze_elf32(FILE *f)
231
232 for( i = 0; i < (shdr.sh_size / shdr.sh_entsize); i++) {
233 fseek(f, (shdr.sh_offset + (shdr.sh_entsize * i)), SEEK_SET);
234 - fread(&mhdr, sizeof(Elf32_Sym), 1, f);
235 + ret = fread(&mhdr, sizeof(Elf32_Sym), 1, f);
236 swap_Sym(&mhdr);
237 symbol = calloc(sizeof(struct Symbol), 1);
238 symbol->name = (strtabs[shdr.sh_link] + mhdr.st_name);
239 @@ -470,7 +473,7 @@ void analyze_elf32(FILE *f)
240 /* load rels and decompose relas */
241 for(i = 0; i < ehdr.e_shnum; i++) {
242 fseek(f, (ehdr.e_shoff + (ehdr.e_shentsize * i)), SEEK_SET);
243 - fread(&shdr, sizeof(Elf32_Shdr), 1, f);
244 + ret = fread(&shdr, sizeof(Elf32_Shdr), 1, f);
245 swap_Shdr(&shdr);
246
247 if((shdr.sh_type != SHT_REL) && (shdr.sh_type != SHT_RELA))
248 @@ -491,13 +494,13 @@ void analyze_elf32(FILE *f)
249 fseek(f, (shdr.sh_offset + (shdr.sh_entsize * j)), SEEK_SET);
250
251 if(shdr.sh_type == SHT_REL) {
252 - fread(&qhdr, sizeof(Elf32_Rel), 1, f);
253 + ret = fread(&qhdr, sizeof(Elf32_Rel), 1, f);
254 swap_Rel(&qhdr);
255 rhdr.r_offset = qhdr.r_offset;
256 rhdr.r_info = qhdr.r_info;
257 rhdr.r_addend = 0;
258 } else {
259 - fread(&rhdr, sizeof(Elf32_Rela), 1, f);
260 + ret = fread(&rhdr, sizeof(Elf32_Rela), 1, f);
261 swap_Rela(&rhdr);
262 }
263
264 diff -Naurp arcload-0.5.orig/loader/Makefile arcload-0.5/loader/Makefile
265 --- arcload-0.5.orig/loader/Makefile 2006-01-19 23:10:04.000000000 -0500
266 +++ arcload-0.5/loader/Makefile 2009-03-01 20:37:21.376720711 -0500
267 @@ -2,12 +2,20 @@
268 # Copyright 2004 Stanislaw Skowronek
269 #
270 ifeq ($(MODE),M32)
271 -CFLAGS = -O -march=mips3 -mabi=32 -Wall -mno-abicalls -G 0 -fno-pic -fno-builtin -I.. -D$(MODE)
272 +CFLAGS = -O -march=mips3 -mabi=32 \
273 + -Wall -Wno-pointer-sign \
274 + -mno-abicalls -G 0 -fno-pic -fno-builtin \
275 + -I.. \
276 + -D$(MODE)
277 ASFLAGS= -march=mips3 -mabi=32 -mno-abicalls -G 0 -fno-pic -D$(MODE)
278 OUTPUTFMT = elf32-tradbigmips
279 TARGET = ../arcload.ecoff
280 else
281 -CFLAGS = -O -march=mips3 -mabi=64 -Wall -mno-abicalls -G 0 -fno-pic -fno-builtin -I.. -D$(MODE)
282 +CFLAGS = -O -march=mips3 -mabi=64 \
283 + -Wall -Wno-pointer-sign \
284 + -mno-abicalls -G 0 -fno-pic -fno-builtin \
285 + -I.. \
286 + -D$(MODE)
287 ASFLAGS= -march=mips3 -mabi=64 -mno-abicalls -G 0 -fno-pic -D$(MODE)
288 OUTPUTFMT = elf64-tradbigmips
289 TARGET = ../arcload
290
291
292
293 1.1 sys-boot/arcload/files/arcload-0.50-makefile-targets.patch
294
295 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-boot/arcload/files/arcload-0.50-makefile-targets.patch?rev=1.1&view=markup
296 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-boot/arcload/files/arcload-0.50-makefile-targets.patch?rev=1.1&content-type=text/plain
297
298 Index: arcload-0.50-makefile-targets.patch
299 ===================================================================
300 diff -Naurp arcload-0.5.orig/Makefile arcload-0.5/Makefile
301 --- arcload-0.5.orig/Makefile 2006-01-17 03:53:29.000000000 -0500
302 +++ arcload-0.5/Makefile 2009-03-01 20:18:14.699758276 -0500
303 @@ -6,9 +6,6 @@
304 # Default MODE
305 MODE ?= M64
306
307 -CC=mips-linux-gcc
308 -LD=mips-linux-ld
309 -
310 BUILD_DIRS=\
311 arclib \
312 arcgrub \
313 @@ -16,10 +13,25 @@ BUILD_DIRS=\
314 TOOL_DIRS=\
315 ecoff
316
317 -all clean:
318 +bootloader:
319 + for i in $(BUILD_DIRS); do \
320 + CC=${CC} LD=${LD} MODE=${MODE} $(MAKE) -C $$i all; \
321 + done
322 +
323 +tools:
324 for i in $(TOOL_DIRS); do \
325 - MODE=${MODE} $(MAKE) -C $$i $@; \
326 + $(MAKE) -C $$i all; \
327 done
328 +
329 +bootloader_clean:
330 for i in $(BUILD_DIRS); do \
331 - CC=${CC} LD=${LD} MODE=${MODE} $(MAKE) -C $$i $@; \
332 + CC=${CC} LD=${LD} MODE=${MODE} $(MAKE) -C $$i clean; \
333 + done
334 +
335 +tools_clean:
336 + for i in $(TOOL_DIRS); do \
337 + CC=${CC} LD=${LD} $(MAKE) -C $$i clean; \
338 done
339 +
340 +clean: tools_clean bootloader_clean
341 +all: tools bootloader