public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 2.5.3-pre1 compile error
@ 2002-01-16  0:05 John Weber
  2002-01-16  0:20 ` [PATCH] " Benjamin LaHaise
  0 siblings, 1 reply; 29+ messages in thread
From: John Weber @ 2002-01-16  0:05 UTC (permalink / raw)
  To: linux-kernel

gcc -D__KERNEL__ -I/usr/src/linux-2.5.2/include -Wall 
-Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer 
-fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 
-march=i686    -c -o read_write.o read_write.c
In file included from read_write.c:10:
/usr/src/linux-2.5.2/include/linux/file.h:25: parse error before `atomic_t'
/usr/src/linux-2.5.2/include/linux/file.h:25: warning: no semicolon at 
end of struct or union
/usr/src/linux-2.5.2/include/linux/file.h:36: parse error before `}'
/usr/src/linux-2.5.2/include/linux/file.h: In function `fcheck_files':
/usr/src/linux-2.5.2/include/linux/file.h:50: dereferencing pointer to 
incomplete type
/usr/src/linux-2.5.2/include/linux/file.h:51: dereferencing pointer to 
incomplete type
In file included from read_write.c:13:
/usr/src/linux-2.5.2/include/linux/dnotify.h: At top level:
/usr/src/linux-2.5.2/include/linux/dnotify.h:18: warning: `struct inode' 
declared inside parameter list
/usr/src/linux-2.5.2/include/linux/dnotify.h:18: warning: its scope is 
only this definition or declaration, which is probably not what you want.
/usr/src/linux-2.5.2/include/linux/dnotify.h:21: warning: `struct inode' 
declared inside parameter list
/usr/src/linux-2.5.2/include/linux/dnotify.h: In function 
`inode_dir_notify':
/usr/src/linux-2.5.2/include/linux/dnotify.h:23: dereferencing pointer 
to incomplete type
/usr/src/linux-2.5.2/include/linux/dnotify.h:24: warning: passing arg 1 
of `__inode_dir_notify' from incompatible pointer type
read_write.c: In function `sys_read':
read_write.c:167: warning: passing arg 1 of `inode_dir_notify' from 
incompatible pointer type
read_write.c: In function `sys_write':
read_write.c:194: warning: passing arg 1 of `inode_dir_notify' from 
incompatible pointer type
read_write.c: In function `do_readv_writev':
read_write.c:299: warning: passing arg 1 of `inode_dir_notify' from 
incompatible pointer type
read_write.c: In function `sys_pread':
read_write.c:371: warning: passing arg 1 of `inode_dir_notify' from 
incompatible pointer type
read_write.c: In function `sys_pwrite':
read_write.c:403: warning: passing arg 1 of `inode_dir_notify' from 
incompatible pointer type
make[2]: *** [read_write.o] Error 1
make[2]: Leaving directory `/usr/src/linux-2.5.2/fs'
make[1]: *** [first_rule] Error 2
make[1]: Leaving directory `/usr/src/linux-2.5.2/fs'
make: *** [_dir_fs] Error 2


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH] Re: 2.5.3-pre1 compile error
  2002-01-16  0:05 2.5.3-pre1 compile error John Weber
@ 2002-01-16  0:20 ` Benjamin LaHaise
  2002-01-16  0:29   ` Linus Torvalds
  0 siblings, 1 reply; 29+ messages in thread
From: Benjamin LaHaise @ 2002-01-16  0:20 UTC (permalink / raw)
  To: John Weber, Linus Torvalds; +Cc: linux-kernel

On Tue, Jan 15, 2002 at 07:05:10PM -0500, John Weber wrote:
> incompatible pointer type
> read_write.c: In function `sys_pwrite':
> read_write.c:403: warning: passing arg 1 of `inode_dir_notify' from 
> incompatible pointer type

Hmm, this should fix that.

		-ben

:r ~/patches/v2.5.3-pre1-file_fix.diff
diff -urN v2.5.3-pre1/include/linux/file.h v2.5.3-pre1-fix/include/linux/file.h
--- v2.5.3-pre1/include/linux/file.h	Tue Jan 15 19:11:11 2002
+++ v2.5.3-pre1-fix/include/linux/file.h	Tue Jan 15 19:20:06 2002
@@ -5,6 +5,9 @@
 #ifndef __LINUX_FILE_H
 #define __LINUX_FILE_H
 
+#ifndef __ASM__ATOMIC_H
+#include <asm/atomic.h>
+#endif
 #ifndef _LINUX_POSIX_TYPES_H	/* __FD_CLR */
 #include <linux/posix_types.h>
 #endif

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
  2002-01-16  0:20 ` [PATCH] " Benjamin LaHaise
@ 2002-01-16  0:29   ` Linus Torvalds
  2002-01-16  0:38     ` David Weinehall
                       ` (2 more replies)
  0 siblings, 3 replies; 29+ messages in thread
