* 2.6.0-test4-mm5: SCSI imm driver doesn't compile [not found] <20030902231812.03fae13f.akpm@osdl.org> @ 2003-09-03 17:02 ` Adrian Bunk 2003-09-04 13:30 ` Arnaldo Carvalho de Melo 2003-09-04 22:19 ` 2.6-test4: mpspec.h:6:25: mach_mpspec.h: Missing file John Donnelly 0 siblings, 2 replies; 9+ messages in thread From: Adrian Bunk @ 2003-09-03 17:02 UTC (permalink / raw) To: Andrew Morton, Arnaldo Carvalho de Melo Cc: linux-kernel, campbell, linux-scsi The following compile error (tested with gcc 2.95) seems to come from Linus' tree: <-- snip --> ... CC [M] drivers/scsi/imm.o In file included from drivers/scsi/imm.c:55: drivers/scsi/imm.h:105: duplicate array index in initializer drivers/scsi/imm.h:105: (near initialization for `IMM_MODE_STRING') make[2]: *** [drivers/scsi/imm.o] Error 1 <-- snip --> The problem is the following code in imm.h (with CONFIG_SCSI_IZIP_EPP16 enabled): <-- snip --> ... static char *IMM_MODE_STRING[] = { [IMM_AUTODETECT] = "Autodetect", [IMM_NIBBLE] = "SPP", [IMM_PS2] = "PS/2", [IMM_EPP_8] = "EPP 8 bit", [IMM_EPP_16] = "EPP 16 bit", #ifdef CONFIG_SCSI_IZIP_EPP16 [IMM_EPP_16] = "EPP 16 bit", #else [IMM_EPP_32] = "EPP 32 bit", #endif [IMM_UNKNOWN] = "Unknown", }; ... <-- snip --> cu Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said. Pearl S. Buck - Dragon Seed ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 2.6.0-test4-mm5: SCSI imm driver doesn't compile 2003-09-03 17:02 ` 2.6.0-test4-mm5: SCSI imm driver doesn't compile Adrian Bunk @ 2003-09-04 13:30 ` Arnaldo Carvalho de Melo 2003-09-04 13:52 ` Jan-Benedict Glaw 2003-09-04 17:50 ` [new patch] " Adrian Bunk 2003-09-04 22:19 ` 2.6-test4: mpspec.h:6:25: mach_mpspec.h: Missing file John Donnelly 1 sibling, 2 replies; 9+ messages in thread From: Arnaldo Carvalho de Melo @ 2003-09-04 13:30 UTC (permalink / raw) To: Adrian Bunk; +Cc: Andrew Morton, linux-kernel, campbell, linux-scsi Em Wed, Sep 03, 2003 at 07:02:56PM +0200, Adrian Bunk escreveu: > The following compile error (tested with gcc 2.95) seems to come from > Linus' tree: > > <-- snip --> > > ... > CC [M] drivers/scsi/imm.o > In file included from drivers/scsi/imm.c:55: > drivers/scsi/imm.h:105: duplicate array index in initializer > drivers/scsi/imm.h:105: (near initialization for `IMM_MODE_STRING') > make[2]: *** [drivers/scsi/imm.o] Error 1 > > <-- snip --> > > The problem is the following code in imm.h (with > CONFIG_SCSI_IZIP_EPP16 enabled): > > <-- snip --> > > ... > static char *IMM_MODE_STRING[] = > { > [IMM_AUTODETECT] = "Autodetect", > [IMM_NIBBLE] = "SPP", > [IMM_PS2] = "PS/2", > [IMM_EPP_8] = "EPP 8 bit", > [IMM_EPP_16] = "EPP 16 bit", > #ifdef CONFIG_SCSI_IZIP_EPP16 > [IMM_EPP_16] = "EPP 16 bit", > #else > [IMM_EPP_32] = "EPP 32 bit", > #endif > [IMM_UNKNOWN] = "Unknown", > }; > ... > > <-- snip --> Original code was: static char *IMM_MODE_STRING[] = { "Autodetect", "SPP", "PS/2", "EPP 8 bit", "EPP 16 bit", #ifdef CONFIG_SCSI_IZIP_EPP16 "EPP 16 bit", #else "EPP 32 bit", #endif "Unknown"}; I just converted it to the more safe c99 init style, but haven't noticed the original bug, that is "EPP 16 bit" was duplicated... But this is already fixed by Andrew Morton on current Linus bk tree. Thanks Andrew for fixing, Adrian for noticing. - Arnaldo ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 2.6.0-test4-mm5: SCSI imm driver doesn't compile 2003-09-04 13:30 ` Arnaldo Carvalho de Melo @ 2003-09-04 13:52 ` Jan-Benedict Glaw 2003-09-04 14:30 ` Christoph Hellwig 2003-09-04 17:50 ` [new patch] " Adrian Bunk 1 sibling, 1 reply; 9+ messages in thread From: Jan-Benedict Glaw @ 2003-09-04 13:52 UTC (permalink / raw) To: linux-kernel, linux-scsi Cc: Arnaldo Carvalho de Melo, Adrian Bunk, Andrew Morton, campbell [-- Attachment #1: Type: text/plain, Size: 807 bytes --] On Thu, 2003-09-04 10:30:56 -0300, Arnaldo Carvalho de Melo <acme@conectiva.com.br> wrote in message <20030904133056.GA2411@conectiva.com.br>: > Em Wed, Sep 03, 2003 at 07:02:56PM +0200, Adrian Bunk escreveu: > > The following compile error (tested with gcc 2.95) seems to come from > > Linus' tree: > > I just converted it to the more safe c99 init style, but haven't noticed C99 style is .element = initializer, not [element] = initializer, which is a GNU/GCCism. MfG, JBG -- Jan-Benedict Glaw jbglaw@lug-owl.de . +49-172-7608481 "Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg fuer einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! ret = do_actions((curr | FREE_SPEECH) & ~(IRAQ_WAR_2 | DRM | TCPA)); [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 2.6.0-test4-mm5: SCSI imm driver doesn't compile 2003-09-04 13:52 ` Jan-Benedict Glaw @ 2003-09-04 14:30 ` Christoph Hellwig 2003-09-04 14:54 ` Jan-Benedict Glaw 0 siblings, 1 reply; 9+ messages in thread From: Christoph Hellwig @ 2003-09-04 14:30 UTC (permalink / raw) To: linux-kernel, linux-scsi, Arnaldo Carvalho de Melo, Adrian Bunk, Andrew Morton, campbell On Thu, Sep 04, 2003 at 03:52:56PM +0200, Jan-Benedict Glaw wrote: > C99 style is > > .element = initializer, > > not > [element] = initializer, > > which is a GNU/GCCism. We're talking about arrays here.. .element obviously never works for arrays and [constant] never works for structs.. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 2.6.0-test4-mm5: SCSI imm driver doesn't compile 2003-09-04 14:30 ` Christoph Hellwig @ 2003-09-04 14:54 ` Jan-Benedict Glaw 0 siblings, 0 replies; 9+ messages in thread From: Jan-Benedict Glaw @ 2003-09-04 14:54 UTC (permalink / raw) To: linux-kernel, linux-scsi Cc: Christoph Hellwig, Arnaldo Carvalho de Melo, Adrian Bunk, Andrew Morton, campbell [-- Attachment #1: Type: text/plain, Size: 738 bytes --] On Thu, 2003-09-04 15:30:23 +0100, Christoph Hellwig <hch@infradead.org> wrote in message <20030904153023.A32549@infradead.org>: > On Thu, Sep 04, 2003 at 03:52:56PM +0200, Jan-Benedict Glaw wrote: > > C99 style is > > > > .element = initializer, > > > > not > > [element] = initializer, > > > > which is a GNU/GCCism. > > We're talking about arrays here.. *plonk* I stand corrected... I'm sorry... MfG, JBG -- Jan-Benedict Glaw jbglaw@lug-owl.de . +49-172-7608481 "Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg fuer einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! ret = do_actions((curr | FREE_SPEECH) & ~(IRAQ_WAR_2 | DRM | TCPA)); [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* [new patch] Re: 2.6.0-test4-mm5: SCSI imm driver doesn't compile 2003-09-04 13:30 ` Arnaldo Carvalho de Melo 2003-09-04 13:52 ` Jan-Benedict Glaw @ 2003-09-04 17:50 ` Adrian Bunk 1 sibling, 0 replies; 9+ messages in thread From: Adrian Bunk @ 2003-09-04 17:50 UTC (permalink / raw) To: Arnaldo Carvalho de Melo, Andrew Morton, linux-kernel, campbell, linux-scsi On Thu, Sep 04, 2003 at 10:30:56AM -0300, Arnaldo Carvalho de Melo wrote: >... > I just converted it to the more safe c99 init style, but haven't noticed > the original bug, that is "EPP 16 bit" was duplicated... But this is already > fixed by Andrew Morton on current Linus bk tree. > > Thanks Andrew for fixing, Adrian for noticing. Andrews patch removed the first IMM_EPP_16 line in the array. This isn't correct especially in the !CONFIG_SCSI_IZIP_EPP16 case, reading all uses of this array (IMM_MODE_STRING is used to print the corresponding string in printks). If I'm not misunderstanding it, CONFIG_SCSI_IZIP_EPP16 means "use 16bit even when 32bit is requested". It seems the right solution is static char *IMM_MODE_STRING[] = { [IMM_AUTODETECT] = "Autodetect", [IMM_NIBBLE] = "SPP", [IMM_PS2] = "PS/2", [IMM_EPP_8] = "EPP 8 bit", [IMM_EPP_16] = "EPP 16 bit", #ifdef CONFIG_SCSI_IZIP_EPP16 [IMM_EPP_32] = "EPP 16 bit", #else [IMM_EPP_32] = "EPP 32 bit", #endif [IMM_UNKNOWN] = "Unknown", }; A patch against the current BK tree is below. > - Arnaldo cu Adrian --- linux-2.6.0-test4/drivers/scsi/imm.h.old 2003-09-04 19:47:23.000000000 +0200 +++ linux-2.6.0-test4/drivers/scsi/imm.h 2003-09-04 19:48:05.000000000 +0200 @@ -100,8 +100,9 @@ [IMM_NIBBLE] = "SPP", [IMM_PS2] = "PS/2", [IMM_EPP_8] = "EPP 8 bit", -#ifdef CONFIG_SCSI_IZIP_EPP16 [IMM_EPP_16] = "EPP 16 bit", +#ifdef CONFIG_SCSI_IZIP_EPP16 + [IMM_EPP_32] = "EPP 16 bit", #else [IMM_EPP_32] = "EPP 32 bit", #endif ^ permalink raw reply [flat|nested] 9+ messages in thread
* 2.6-test4: mpspec.h:6:25: mach_mpspec.h: Missing file 2003-09-03 17:02 ` 2.6.0-test4-mm5: SCSI imm driver doesn't compile Adrian Bunk 2003-09-04 13:30 ` Arnaldo Carvalho de Melo @ 2003-09-04 22:19 ` John Donnelly 2003-09-05 14:02 ` Matthew Wilcox 1 sibling, 1 reply; 9+ messages in thread From: John Donnelly @ 2003-09-04 22:19 UTC (permalink / raw) To: linux-scsi [-- Attachment #1: Type: text/plain, Size: 719 bytes --] Hi. I'm trying to build a (add-on) module on a machine booted from a 2.6-test4 kernel, And keep running into this error. I've included the gcc command line, sample and the fatal error that mach_mpspec.h can't be found. I built the kernel as : make defconfig; It is a 2W SMP (Compaq ML850) 2 modes to select enet & SCSI device make My general question is, should I include the -I/work/src/<build>/include/asm-i386/mach-generic/mach_mpspec.h in my gcc command line or is my build area incorrect is some way that the correct mpspec.h file can't be found ? Thx. JD. __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com [-- Attachment #2: test.txt --] [-- Type: text/plain, Size: 1336 bytes --] In file included from /work/src/linux-2.6.0-test4/include/asm/smp.h:18, from /work/src/linux-2.6.0-test4/include/linux/smp.h:17, from /work/src/linux-2.6.0-test4/include/linux/topology.h:33, from /work/src/linux-2.6.0-test4/include/linux/mmzone.h:294, from /work/src/linux-2.6.0-test4/include/linux/gfp.h:4, from /work/src/linux-2.6.0-test4/include/linux/slab.h:15, from test.c:8: /work/src/linux-2.6.0-test4/include/asm/mpspec.h:6:25: mach_mpspec.h: No such file or directory /work/src/linux-2.6.0-test4/include/asm/mpspec.h:8: `MAX_MP_BUSSES' undeclared here (not in a function) gcc -g -D__KERNEL__ -DMODULE -I/work/src/linux-2.6.0-test4/include \ -I/work/src/linux-2.6.0-test4/drivers/scsi -c test.c // -- snip sample #include <linux/version.h> // 2.6 ++ #include <linux/config.h> // 2.6 ++ #include <linux/kernel.h> #include <linux/types.h> #include <linux/spinlock.h> #include <asm/io.h> #include <asm/system.h> #include <linux/slab.h> #include <linux/interrupt.h> #define MEMORY_TABLE_SIZE 512 void * my_kmalloc(unsigned int size, char *id) { char *ptr ; if ((ptr = kmalloc(size, (in_interrupt()? GFP_ATOMIC : GFP_KERNEL))) == NULL) { kprintf("Cannot allocate %u bytes for %s\n", size, id); } } ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 2.6-test4: mpspec.h:6:25: mach_mpspec.h: Missing file 2003-09-04 22:19 ` 2.6-test4: mpspec.h:6:25: mach_mpspec.h: Missing file John Donnelly @ 2003-09-05 14:02 ` Matthew Wilcox 2003-09-05 17:12 ` 2.6-test4: " jd 0 siblings, 1 reply; 9+ messages in thread From: Matthew Wilcox @ 2003-09-05 14:02 UTC (permalink / raw) To: John Donnelly; +Cc: linux-scsi On Thu, Sep 04, 2003 at 03:19:27PM -0700, John Donnelly wrote: > I'm trying to build a (add-on) module > on a machine booted from a 2.6-test4 kernel, > And keep running into this error. I've > included the gcc command line, sample > and the fatal error that mach_mpspec.h can't be found. I think you'd be much better off integrating your code into the tree as a drivers/scsi/ subdirectory; see how little Makefile code has to be written for (eg) sym53c8xx_2/ > My general question is, should I include the > > -I/work/src/<build>/include/asm-i386/mach-generic/mach_mpspec.h > > in my gcc command line or is my build area incorrect > is > some way that the correct mpspec.h file can't be found ? There are many bits of the 2.6 build system that work differently from 2.4, see below.. > In file included from /work/src/linux-2.6.0-test4/include/asm/smp.h:18, > from /work/src/linux-2.6.0-test4/include/linux/smp.h:17, > from /work/src/linux-2.6.0-test4/include/linux/topology.h:33, > from /work/src/linux-2.6.0-test4/include/linux/mmzone.h:294, > from /work/src/linux-2.6.0-test4/include/linux/gfp.h:4, > from /work/src/linux-2.6.0-test4/include/linux/slab.h:15, > from test.c:8: > /work/src/linux-2.6.0-test4/include/asm/mpspec.h:6:25: mach_mpspec.h: No such file or directory > /work/src/linux-2.6.0-test4/include/asm/mpspec.h:8: `MAX_MP_BUSSES' undeclared here (not in a function) > > gcc -g -D__KERNEL__ -DMODULE -I/work/src/linux-2.6.0-test4/include \ > -I/work/src/linux-2.6.0-test4/drivers/scsi -c test.c Here's the command line for a normal file (as compiled on my laptop, your tree will no doubt use subtly diffeent options. Use `make V=1' to see the verbose output from make) gcc -Wp,-MD,mm/.fadvise.o.d -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=k6 -Iinclude/asm-i386/mach-default -D__KERNEL__ -Iinclude -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=k6 -Iinclude/asm-i386/mach-default -fomit-frame-pointer -nostdinc -iwithprefix include -DKBUILD_BASENAME=fadvise -DKBUILD_MODNAME=fadvise -c -o mm/fadvise.o mm/fadvise.c For building outside the tree, I guess you wouldn't need some of it, but I think your problem is caused by missing -Iinclude/asm-i386/mach-default But build inside the tree. You're going to want to do that eventually anyway and it saves you from this problem and several like it. -- "It's not Hollywood. War is real, war is primarily not about defeat or victory, it is about death. I've seen thousands and thousands of dead bodies. Do you think I want to have an academic debate on this subject?" -- Robert Fisk ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 2.6-test4: mach_mpspec.h: Missing file 2003-09-05 14:02 ` Matthew Wilcox @ 2003-09-05 17:12 ` jd 0 siblings, 0 replies; 9+ messages in thread From: jd @ 2003-09-05 17:12 UTC (permalink / raw) To: Matthew Wilcox; +Cc: linux-scsi --- Matthew Wilcox <willy@debian.org> wrote: > On Thu, Sep 04, 2003 at 03:19:27PM -0700, John Donnelly wrote: > > I'm trying to build a (add-on) module > > on a machine booted from a 2.6-test4 kernel, > > And keep running into this error. I've > > included the gcc command line, sample > > and the fatal error that mach_mpspec.h can't be found. > > I think you'd be much better off integrating your code into the tree > as > a drivers/scsi/ subdirectory; see how little Makefile code has to be > written for (eg) sym53c8xx_2/ I tryed it and my first attempt failed , so it looks to be easlier to debug a module built problem and other things outside first. I'll take a look that Makefile ( when in doubt -- borrow ;) ) > > > My general question is, should I include the > > > > -I/work/src/<build>/include/asm-i386/mach-generic/mach_mpspec.h > > > > in my gcc command line or is my build area incorrect > > is > > some way that the correct mpspec.h file can't be found ? > > There are many bits of the 2.6 build system that work differently > from 2.4, > see below.. > > > In file included from > /work/src/linux-2.6.0-test4/include/asm/smp.h:18, > > from > /work/src/linux-2.6.0-test4/include/linux/smp.h:17, > > from > /work/src/linux-2.6.0-test4/include/linux/topology.h:33, > > from > /work/src/linux-2.6.0-test4/include/linux/mmzone.h:294, > > from > /work/src/linux-2.6.0-test4/include/linux/gfp.h:4, > > from > /work/src/linux-2.6.0-test4/include/linux/slab.h:15, > > from test.c:8: > > /work/src/linux-2.6.0-test4/include/asm/mpspec.h:6:25: > mach_mpspec.h: No such file or directory > > /work/src/linux-2.6.0-test4/include/asm/mpspec.h:8: `MAX_MP_BUSSES' > undeclared here (not in a function) > > > > gcc -g -D__KERNEL__ -DMODULE -I/work/src/linux-2.6.0-test4/include > \ > > -I/work/src/linux-2.6.0-test4/drivers/scsi -c test.c > > Here's the command line for a normal file (as compiled on my laptop, > your tree will no doubt use subtly diffeent options. Use `make V=1' > to see the verbose output from make) > > gcc -Wp,-MD,mm/.fadvise.o.d -Wall -Wstrict-prototypes > -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe > -mpreferred-stack-boundary=2 -march=k6 > -Iinclude/asm-i386/mach-default -D__KERNEL__ -Iinclude -Wall > -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing > -fno-common -pipe -mpreferred-stack-boundary=2 -march=k6 > -Iinclude/asm-i386/mach-default -fomit-frame-pointer -nostdinc > -iwithprefix include -DKBUILD_BASENAME=fadvise > -DKBUILD_MODNAME=fadvise -c -o mm/fadvise.o mm/fadvise.c > > For building outside the tree, I guess you wouldn't need some of it, > but > I think your problem is caused by missing > -Iinclude/asm-i386/mach-default > > But build inside the tree. You're going to want to do that > eventually > anyway and it saves you from this problem and several like it. > The cure I found ( and as Mattew recommended ) was to include the " include/asm-i386/mach-default " directory in my search path. I can live with that. My only comments is that should the files (like mach_mpspec.h ) that co-exist in other directories by migrated to the common asm directory based on .config build options ? There are versions based on BigMem, SMP, NUMA ... etc. Or will every person attempting to build modules OUTSIDE the kernel run into this ? Once I get function module built and running I'll try migrating into the drivers/scsi tree. I'm really not very familar with getting a driver to built there so this should be a learning curve . __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2003-09-05 17:12 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20030902231812.03fae13f.akpm@osdl.org>
2003-09-03 17:02 ` 2.6.0-test4-mm5: SCSI imm driver doesn't compile Adrian Bunk
2003-09-04 13:30 ` Arnaldo Carvalho de Melo
2003-09-04 13:52 ` Jan-Benedict Glaw
2003-09-04 14:30 ` Christoph Hellwig
2003-09-04 14:54 ` Jan-Benedict Glaw
2003-09-04 17:50 ` [new patch] " Adrian Bunk
2003-09-04 22:19 ` 2.6-test4: mpspec.h:6:25: mach_mpspec.h: Missing file John Donnelly
2003-09-05 14:02 ` Matthew Wilcox
2003-09-05 17:12 ` 2.6-test4: " jd
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox