From ff08974850158f4c4d815840f7c3e82a4aa12c34 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Wed, 11 Aug 2004 01:42:56 +0200 Subject: kbuild: Replace host-progs with hostprogs-y Signed-off-by: Sam Ravnborg --- scripts/mod/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/mod') diff --git a/scripts/mod/Makefile b/scripts/mod/Makefile index f66bf5262aae..11d69c35e5b4 100644 --- a/scripts/mod/Makefile +++ b/scripts/mod/Makefile @@ -1,5 +1,5 @@ -host-progs := modpost mk_elfconfig -always := $(host-progs) empty.o +hostprogs-y := modpost mk_elfconfig +always := $(hostprogs-y) empty.o modpost-objs := modpost.o file2alias.o sumversion.o -- cgit v1.2.3 From e78d165503d0dfefeed18f48f722f4bf4ad79014 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Wed, 11 Aug 2004 02:11:50 +0200 Subject: kbuild: Use POSIX headers for ntoh functions From: Benno When compiling Linux on Mac OSX I had trouble with scripts/sumversion.c. It includes to obtain to definitions of htonl and ntohl. On Mac OSX these are found in . After checking the POSIX specification it appears that this is the correct place to get the definitons for these functions. (http://www.opengroup.org/onlinepubs/009695399/functions/htonl.html) Using this header also appears to work on Linux (at least with Glibc-2.3.2). It seems clearer to me to go with the POSIX standard than implementing #if __APPLE__ style macros, but if such an approach is preferred I can supply patches for that instead. Signed-off-by: Sam Ravnborg --- scripts/basic/fixdep.c | 2 +- scripts/mod/sumversion.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/mod') diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index 8bd6442229cf..9c03a6673aad 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c @@ -104,7 +104,7 @@ #include #include #include -#include +#include #define INT_CONF ntohl(0x434f4e46) #define INT_ONFI ntohl(0x4f4e4649) diff --git a/scripts/mod/sumversion.c b/scripts/mod/sumversion.c index b41b718edffe..631430d09e4d 100644 --- a/scripts/mod/sumversion.c +++ b/scripts/mod/sumversion.c @@ -1,4 +1,4 @@ -#include +#include #include #include #include -- cgit v1.2.3 From 8f36d53f6f2b3a5758a0b6f894d76051cf94403c Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Sun, 15 Aug 2004 15:54:27 +0200 Subject: kbuild: Bogus "has no CRC" in external module builds From: Pavel Roskin The recent fixes for the external module build have fixed the major breakage, but they left one annoyance unfixed. If CONFIG_MODVERSIONS is disabled, a warning is printed for every exported symbol that is has no CRC. For instance, I see this when compiling the standalone Orinoco driver on Linux 2.6.6-rc3: *** Warning: "__orinoco_down" [/usr/local/src/orinoco/spectrum_cs.ko] has no CRC! *** Warning: "hermes_struct_init" [/usr/local/src/orinoco/spectrum_cs.ko] has no CRC! *** Warning: "free_orinocodev" [/usr/local/src/orinoco/spectrum_cs.ko] has no CRC! [further warnings skipped] I have found that the "-i" option for modpost is used for external builds, whereas the internal modules use "-o". The "-i" option causes read_dump() in modpost.c to be called. This function sets "modversions" variable under some conditions that I don't understand. The comment before the modversions declarations says: "Are we using CONFIG_MODVERSIONS?" Apparently modpost fails to answer this question. I think it's better to use an explicit option rather than a kludge. The attached patch adds a new option "-m" that is specified if and only if CONFIG_MODVERSIONS is enabled. The patch has been successfully tested both with and without CONFIG_MODVERSIONS. Signed-off-by: Sam Ravnborg --- scripts/Makefile.modpost | 3 ++- scripts/mod/modpost.c | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'scripts/mod') diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index 19f5345279ac..c5d201f660c9 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -50,7 +50,8 @@ _modpost: $(modules) # Step 2), invoke modpost # Includes step 3,4 quiet_cmd_modpost = MODPOST - cmd_modpost = scripts/mod/modpost \ + cmd_modpost = scripts/mod/modpost \ + $(if $(CONFIG_MODVERSIONS),-m) \ $(if $(KBUILD_EXTMOD),-i,-o) $(symverfile) \ $(filter-out FORCE,$^) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 662e75b2f780..65072d76a101 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -343,7 +343,6 @@ handle_modversions(struct module *mod, struct elf_info *info, crc = (unsigned int) sym->st_value; add_exported_symbol(symname + strlen(CRC_PFX), mod, &crc); - modversions = 1; } break; case SHN_UNDEF: @@ -649,7 +648,6 @@ read_dump(const char *fname) if (!(mod = find_module(modname))) { if (is_vmlinux(modname)) { - modversions = 1; have_vmlinux = 1; } mod = new_module(NOFAIL(strdup(modname))); @@ -696,11 +694,14 @@ main(int argc, char **argv) char *dump_read = NULL, *dump_write = NULL; int opt; - while ((opt = getopt(argc, argv, "i:o:")) != -1) { + while ((opt = getopt(argc, argv, "i:mo:")) != -1) { switch(opt) { case 'i': dump_read = optarg; break; + case 'm': + modversions = 1; + break; case 'o': dump_write = optarg; break; -- cgit v1.2.3