From: Linus Torvalds @ 2002-01-16  0:29 UTC (permalink / raw)
  To: Benjamin LaHaise; +Cc: John Weber, linux-kernel


On Tue, 15 Jan 2002, Benjamin LaHaise wrote:
>
> Hmm, this should fix that.

probably will, BUT..

> +#ifndef __ASM__ATOMIC_H
> +#include <asm/atomic.h>
> +#endif

Please do not assume knowdledge of what the different header files use to
define their re-entrancy.

Just do

	#include <asm/atomic.h>

and be done with it.

		Linus


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
  2002-01-16  0:29   ` Linus Torvalds
@ 2002-01-16  0:38     ` David Weinehall
  2002-01-16  0:41       ` Linus Torvalds
  2002-01-16  0:43     ` Benjamin LaHaise
  2002-01-16  0:46     ` Davide Libenzi
  2 siblings, 1 reply; 29+ messages in thread
From: David Weinehall @ 2002-01-16  0:38 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Benjamin LaHaise, John Weber, linux-kernel

On Tue, Jan 15, 2002 at 04:29:38PM -0800, Linus Torvalds wrote:
> 
> On Tue, 15 Jan 2002, Benjamin LaHaise wrote:
> >
> > Hmm, this should fix that.
> 
> probably will, BUT..
> 
> > +#ifndef __ASM__ATOMIC_H
> > +#include <asm/atomic.h>
> > +#endif
> 
> Please do not assume knowdledge of what the different header files use to
> define their re-entrancy.
> 
> Just do
> 
> 	#include <asm/atomic.h>
> 
> and be done with it.

The lines below say:

#ifndef _LINUX_POSIX_TYPES_H   /* __FD_CLR */
#include <linux/posix_types.h>
#endif


Maybe fix this while at it?!


/David
  _                                                                 _
 // David Weinehall <tao@acc.umu.se> /> Northern lights wander      \\
//  Maintainer of the v2.0 kernel   //  Dance across the winter sky //
\>  http://www.acc.umu.se/~tao/    </   Full colour fire           </

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
  2002-01-16  0:38     ` David Weinehall
@ 2002-01-16  0:41       ` Linus Torvalds
  2002-01-16  0:55         ` Dave Jones
  0 siblings, 1 reply; 29+ messages in thread
From: Linus Torvalds @ 2002-01-16  0:41 UTC (permalink / raw)
  To: David Weinehall; +Cc: Benjamin LaHaise, John Weber, linux-kernel


On Wed, 16 Jan 2002, David Weinehall wrote:
> >
> > Just do
> >
> > 	#include <asm/atomic.h>
> >
> > and be done with it.
>
> The lines below say:
>
> #ifndef _LINUX_POSIX_TYPES_H   /* __FD_CLR */
> #include <linux/posix_types.h>
> #endif

At least that doesn't depend on all architectures having the same
exclusion-defines, but yeah, it's ugly too.

If this actally makes any noticeable difference to compilation speed I
could live with it. Does it?

		Linus


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
  2002-01-16  0:29   ` Linus Torvalds
  2002-01-16  0:38     ` David Weinehall
@ 2002-01-16  0:43     ` Benjamin LaHaise
  2002-01-16  0:44       ` Linus Torvalds
  2002-01-16  1:24       ` Robert Love
  2002-01-16  0:46     ` Davide Libenzi
  2 siblings, 2 replies; 29+ messages in thread
From: Benjamin LaHaise @ 2002-01-16  0:43 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: John Weber, linux-kernel

On Tue, Jan 15, 2002 at 04:29:38PM -0800, Linus Torvalds wrote:
> > +#ifndef __ASM__ATOMIC_H
> > +#include <asm/atomic.h>
> > +#endif
> 
> Please do not assume knowdledge of what the different header files use to
> define their re-entrancy.

Well, I actually disagree on this.  For large include files (fs.h is the 
worst), and complicated arrangement, this technique eliminates spurious 
includes and saves a lot on compile time (really!).  If your concern is 
that the convention is not consistent, I'll gladly patch all of them to 
use the same format (ie use an __ prefix and escape / to __ and . to _).

		-ben

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
  2002-01-16  0:46     ` Davide Libenzi
@ 2002-01-16  0:43       ` Linus Torvalds
  2002-01-16  0:52         ` David S. Miller
  2002-01-16  1:17         ` Davide Libenzi
  0 siblings, 2 replies; 29+ messages in thread
From: Linus Torvalds @ 2002-01-16  0:43 UTC (permalink / raw)
  To: Davide Libenzi; +Cc: Benjamin LaHaise, John Weber, lkml


On Tue, 15 Jan 2002, Davide Libenzi wrote:
>
> after that it builds for me ... but it crashes at boot time

Where?

The main big thing in 2.5.3-pre1 is the IDE driver update, the rest looks
fairly simple. I've tested the new IDE driver on my system (the famous
"Works For Me" test), and it's been tested quite a lot in earlier
incarnations on other platforms, but there might easily be some BIO or
low-level IDE chipset interactions.

If it's not in the IDE driver, I'm at a loss.

		Linus


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
  2002-01-16  0:43     ` Benjamin LaHaise
@ 2002-01-16  0:44       ` Linus Torvalds
  2002-01-16  0:52         ` Benjamin LaHaise
  2002-01-17 22:11         ` Christopher Turcksin
  2002-01-16  1:24       ` Robert Love
  1 sibling, 2 replies; 29+ messages in thread
From: Linus Torvalds @ 2002-01-16  0:44 UTC (permalink / raw)
  To: Benjamin LaHaise; +Cc: John Weber, linux-kernel


On Tue, 15 Jan 2002, Benjamin LaHaise wrote:
>
> Well, I actually disagree on this.  For large include files (fs.h is the
> worst), and complicated arrangement, this technique eliminates spurious
> includes and saves a lot on compile time (really!).

Numbers please.

I'd MUCH rather just clean up the include file hierarchy than have these
kinds of non-local knowledge issues.

		Linus


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
  2002-01-16  0:29   ` Linus Torvalds
  2002-01-16  0:38     ` David Weinehall
  2002-01-16  0:43     ` Benjamin LaHaise
@ 2002-01-16  0:46     ` Davide Libenzi
  2002-01-16  0:43       ` Linus Torvalds
  2 siblings, 1 reply; 29+ messages in thread
From: Davide Libenzi @ 2002-01-16  0:46 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Benjamin LaHaise, John Weber, lkml

On Tue, 15 Jan 2002, Linus Torvalds wrote:

>
> On Tue, 15 Jan 2002, Benjamin LaHaise wrote:
> >
> > Hmm, this should fix that.
>
> probably will, BUT..
>
> > +#ifndef __ASM__ATOMIC_H
> > +#include <asm/atomic.h>
> > +#endif
>
> Please do not assume knowdledge of what the different header files use to
> define their re-entrancy.
>
> Just do
>
> 	#include <asm/atomic.h>
>
> and be done with it.

I needed two fixes :

#include <asm/atomic.h> in include/linux/file.h

#include <linux/fs.h> in include/linux/dnotify.h

after that it builds for me ... but it crashes at boot time




- Davide



^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
  2002-01-16  0:44       ` Linus Torvalds
@ 2002-01-16  0:52         ` Benjamin LaHaise
  2002-01-16  1:18           ` David Weinehall
  2002-01-17 22:11         ` Christopher Turcksin
  1 sibling, 1 reply; 29+ messages in thread
From: Benjamin LaHaise @ 2002-01-16  0:52 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: John Weber, linux-kernel

On Tue, Jan 15, 2002 at 04:44:54PM -0800, Linus Torvalds wrote:
> Numbers please.
> 
> I'd MUCH rather just clean up the include file hierarchy than have these
> kinds of non-local knowledge issues.

The last time I did it for fs.h et al (this meant pulling the fs.h and 
sched.h codependancy apart), it got 2.4 compiles back down to 2.2 compile 
times (3m -> 2m45s maybe 2m30s iirc) -- about a 10% drop in compile time.  
It's even more noticeable when you're doing a fully blown modular kernel 
build as distributions do.

		-ben
-- 
Fish.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
  2002-01-16  0:43       ` Linus Torvalds
@ 2002-01-16  0:52         ` David S. Miller
  2002-01-16  1:06           ` Andre Hedrick
  2002-01-16  1:17         ` Davide Libenzi
  1 sibling, 1 reply; 29+ messages in thread
From: David S. Miller @ 2002-01-16  0:52 UTC (permalink / raw)
  To: torvalds; +Cc: davidel, bcrl, weber, linux-kernel

   From: Linus Torvalds <torvalds@transmeta.com>
   Date: Tue, 15 Jan 2002 16:43:58 -0800 (PST)
   
   If it's not in the IDE driver, I'm at a loss.

That "#if 1" buisness in the new ide-dma.c code looks
really suspicious...

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
       [not found] <20020115194425.J17477@redhat.com>
@ 2002-01-16  0:52 ` Davide Libenzi
  2002-01-16  1:16   ` David Weinehall
  0 siblings, 1 reply; 29+ messages in thread
From: Davide Libenzi @ 2002-01-16  0:52 UTC (permalink / raw)
  To: Benjamin LaHaise; +Cc: Linus Torvalds, John Weber, lkml

On Tue, 15 Jan 2002, Benjamin LaHaise wrote:

> On Tue, Jan 15, 2002 at 04:46:36PM -0800, Davide Libenzi wrote:
> > after that it builds for me ... but it crashes at boot time
>
> Config?  Arch?  Compiler?

Let me reboot with the crashing kernel for tracing ...

x86 UP Athlon gcc-3.0.3




- Davide



^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
  2002-01-16  0:41       ` Linus Torvalds
@ 2002-01-16  0:55         ` Dave Jones
  2002-01-16  2:10           ` dmeyer
  2002-01-16 18:32           ` Peter Osterlund
  0 siblings, 2 replies; 29+ messages in thread
From: Dave Jones @ 2002-01-16  0:55 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: David Weinehall, Benjamin LaHaise, John Weber, linux-kernel

On Tue, Jan 15, 2002 at 04:41:08PM -0800, Linus Torvalds wrote:
 > > #ifndef _LINUX_POSIX_TYPES_H   /* __FD_CLR */
 > > #include <linux/posix_types.h>
 > > #endif
 > If this actally makes any noticeable difference to compilation speed I
 > could live with it. Does it?

 I'm sure I read somewhere that gcc is clever enough to know
 when it hits a #include, it checks for a symbol equal to a
 mangled version of the filename before including it.
 (Ie, doing this transparently).

 Then again, I may have imagined it all.

-- 
| Dave Jones.        http://www.codemonkey.org.uk
| SuSE Labs

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
  2002-01-16  0:52         ` David S. Miller
@ 2002-01-16  1:06           ` Andre Hedrick
  0 siblings, 0 replies; 29+ messages in thread
From: Andre Hedrick @ 2002-01-16  1:06 UTC (permalink / raw)
  To: David S. Miller; +Cc: torvalds, davidel, bcrl, weber, linux-kernel


Well if you look at it closely, that function.

"ide_raw_build_sglist()"

 is not called except from the user-space diagnostics ioctl

You that is getting called with from a BIO request, there will be major
request completion problems.

That is there to allow a future "Alex Viro" suggestion be considered.


On Tue, 15 Jan 2002, David S. Miller wrote:

>    From: Linus Torvalds <torvalds@transmeta.com>
>    Date: Tue, 15 Jan 2002 16:43:58 -0800 (PST)
>    
>    If it's not in the IDE driver, I'm at a loss.
> 
> That "#if 1" buisness in the new ide-dma.c code looks
> really suspicious...

Andre Hedrick
Linux Disk Certification Project                Linux ATA Development


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
  2002-01-16  0:52 ` Davide Libenzi
@ 2002-01-16  1:16   ` David Weinehall
  2002-01-16  1:24     ` Davide Libenzi
  0 siblings, 1 reply; 29+ messages in thread
From: David Weinehall @ 2002-01-16  1:16 UTC (permalink / raw)
  To: Davide Libenzi; +Cc: Benjamin LaHaise, Linus Torvalds, John Weber, lkml

On Tue, Jan 15, 2002 at 04:52:23PM -0800, Davide Libenzi wrote:
> On Tue, 15 Jan 2002, Benjamin LaHaise wrote:
> 
> > On Tue, Jan 15, 2002 at 04:46:36PM -0800, Davide Libenzi wrote:
> > > after that it builds for me ... but it crashes at boot time
> >
> > Config?  Arch?  Compiler?
> 
> Let me reboot with the crashing kernel for tracing ...
> 
> x86 UP Athlon gcc-3.0.3

Let me suggest gcc-2.95.3 or gcc-2.96-whatever


/David Weinehall
  _                                                                 _
 // David Weinehall <tao@acc.umu.se> /> Northern lights wander      \\
//  Maintainer of the v2.0 kernel   //  Dance across the winter sky //
\>  http://www.acc.umu.se/~tao/    </   Full colour fire           </

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
  2002-01-16  0:43       ` Linus Torvalds
  2002-01-16  0:52         ` David S. Miller
@ 2002-01-16  1:17         ` Davide Libenzi
  2002-01-16  1:23           ` Davide Libenzi
  1 sibling, 1 reply; 29+ messages in thread
From: Davide Libenzi @ 2002-01-16  1:17 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Benjamin LaHaise, John Weber, lkml

On Tue, 15 Jan 2002, Linus Torvalds wrote:

>
> On Tue, 15 Jan 2002, Davide Libenzi wrote:
> >
> > after that it builds for me ... but it crashes at boot time
>
> Where?
>
> The main big thing in 2.5.3-pre1 is the IDE driver update, the rest looks
> fairly simple. I've tested the new IDE driver on my system (the famous
> "Works For Me" test), and it's been tested quite a lot in earlier
> incarnations on other platforms, but there might easily be some BIO or
> low-level IDE chipset interactions.
>
> If it's not in the IDE driver, I'm at a loss.

Doh !

Trace; c0113988 <schedule+118/2b0>
Trace; c01075cd <sys_clone+1d/30>
Trace; c0105020 <init+0/140>
Trace; c0105000 <_stext+0/0>
Trace; c010720d <kernel_thread+1d/30>
Trace; c0105011 <rest_init+11/20>

Let me try something ...




- Davide



^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
  2002-01-16  0:52         ` Benjamin LaHaise
