Magellan Linux

Annotation of /trunk/module-init-tools/patches/modutils-2.4.27-gcc.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 153 - (hide annotations) (download)
Tue May 8 20:52:56 2007 UTC (17 years, 1 month ago) by niro
File size: 6963 byte(s)
-import

1 niro 153 Fix building with newer gcc versions.
2    
3     Most changes taken from Debian.
4    
5     --- obj/obj_ia64.c
6     +++ obj/obj_ia64.c
7     @@ -127,6 +127,7 @@
8     return (*(bundle + 1) >> 23) & 0x1ffffffffff;
9    
10     default:
11     + ;
12     }
13     return (-1);
14     }
15     --- depmod/depmod.c
16     +++ depmod/depmod.c
17     @@ -1133,7 +1133,7 @@
18    
19     for (ksym = ksyms; so_far < nksyms; ++so_far, ksym++) {
20     if (strncmp((char *)ksym->name, "GPLONLY_", 8) == 0)
21     - ((char *)ksym->name) += 8;
22     + ksym->name = ((char *)ksym->name) + 8;
23     assert(n_syms < MAX_MAP_SYM);
24     symtab[n_syms++] = addsym((char *)ksym->name, mod, SYM_DEFINED, 0);
25     }
26     @@ -1265,7 +1265,7 @@
27     * error. Use the error() routine but do not count
28     * any errors. Remove in 2.5.
29     */
30     - int save_errors = errors;
31     + int save_errors = error_count;
32     if (!quiet && nberr == 0)
33     error("*** Unresolved symbols in %s",
34     ptmod->name);
35     @@ -1274,7 +1274,7 @@
36     nberr++;
37     if (flag_unresolved_error)
38     ret = 1;
39     - errors = save_errors;
40     + error_count = save_errors;
41     }
42     }
43     verbose("%s\n", ptmod->name + skipchars);
44     @@ -1675,6 +1675,6 @@
45     #else
46     int main(int argc, char **argv)
47     {
48     - return depmod_main(argc, argv) || errors;
49     + return depmod_main(argc, argv) || error_count;
50     }
51     #endif /* defined(COMMON_3264) && defined(ONLY_32) */
52     --- genksyms/genksyms.c
53     +++ genksyms/genksyms.c
54     @@ -45,7 +45,7 @@
55     int flag_debug, flag_dump_defs, flag_warnings;
56     int checksum_version = 1, kernel_version = version(2,0,0);
57    
58     -static int errors;
59     +static int num_errors;
60     static int nsyms;
61    
62     static struct symbol *expansion_trail;
63     @@ -458,7 +458,7 @@
64     va_end(args);
65     putc('\n', stderr);
66    
67     - errors++;
68     + num_errors++;
69     }
70     }
71    
72     @@ -476,7 +476,7 @@
73     va_end(args);
74     putc('\n', stderr);
75    
76     - errors++;
77     + num_errors++;
78     }
79     }
80    
81     @@ -597,5 +597,5 @@
82     nsyms, HASH_BUCKETS, (double)nsyms / (double)HASH_BUCKETS);
83     }
84    
85     - return errors != 0;
86     + return num_errors != 0;
87     }
88     --- include/util.h
89     +++ include/util.h
90     @@ -39,8 +39,8 @@
91     extern int xftw(const char *directory, xftw_func_t);
92    
93     /* Error logging */
94     -extern int log;
95     -extern int errors;
96     +extern int logging;
97     +extern int error_count;
98     extern const char *error_file;
99    
100     extern int flag_verbose;
101     --- insmod/insmod.c
102     +++ insmod/insmod.c
103     @@ -275,7 +275,7 @@
104     if (strncmp((char *)s->name, "GPLONLY_", 8) == 0) {
105     gplonly_seen = 1;
106     if (gpl)
107     - ((char *)s->name) += 8;
108     + s->name = ((char *)s->name) + 8;
109     else
110     continue;
111     }
112     @@ -1679,7 +1679,7 @@
113     error_file = "insmod";
114    
115     /* To handle repeated calls from combined modprobe */
116     - errors = optind = 0;
117     + error_count = optind = 0;
118    
119     /* Process the command line. */
120     while ((o = getopt_long(argc, argv, "fhkLmnpqrsSvVxXyYNe:o:O:P:R:",
121     @@ -2064,7 +2064,7 @@
122     goto out;
123     /**** No symbols or sections to be changed after kallsyms above ***/
124    
125     - if (errors)
126     + if (error_count)
127     goto out;
128    
129     /* If we were just checking, we made it. */
130     @@ -2123,10 +2123,10 @@
131     test_read.m.read_start = m_addr + sizeof(struct module);
132     test_read.m.read_end = test_read.m.read_start + sizeof(test_read.data);
133     if (sys_init_module(m_name, (struct module *) &test_read)) {
134     - int old_errors = errors;
135     + int old_errors = error_count;
136     error("has persistent data but the kernel is too old to support it."
137     " Expect errors during rmmod as well");
138     - errors = old_errors;
139     + error_count = old_errors;
140     }
141     }
142    
143     @@ -2152,7 +2152,7 @@
144     #else
145     init_module(m_name, f, m_size, blob_name, noload, flag_load_map);
146     #endif
147     - if (errors) {
148     + if (error_count) {
149     if (!noload)
150     delete_module(m_name);
151     goto out;
152     --- insmod/kallsyms.c
153     +++ insmod/kallsyms.c
154     @@ -80,7 +80,7 @@
155     error_file = "kallsyms";
156    
157     /* To handle repeated calls from combined modprobe */
158     - errors = optind = 0;
159     + error_count = optind = 0;
160    
161     /* Process the command line. */
162     while ((c = getopt_long(argc, argv, "Vh",
163     --- insmod/modprobe.c
164     +++ insmod/modprobe.c
165     @@ -1023,7 +1023,7 @@
166     if (quiet)
167     my_argv[my_argc++] = "-q";
168    
169     - if (log)
170     + if (logging)
171     my_argv[my_argc++] = "-s";
172    
173     if (insmod_opt) {
174     --- insmod/rmmod.c
175     +++ insmod/rmmod.c
176     @@ -261,9 +261,9 @@
177     read_parm.m.read_start = mp->sym->value;
178     read_parm.m.read_end = read_parm.m.read_start + datasize;
179     if (sys_init_module(module, (struct module *) &read_parm)) {
180     - int old_errors = errors;
181     + int old_errors = error_count;
182     error("has persistent data but the kernel is too old to support it.");
183     - errors = old_errors;
184     + error_count = old_errors;
185     return(0);
186     }
187    
188     --- util/logger.c
189     +++ util/logger.c
190     @@ -31,10 +31,10 @@
191    
192     /*======================================================================*/
193    
194     -int log;
195     +int logging;
196     static int silent;
197    
198     -int errors;
199     +int error_count;
200     const char *error_file;
201     const char *program_name;
202    
203     @@ -75,7 +75,7 @@
204    
205     if (silent)
206     ;
207     - else if (log) {
208     + else if (logging) {
209     char buf[2*PATH_MAX];
210     int n;
211    
212     @@ -100,7 +100,7 @@
213     putc('\n', stderr);
214     }
215    
216     - errors++;
217     + error_count++;
218     }
219    
220     void lprintf(const char *fmt,...)
221     @@ -108,7 +108,7 @@
222     va_list args;
223    
224     if (silent);
225     - else if (log) {
226     + else if (logging) {
227     char buf[2*PATH_MAX];
228     va_start(args, fmt);
229     vsnprintf(buf, sizeof(buf), fmt, args);
230     @@ -132,5 +132,5 @@
231     #ifdef STOREMSG
232     atexit(dumpmsg);
233     #endif
234     - log = 1;
235     + logging = 1;
236     }
237     --- obj/obj_kallsyms.c
238     +++ obj/obj_kallsyms.c
239     @@ -200,8 +200,8 @@
240    
241     /* Initial contents, header + one entry per input section. No strings. */
242     osec->header.sh_size = sizeof(*a_hdr) + loaded*sizeof(*a_sec);
243     - a_hdr = (struct kallsyms_header *) osec->contents =
244     - xmalloc(osec->header.sh_size);
245     + osec->contents = xmalloc(osec->header.sh_size);
246     + a_hdr = (struct kallsyms_header *) osec->contents;
247     memset(osec->contents, 0, osec->header.sh_size);
248     a_hdr->size = sizeof(*a_hdr);
249     a_hdr->sections = loaded;
250     @@ -275,8 +275,8 @@
251     a_hdr->symbol_off +
252     a_hdr->symbols*a_hdr->symbol_size +
253     strings_size - strings_left;
254     - a_hdr = (struct kallsyms_header *) osec->contents =
255     - xrealloc(a_hdr, a_hdr->total_size);
256     + osec->contents = xrealloc(a_hdr, a_hdr->total_size);
257     + a_hdr = (struct kallsyms_header *) osec->contents;
258     p = (char *)a_hdr + a_hdr->symbol_off;
259     memcpy(p, symbols, a_hdr->symbols*a_hdr->symbol_size);
260     free(symbols);
261     --- obj/obj_ppc.c
262     +++ obj/obj_ppc.c
263     @@ -25,6 +25,7 @@
264     #include <obj.h>
265     #include <util.h>
266     #include <assert.h>
267     +#include <stdlib.h>
268    
269    
270     /*======================================================================*/
271     @@ -255,7 +256,8 @@
272     archdata_sec->header.sh_size = 0;
273     sec = obj_find_section(f, "__ftr_fixup");
274     if (sec) {
275     - ad = (struct archdata *) (archdata_sec->contents) = xmalloc(sizeof(*ad));
276     + archdata_sec->contents = xmalloc(sizeof(*ad));
277     + ad = (struct archdata *) (archdata_sec->contents);
278     memset(ad, 0, sizeof(*ad));
279     archdata_sec->header.sh_size = sizeof(*ad);
280     ad->__start___ftr_fixup = sec->header.sh_addr;