* [PATCH] asm-i386 : config.h should not be included out of kernel
@ 2005-12-06 20:26 Olivier MATZ
2005-12-06 21:11 ` Arnd Bergmann
0 siblings, 1 reply; 9+ messages in thread
From: Olivier MATZ @ 2005-12-06 20:26 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 484 bytes --]
Hi,
It seems that in include/asm-i386/param.h the "#include
<linux/config.h>" should be inside the #ifdef __KERNEL__, as it is done
in asm-ia64.
Some applications cannot compile/work correctly whithout this patch. For
example busybox defines for itself CONFIG_TR (related to the tr
program), which is unfortunately undefined when including sys/param.h,
which includes linux/config.h (CONFIG_TR is the config for token ring).
Can you consider the following patch ?
Thanks,
Olivier
[-- Attachment #2: asm-i386_dont_include_config.diff --]
[-- Type: text/plain, Size: 566 bytes --]
--- linux-2.6.14.3.orig/include/asm-i386/param.h 2005-12-06 14:13:15.000000000 +0100
+++ linux-2.6.14.3/include/asm-i386/param.h 2005-12-06 13:51:12.000000000 +0100
@@ -1,9 +1,9 @@
-#include <linux/config.h>
-
#ifndef _ASMi386_PARAM_H
#define _ASMi386_PARAM_H
#ifdef __KERNEL__
+#include <linux/config.h> /* mustn't include <linux/config.h> outside of #ifdef __KERNEL__ */
+
# define HZ CONFIG_HZ /* Internal kernel timer frequency */
# define USER_HZ 100 /* .. some user interfaces are in "ticks" */
# define CLOCKS_PER_SEC (USER_HZ) /* like times() */
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] asm-i386 : config.h should not be included out of kernel
2005-12-06 20:26 [PATCH] asm-i386 : config.h should not be included out of kernel Olivier MATZ
@ 2005-12-06 21:11 ` Arnd Bergmann
2005-12-07 17:28 ` Olivier MATZ
0 siblings, 1 reply; 9+ messages in thread
From: Arnd Bergmann @ 2005-12-06 21:11 UTC (permalink / raw)
To: Olivier MATZ; +Cc: linux-kernel
Am Dienstag 06 Dezember 2005 21:26 schrieb Olivier MATZ:
> @@ -1,9 +1,9 @@
> -#include <linux/config.h>
> -
> #ifndef _ASMi386_PARAM_H
> #define _ASMi386_PARAM_H
>
> #ifdef __KERNEL__
> +#include <linux/config.h> /* mustn't include <linux/config.h> outside of
> #ifdef __KERNEL__ */ +
Just drop that line completely, including linux/config.h is no longer
necessary.
Arnd <><
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] asm-i386 : config.h should not be included out of kernel
2005-12-06 21:11 ` Arnd Bergmann
@ 2005-12-07 17:28 ` Olivier MATZ
2005-12-07 19:10 ` Sam Ravnborg
0 siblings, 1 reply; 9+ messages in thread
From: Olivier MATZ @ 2005-12-07 17:28 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linux-kernel
Hi,
> Just drop that line completely, including linux/config.h is no longer
> necessary.
You're right, including linux/config.h is not necessary because every
file that includes asm/param.h also includes the linux/config.h directly
or indirectly.
But in my opinion, as we use CONFIG_HERTZ in param.h, we should keep the
include of config.h.
Olivier
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] asm-i386 : config.h should not be included out of kernel
2005-12-07 17:28 ` Olivier MATZ
@ 2005-12-07 19:10 ` Sam Ravnborg
2005-12-07 20:02 ` Andrew Walrond
2005-12-07 20:09 ` Olivier MATZ
0 siblings, 2 replies; 9+ messages in thread
From: Sam Ravnborg @ 2005-12-07 19:10 UTC (permalink / raw)
To: Olivier MATZ; +Cc: Arnd Bergmann, linux-kernel
On Wed, Dec 07, 2005 at 06:28:53PM +0100, Olivier MATZ wrote:
>
> But in my opinion, as we use CONFIG_HERTZ in param.h, we should keep the
> include of config.h.
If you look at the commandline passed to gcc you will notice -include
include/linux/autoconf.h which tell gcc to pull in autoconf.h.
So it is no longer required to include config.h.
Sam
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] asm-i386 : config.h should not be included out of kernel
2005-12-07 19:10 ` Sam Ravnborg
@ 2005-12-07 20:02 ` Andrew Walrond
2005-12-07 20:09 ` Olivier MATZ
1 sibling, 0 replies; 9+ messages in thread
From: Andrew Walrond @ 2005-12-07 20:02 UTC (permalink / raw)
To: linux-kernel
On Wednesday 07 December 2005 19:10, Sam Ravnborg wrote:
> On Wed, Dec 07, 2005 at 06:28:53PM +0100, Olivier MATZ wrote:
> > But in my opinion, as we use CONFIG_HERTZ in param.h, we should keep the
> > include of config.h.
>
> If you look at the commandline passed to gcc you will notice -include
> include/linux/autoconf.h which tell gcc to pull in autoconf.h.
> So it is no longer required to include config.h.
>
Is it the intention for the real kernel headers to be used by userland apps,
and for linux-libc-headers et-al to be deprecated?
If so, how far down this road are we? I tested a few things recently, out of
interest;
- recent glibc builds fine with real 2.6.14.2 headers
- x11 cvs won't build without real kernel headers
- net-tools will only build with sanitized headers
Andrew Walrond
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] asm-i386 : config.h should not be included out of kernel
2005-12-07 19:10 ` Sam Ravnborg
2005-12-07 20:02 ` Andrew Walrond
@ 2005-12-07 20:09 ` Olivier MATZ
2005-12-07 21:32 ` Sam Ravnborg
1 sibling, 1 reply; 9+ messages in thread
From: Olivier MATZ @ 2005-12-07 20:09 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: Arnd Bergmann, linux-kernel
Hi Sam,
> If you look at the commandline passed to gcc you will notice -include
> include/linux/autoconf.h which tell gcc to pull in autoconf.h.
> So it is no longer required to include config.h.
I'm not sure. On my 2.6.14.3, this is a compilation line :
gcc -m32 -Wp,-MD,kernel/.sys.o.d -nostdinc -isystem
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/include -D__KERNEL__ -Iinclude
-Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing
-fno-common -ffreestanding -Os -fno-omit-frame-pointer
-fno-optimize-sibling-calls -g -pipe -msoft-float
-mpreferred-stack-boundary=2 -march=i686 -mregparm=3
-Iinclude/asm-i386/mach-default -DKBUILD_BASENAME=sys
-DKBUILD_MODNAME=sys -c -o kernel/.tmp_sys.o kernel/sys.c
Moreover, if I try to compile a C file which only define a variable and
assign it to a CONFIG_XXX, it doesn't work. Did I do something wrong ?
Olivier
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] asm-i386 : config.h should not be included out of kernel
2005-12-07 20:09 ` Olivier MATZ
@ 2005-12-07 21:32 ` Sam Ravnborg
2005-12-08 11:33 ` Olivier MATZ
0 siblings, 1 reply; 9+ messages in thread
From: Sam Ravnborg @ 2005-12-07 21:32 UTC (permalink / raw)
To: Olivier MATZ; +Cc: Arnd Bergmann, linux-kernel
On Wed, Dec 07, 2005 at 09:09:50PM +0100, Olivier MATZ wrote:
> Hi Sam,
>
> > If you look at the commandline passed to gcc you will notice -include
> > include/linux/autoconf.h which tell gcc to pull in autoconf.h.
> > So it is no longer required to include config.h.
>
> I'm not sure. On my 2.6.14.3, this is a compilation line
Ok, I was speaking on the 2.6.15-rc kernels. I was added when 2.6.15
opened up and will first appear in a 'relased' kernel as of 2.6.15.
> Moreover, if I try to compile a C file which only define a variable and
> assign it to a CONFIG_XXX, it doesn't work. Did I do something wrong ?
I do not get what you tried and what did not work.
Sam
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] asm-i386 : config.h should not be included out of kernel
2005-12-07 21:32 ` Sam Ravnborg
@ 2005-12-08 11:33 ` Olivier MATZ
2005-12-08 17:39 ` Sam Ravnborg
0 siblings, 1 reply; 9+ messages in thread
From: Olivier MATZ @ 2005-12-08 11:33 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: Arnd Bergmann, linux-kernel
Hi,
>>>If you look at the commandline passed to gcc you will notice -include
>>>include/linux/autoconf.h which tell gcc to pull in autoconf.h.
>>>So it is no longer required to include config.h.
>>
>>I'm not sure. On my 2.6.14.3, this is a compilation line
>
> Ok, I was speaking on the 2.6.15-rc kernels. I was added when 2.6.15
> opened up and will first appear in a 'relased' kernel as of 2.6.15.
I have one more question about dependancies : in 2.6.15-rc, if we modify
the config, do we have to recompile everything ?
Olivier
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] asm-i386 : config.h should not be included out of kernel
2005-12-08 11:33 ` Olivier MATZ
@ 2005-12-08 17:39 ` Sam Ravnborg
0 siblings, 0 replies; 9+ messages in thread
From: Sam Ravnborg @ 2005-12-08 17:39 UTC (permalink / raw)
To: Olivier MATZ; +Cc: Arnd Bergmann, linux-kernel
On Thu, Dec 08, 2005 at 12:33:19PM +0100, Olivier MATZ wrote:
> I have one more question about dependancies : in 2.6.15-rc, if we modify
> the config, do we have to recompile everything ?
No, kbuild will rebuild only what is necessary. That may be a lot,
or it may be only very limited. Depending on what symbol you change.
Sam
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2005-12-08 17:38 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-06 20:26 [PATCH] asm-i386 : config.h should not be included out of kernel Olivier MATZ
2005-12-06 21:11 ` Arnd Bergmann
2005-12-07 17:28 ` Olivier MATZ
2005-12-07 19:10 ` Sam Ravnborg
2005-12-07 20:02 ` Andrew Walrond
2005-12-07 20:09 ` Olivier MATZ
2005-12-07 21:32 ` Sam Ravnborg
2005-12-08 11:33 ` Olivier MATZ
2005-12-08 17:39 ` Sam Ravnborg
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.