@ 2002-01-16  1:18           ` David Weinehall
  0 siblings, 0 replies; 29+ messages in thread
From: David Weinehall @ 2002-01-16  1:18 UTC (permalink / raw)
  To: Benjamin LaHaise; +Cc: Linus Torvalds, John Weber, linux-kernel

On Tue, Jan 15, 2002 at 07:52:04PM -0500, Benjamin LaHaise wrote:
> On Tue, Jan 15, 2002 at 04:44:54PM -0800, Linus Torvalds wrote:
> > Numbers please.
> > 
> > I'd MUCH rather just clean up the include file hierarchy than have these
> > kinds of non-local knowledge issues.
> 
> The last time I did it for fs.h et al (this meant pulling the fs.h and 
> sched.h codependancy apart), it got 2.4 compiles back down to 2.2 compile 
> times (3m -> 2m45s maybe 2m30s iirc) -- about a 10% drop in compile time.  
> It's even more noticeable when you're doing a fully blown modular kernel 
> build as distributions do.

The difference between 3 minutes and 2.45 isn't really a lot imho. What
is interesting if difference scales; that is, if you compile on a 486
or so, does the 10% drop still hold, or are we still talking about a
difference of 15 seconds. If the latter, I'd go for the cleanup,
but if the former is true, maybe, just maybe, the ugly version might
be the solution.

I'd prefer all includes that can be to be non-conditional, though.


/David
  _                                                                 _
 // David Weinehall <tao@acc.umu.se> /> Northern lights wander      \\
//  Maintainer of the v2.0 kernel   //  Dance across the winter sky //
\>  http://www.acc.umu.se/~tao/    </   Full colour fire           </

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
  2002-01-16  1:17         ` Davide Libenzi
