# --- ROCK-COPYRIGHT-NOTE-BEGIN --- # # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # Please add additional copyright information _after_ the line containing # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by # the ./scripts/Create-CopyPatch script. Do not edit this copyright text! # # ROCK Linux: rock-src/package/base/modutils/gcc40.patch # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf # # This patch file is dual-licensed. It is available under the license the # patched project is licensed under, as long as it is an OpenSource license # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms # of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # # --- ROCK-COPYRIGHT-NOTE-END --- GCC 4.0.2 complains about depmod.c, insmod.c, obj_kallsyms.c: invalid lvalue in assignment genksyms.c: static declaration of error follows non-static declaration, previous declaration in ../include/util.h Stefan Fiedler diff -dur modutils-2.4.27/depmod/depmod.c src.modutils.1129663106.24148.1818346198/modutils-2.4.27/depmod/depmod.c --- modutils-2.4.27/depmod/depmod.c 2003-03-23 03:34:28.000000000 +0100 +++ src.modutils.1129663106.24148.1818346198/modutils-2.4.27/depmod/depmod.c 2005-10-18 21:44:54.000000000 +0200 @@ -1132,8 +1132,10 @@ return -1; for (ksym = ksyms; so_far < nksyms; ++so_far, ksym++) { - if (strncmp((char *)ksym->name, "GPLONLY_", 8) == 0) - ((char *)ksym->name) += 8; + if (strncmp((char *)ksym->name, "GPLONLY_", 8) == 0) { + char *charptr = ((char *)ksym->name) + 8; + ksym->name = charptr; + }; assert(n_syms < MAX_MAP_SYM); symtab[n_syms++] = addsym((char *)ksym->name, mod, SYM_DEFINED, 0); } diff -dur modutils-2.4.27/genksyms/genksyms.c src.modutils.1129663106.24148.1818346198/modutils-2.4.27/genksyms/genksyms.c --- modutils-2.4.27/genksyms/genksyms.c 2002-03-01 01:39:06.000000000 +0100 +++ src.modutils.1129663106.24148.1818346198/modutils-2.4.27/genksyms/genksyms.c 2005-10-18 21:41:47.000000000 +0200 @@ -45,7 +45,7 @@ int flag_debug, flag_dump_defs, flag_warnings; int checksum_version = 1, kernel_version = version(2,0,0); -static int errors; +int errors; static int nsyms; static struct symbol *expansion_trail; diff -dur modutils-2.4.27/insmod/insmod.c src.modutils.1129663106.24148.1818346198/modutils-2.4.27/insmod/insmod.c --- modutils-2.4.27/insmod/insmod.c 2003-10-27 03:34:46.000000000 +0100 +++ src.modutils.1129663106.24148.1818346198/modutils-2.4.27/insmod/insmod.c 2005-10-18 21:44:14.000000000 +0200 @@ -274,8 +274,10 @@ */ if (strncmp((char *)s->name, "GPLONLY_", 8) == 0) { gplonly_seen = 1; - if (gpl) - ((char *)s->name) += 8; + if (gpl) { + char *charptr = ((char *)s->name) + 8; + s->name = charptr; + } else continue; } diff -dur modutils-2.4.27/obj/obj_kallsyms.c src.modutils.1129663106.24148.1818346198/modutils-2.4.27/obj/obj_kallsyms.c --- modutils-2.4.27/obj/obj_kallsyms.c 2002-03-01 01:39:06.000000000 +0100 +++ src.modutils.1129663106.24148.1818346198/modutils-2.4.27/obj/obj_kallsyms.c 2005-10-18 21:24:22.000000000 +0200 @@ -200,8 +200,9 @@ /* Initial contents, header + one entry per input section. No strings. */ osec->header.sh_size = sizeof(*a_hdr) + loaded*sizeof(*a_sec); - a_hdr = (struct kallsyms_header *) osec->contents = - xmalloc(osec->header.sh_size); + osec->contents = xmalloc(osec->header.sh_size); + a_hdr = (struct kallsyms_header *) osec->contents; + memset(osec->contents, 0, osec->header.sh_size); a_hdr->size = sizeof(*a_hdr); a_hdr->sections = loaded; @@ -275,8 +276,8 @@ a_hdr->symbol_off + a_hdr->symbols*a_hdr->symbol_size + strings_size - strings_left; - a_hdr = (struct kallsyms_header *) osec->contents = - xrealloc(a_hdr, a_hdr->total_size); + osec->contents = xrealloc(a_hdr, a_hdr->total_size); + a_hdr = (struct kallsyms_header *) osec->contents; p = (char *)a_hdr + a_hdr->symbol_off; memcpy(p, symbols, a_hdr->symbols*a_hdr->symbol_size); free(symbols);