@ 2002-01-16  1:23           ` Davide Libenzi
  0 siblings, 0 replies; 29+ messages in thread
From: Davide Libenzi @ 2002-01-16  1:23 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Benjamin LaHaise, John Weber, lkml

On Tue, 15 Jan 2002, Davide Libenzi wrote:

> Doh !
>
> Trace; c0113988 <schedule+118/2b0>
> Trace; c01075cd <sys_clone+1d/30>
> Trace; c0105020 <init+0/140>
> Trace; c0105000 <_stext+0/0>
> Trace; c010720d <kernel_thread+1d/30>
> Trace; c0105011 <rest_init+11/20>
>
> Let me try something ...

Ehmmm, let's do like if nothing happened :-)




- Davide



^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
  2002-01-16  0:43     ` Benjamin LaHaise
  2002-01-16  0:44       ` Linus Torvalds
@ 2002-01-16  1:24       ` Robert Love
  2002-01-16  1:25         ` Benjamin LaHaise
  1 sibling, 1 reply; 29+ messages in thread
From: Robert Love @ 2002-01-16  1:24 UTC (permalink / raw)
  To: Benjamin LaHaise; +Cc: Linus Torvalds, linux-kernel

On Tue, 2002-01-15 at 19:43, Benjamin LaHaise wrote:
> +#ifndef __ASM__ATOMIC_H
> +#include <asm/atomic.h>
> +#endif

gcc -D__KERNEL__ -I/home/rml/src/linux/linux/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=athlon     -c -o brlock.o brlock.c
brlock.c:21: initializer element is not constant
brlock.c:21: (near initialization for `__brlock_array[0][0]')
... for all the [x][y] elements ...
brlock.c:21: initializer element is not constant
brlock.c:21: (near initialization for `__brlock_array[31]')

I get this compile error under 2.5.3-pre1, too.  System is SMP.  2.5.2
worked fine.  I don't see a thing in the patch that would cause this ...

	Robert Love


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
  2002-01-16  1:16   ` David Weinehall
@ 2002-01-16  1:24     ` Davide Libenzi
  0 siblings, 0 replies; 29+ messages in thread
From: Davide Libenzi @ 2002-01-16  1:24 UTC (permalink / raw)
  To: David Weinehall; +Cc: Benjamin LaHaise, Linus Torvalds, John Weber, lkml

On Wed, 16 Jan 2002, David Weinehall wrote:

> On Tue, Jan 15, 2002 at 04:52:23PM -0800, Davide Libenzi wrote:
> > On Tue, 15 Jan 2002, Benjamin LaHaise wrote:
> >
> > > On Tue, Jan 15, 2002 at 04:46:36PM -0800, Davide Libenzi wrote:
> > > > after that it builds for me ... but it crashes at boot time
> > >
> > > Config?  Arch?  Compiler?
> >
> > Let me reboot with the crashing kernel for tracing ...
> >
> > x86 UP Athlon gcc-3.0.3
>
> Let me suggest gcc-2.95.3 or gcc-2.96-whatever

No you should suggest me to check my code :-)




- Davide



^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
  2002-01-16  1:24       ` Robert Love
@ 2002-01-16  1:25         ` Benjamin LaHaise
  2002-01-16  1:39           ` Robert Love
  0 siblings, 1 reply; 29+ messages in thread
From: Benjamin LaHaise @ 2002-01-16  1:25 UTC (permalink / raw)
  To: Robert Love; +Cc: Linus Torvalds, linux-kernel

On Tue, Jan 15, 2002 at 08:24:22PM -0500, Robert Love wrote:
> I get this compile error under 2.5.3-pre1, too.  System is SMP.  2.5.2
> worked fine.  I don't see a thing in the patch that would cause this ...

Uh, brlock.c probably should be including threads.h...

-- 
Fish.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
  2002-01-16  1:25         ` Benjamin LaHaise
@ 2002-01-16  1:39           ` Robert Love
  0 siblings, 0 replies; 29+ messages in thread
From: Robert Love @ 2002-01-16  1:39 UTC (permalink / raw)
  To: Benjamin LaHaise; +Cc: Linus Torvalds, linux-kernel

On Tue, 2002-01-15 at 20:25, Benjamin LaHaise wrote:

> Uh, brlock.c probably should be including threads.h...

lib/brlock.c includes include/linux/sched.h which includes
include/linux/threads.h ...

	Robert Love


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
  2002-01-16  0:55         ` Dave Jones
@ 2002-01-16  2:10           ` dmeyer
  2002-01-16 18:32           ` Peter Osterlund
  1 sibling, 0 replies; 29+ messages in thread
From: dmeyer @ 2002-01-16  2:10 UTC (permalink / raw)
  To: linux-kernel

In article <20020116015513.L32088@suse.de> you write:
> On Tue, Jan 15, 2002 at 04:41:08PM -0800, Linus Torvalds wrote:
>  > > #ifndef _LINUX_POSIX_TYPES_H   /* __FD_CLR */
>  > > #include <linux/posix_types.h>
>  > > #endif
>  > If this actally makes any noticeable difference to compilation speed I
>  > could live with it. Does it?
> 
>  I'm sure I read somewhere that gcc is clever enough to know
>  when it hits a #include, it checks for a symbol equal to a
>  mangled version of the filename before including it.
>  (Ie, doing this transparently).
> 
>  Then again, I may have imagined it all.

I'm pretty sure you did, since it's perfectly legal (and occasionally
useful, if gruesome) to do

#define THE_STRUCT struct1
#include "struct_def.h"
#undef THE_STRUCT
#define THE_STRUCT struct2
#include "struct_def.h"

and have both #includes work.  You may be thinking of #import, which
is deprecated except for objective-c, IIRC.

In answer to Linus' question...yes, in a large system redundent
include guards can make a real difference, particularly for headers
which get included by other headers regularly.  OTOH, my last
experience using them was on an underpowered Solaris box, which (a)
didn't have enough memory for all the developers compiling on it and
(b) was running an old Solaris, so its read caching was pretty lame
anyway.  It makes rather a lot of difference if the preprocessor has
to read <linux/posix_types.h> from the disk 20 times or if it can get
it from the file cache 20 times.

-- 
Dave Meyer
dmeyer@dmeyer.net

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
       [not found] ` <fa.g97h3fv.968725@ifi.uio.no>
@ 2002-01-16  4:59   ` Russ Allbery
  0 siblings, 0 replies; 29+ messages in thread
From: Russ Allbery @ 2002-01-16  4:59 UTC (permalink / raw)
  To: linux-kernel

dmeyer <dmeyer@dmeyer.net> writes:
> In article <20020116015513.L32088@suse.de> you write:

>>  I'm sure I read somewhere that gcc is clever enough to know when it
>>  hits a #include, it checks for a symbol equal to a mangled version of
>>  the filename before including it.  (Ie, doing this transparently).

>>  Then again, I may have imagined it all.

No, you read that gcc notices when the entirety of a source file is
wrapped in an #ifdef guard and won't re-read that file when it's included
again if the symbol is defined.

> In answer to Linus' question...yes, in a large system redundent include
> guards can make a real difference, particularly for headers which get
> included by other headers regularly.

Yes, but you don't need to put them around the #include.  Just make sure
there is nothing but comments outside the multiple inclusion guards in the
header files and any competent compiler will do the right thing.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
       [not found] ` <Pine.LNX.4.33.0201151628440.1140-100000@penguin.transmeta.com.suse.lists.linux.kernel>
@ 2002-01-16 11:27   ` Andi Kleen
  2002-01-16 11:39     ` Dave Jones
  0 siblings, 1 reply; 29+ messages in thread
From: Andi Kleen @ 2002-01-16 11:27 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, bcrl

Linus Torvalds <torvalds@transmeta.com> writes:
> 
> > +#ifndef __ASM__ATOMIC_H
> > +#include <asm/atomic.h>
> > +#endif
> 
> Please do not assume knowdledge of what the different header files use to
> define their re-entrancy.
> 
> Just do
> 
> 	#include <asm/atomic.h>
> 
> and be done with it.

The first check is done automatically by the gcc preprocessor 
anyways (it has a special check for the #ifndef BLA_H #define BLA_H #endif
construct for whole files and doesn't even bother to open them again on a 
second include). So it's completely unnecessary. 

Someone added some of these useless checks to 2.5.3pre1. Here is a patch
to remove them. Please consider applying.

--- linux-2.5.3pre1/include/linux/file.h-o	Wed Jan 16 12:24:09 2002
+++ linux-2.5.3pre1/include/linux/file.h	Wed Jan 16 12:25:10 2002
@@ -5,12 +5,8 @@
 #ifndef __LINUX_FILE_H
 #define __LINUX_FILE_H
 
-#ifndef _LINUX_POSIX_TYPES_H	/* __FD_CLR */
 #include <linux/posix_types.h>
-#endif
-#ifndef __LINUX_COMPILER_H	/* unlikely */
 #include <linux/compiler.h>
-#endif
 
 /*
  * The default fd array needs to be at least BITS_PER_LONG,
--- linux-2.5.3pre1/include/linux/init_task.h-o	Wed Jan 16 12:24:09 2002
+++ linux-2.5.3pre1/include/linux/init_task.h	Wed Jan 16 12:25:27 2002
@@ -1,9 +1,7 @@
 #ifndef _LINUX__INIT_TASK_H
 #define _LINUX__INIT_TASK_H
 
-#ifndef __LINUX_FILE_H
 #include <linux/file.h>
-#endif
 
 #define INIT_FILES \
 { 							\


-Andi

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
  2002-01-16 11:27   ` Andi Kleen
@ 2002-01-16 11:39     ` Dave Jones
  2002-01-17  7:40       ` Neil Booth
  0 siblings, 1 reply; 29+ messages in thread
From: Dave Jones @ 2002-01-16 11:39 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Linus Torvalds, linux-kernel, bcrl

On 16 Jan 2002, Andi Kleen wrote:

> The first check is done automatically by the gcc preprocessor
> anyways (it has a special check for the #ifndef BLA_H #define BLA_H #endif
> construct for whole files and doesn't even bother to open them again on a
> second include). So it's completely unnecessary.

Ahah! I knew I didn't imagine it. Either that or we've both had the same
hallucination. 8-)

-- 
| Dave Jones.        http://www.codemonkey.org.uk
| SuSE Labs


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
  2002-01-16  0:55         ` Dave Jones
  2002-01-16  2:10           ` dmeyer
@ 2002-01-16 18:32           ` Peter Osterlund
  1 sibling, 0 replies; 29+ messages in thread
From: Peter Osterlund @ 2002-01-16 18:32 UTC (permalink / raw)
  To: Dave Jones
  Cc: Linus Torvalds, David Weinehall, Benjamin LaHaise, John Weber,
	linux-kernel

Dave Jones <davej@suse.de> writes:

> On Tue, Jan 15, 2002 at 04:41:08PM -0800, Linus Torvalds wrote:
>  > > #ifndef _LINUX_POSIX_TYPES_H   /* __FD_CLR */
>  > > #include <linux/posix_types.h>
>  > > #endif
>  > If this actally makes any noticeable difference to compilation speed I
>  > could live with it. Does it?
> 
>  I'm sure I read somewhere that gcc is clever enough to know
>  when it hits a #include, it checks for a symbol equal to a
>  mangled version of the filename before including it.
>  (Ie, doing this transparently).
> 
>  Then again, I may have imagined it all.

Not exactly, but there is an optimization in cpp that makes it
possible to do the cleanup Linus wants without sacrificing
performance. From the cpp info pages:

        The GNU C preprocessor is programmed to notice when a header
        file uses this particular construct and handle it efficiently.
        If a header file is contained entirely in a `#ifndef'
        conditional, modulo whitespace and comments, then it remembers
        that fact.  If a subsequent `#include' specifies the same
        file, and the macro in the `#ifndef' is already defined, then
        the directive is skipped without processing the specified file
        at all.

I did an strace on cpp to verify that this optimization actually
works.

-- 
Peter Osterlund - petero2@telia.com
http://w1.894.telia.com/~u89404340

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
  2002-01-16 11:39     ` Dave Jones
@ 2002-01-17  7:40       ` Neil Booth
  0 siblings, 0 replies; 29+ messages in thread
From: Neil Booth @ 2002-01-17  7:40 UTC (permalink / raw)
  To: Dave Jones; +Cc: Andi Kleen, Linus Torvalds, linux-kernel, bcrl

Dave Jones wrote:-

> On 16 Jan 2002, Andi Kleen wrote:
> 
> > The first check is done automatically by the gcc preprocessor
> > anyways (it has a special check for the #ifndef BLA_H #define BLA_H #endif
> > construct for whole files and doesn't even bother to open them again on a
> > second include). So it's completely unnecessary.
> 
> Ahah! I knew I didn't imagine it. Either that or we've both had the same
> hallucination. 8-)

I told you over a beer, so maybe you were hallucinating 8^)

Neil.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Re: 2.5.3-pre1 compile error
  2002-01-16  0:44       ` Linus Torvalds
  2002-01-16  0:52         ` Benjamin LaHaise
@ 2002-01-17 22:11         ` Christopher Turcksin
  1 sibling, 0 replies; 29+ messages in thread
From: Christopher Turcksin @ 2002-01-17 22:11 UTC (permalink / raw)
  To: linux-kernel; +Cc: Linus Torvalds

Linus Torvalds wrote:

> > Well, I actually disagree on this.  For large include files (fs.h is the
> > worst), and complicated arrangement, this technique eliminates spurious
> > includes and saves a lot on compile time (really!).
> 
> Numbers please.

The GNU C preprocessor remembers if an include file was completely
inside an #ifndef/#endif conditional (modulo whitespace and comments)
and will skip the #include for the same file if the macro in #ifndef is
already defined. I suspect putting guards around the include will not
save any more time.

bfn,
Christopher Turcksin <turcksin@uk.ibm.com>

IBM Global Services

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2002-01-17 22:16 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-16  0:05 2.5.3-pre1 compile error John Weber
2002-01-16  0:20 ` [PATCH] " Benjamin LaHaise
2002-01-16  0:29   ` Linus Torvalds
2002-01-16  0:38     ` David Weinehall
2002-01-16  0:41       ` Linus Torvalds
2002-01-16  0:55         ` Dave Jones
2002-01-16  2:10           ` dmeyer
2002-01-16 18:32           ` Peter Osterlund
2002-01-16  0:43     ` Benjamin LaHaise
2002-01-16  0:44       ` Linus Torvalds
2002-01-16  0:52         ` Benjamin LaHaise
2002-01-16  1:18           ` David Weinehall
2002-01-17 22:11         ` Christopher Turcksin
2002-01-16  1:24       ` Robert Love
2002-01-16  1:25         ` Benjamin LaHaise
2002-01-16  1:39           ` Robert Love
2002-01-16  0:46     ` Davide Libenzi
2002-01-16  0:43       ` Linus Torvalds
2002-01-16  0:52         ` David S. Miller
2002-01-16  1:06           ` Andre Hedrick
2002-01-16  1:17         ` Davide Libenzi
2002-01-16  1:23           ` Davide Libenzi
     [not found] <20020115194425.J17477@redhat.com>
2002-01-16  0:52 ` Davide Libenzi
2002-01-16  1:16   ` David Weinehall
2002-01-16  1:24     ` Davide Libenzi
     [not found] <fa.oa9ld7v.gk65b0@ifi.uio.no>
     [not found] ` <fa.g97h3fv.968725@ifi.uio.no>
2002-01-16  4:59   ` Russ Allbery
     [not found] <20020115192048.G17477@redhat.com.suse.lists.linux.kernel>
     [not found] ` <Pine.LNX.4.33.0201151628440.1140-100000@penguin.transmeta.com.suse.lists.linux.kernel>
2002-01-16 11:27   ` Andi Kleen
2002-01-16 11:39     ` Dave Jones
2002-01-17  7:40       ` Neil Booth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox