linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Module compilation
@ 2004-10-20 14:36 Richard B. Johnson
  2004-10-20 14:49 ` David Woodhouse
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Richard B. Johnson @ 2004-10-20 14:36 UTC (permalink / raw)
  To: Linux kernel



In Makefiles for compiling modules before the new
kernel build procedure, we would just build up
a gcc command-line with the correct parameters
and definitions, i.e. :

CC = gcc -Wall -O2 -etc -etc

DEFINES = -DMODULE -D__KERNEL__ -DONE=1 -DTWO=2 -DETC=etc

CC += $(DEFINES)

In this manner, one could dynamically change definitions
(-DEFINES) being passed to the compiler. The problem is
that the new compile procedure doesn't allow this. It
is possible to 'cheat' and add a string to CFLAGS like

CFLAGS += -DONE=1 -DTWO=2 -DETC=etc

...but it's not CFLAGS that needs to be modified, it's
a named variable that doesn't exist yet, perhaps "USERDEF",
or "DEFINES". I see that the normal "defines" is a constant 
called "CHECKFLAGS", so this isn't appropriate for user
modification.

Could whomever remade the kernel Makefile, please add
a variable, initially set to "", like CFLAGS_KERNEL, that
is exported and is always included on the compiler command-
line?


Cheers,
Dick Johnson
Penguin : Linux version 2.6.9 on an i686 machine (5537.79 GrumpyMips).
                  98.36% of all statistics are fiction.

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

* Re: Module compilation
  2004-10-20 14:36 Module compilation Richard B. Johnson
@ 2004-10-20 14:49 ` David Woodhouse
  2004-10-20 15:01   ` Richard B. Johnson
  2004-10-20 14:59 ` Ian Campbell
  2004-10-21 20:15 ` Sam Ravnborg
  2 siblings, 1 reply; 8+ messages in thread
From: David Woodhouse @ 2004-10-20 14:49 UTC (permalink / raw)
  To: root; +Cc: Linux kernel

On Wed, 2004-10-20 at 10:36 -0400, Richard B. Johnson wrote:
> Could whomever remade the kernel Makefile, please add
> a variable, initially set to "", like CFLAGS_KERNEL, that
> is exported and is always included on the compiler command-
> line?

EXTRA_CFLAGS

-- 
dwmw2



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

* Re: Module compilation
  2004-10-20 14:36 Module compilation Richard B. Johnson
  2004-10-20 14:49 ` David Woodhouse
@ 2004-10-20 14:59 ` Ian Campbell
  2004-10-20 15:06   ` Richard B. Johnson
  2004-10-21 20:15 ` Sam Ravnborg
  2 siblings, 1 reply; 8+ messages in thread
From: Ian Campbell @ 2004-10-20 14:59 UTC (permalink / raw)
  To: root; +Cc: Linux kernel

On Wed, 2004-10-20 at 15:36, Richard B. Johnson wrote:

> Could whomever remade the kernel Makefile, please add
> a variable, initially set to "", like CFLAGS_KERNEL, that
> is exported and is always included on the compiler command-
> line?

Does the existing EXTRA_CFLAGS do what you want?

I believe you can also set CFLAGS_blah.o if you just want extra stuff
for a single file.

Ian.

-- 
Ian Campbell, Senior Design Engineer
                                        Web: http://www.arcom.com
Arcom, Clifton Road, 			Direct: +44 (0)1223 403 465
Cambridge CB1 7EA, United Kingdom	Phone:  +44 (0)1223 411 200


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

* Re: Module compilation
  2004-10-20 14:49 ` David Woodhouse
@ 2004-10-20 15:01   ` Richard B. Johnson
  0 siblings, 0 replies; 8+ messages in thread
From: Richard B. Johnson @ 2004-10-20 15:01 UTC (permalink / raw)
  To: David Woodhouse; +Cc: Linux kernel

On Wed, 20 Oct 2004, David Woodhouse wrote:

> On Wed, 2004-10-20 at 10:36 -0400, Richard B. Johnson wrote:
>> Could whomever remade the kernel Makefile, please add
>> a variable, initially set to "", like CFLAGS_KERNEL, that
>> is exported and is always included on the compiler command-
>> line?
>
> EXTRA_CFLAGS
>
> -- 
> dwmw2

Okay. I'll use that, even though it's not a "CFLAGS"! Apparently
that's what I'm supposed to us.

Cheers,
Dick Johnson
Penguin : Linux version 2.6.9 on an i686 machine (5537.79 GrumpyMips).
                  98.36% of all statistics are fiction.

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

* Re: Module compilation
  2004-10-20 14:59 ` Ian Campbell
@ 2004-10-20 15:06   ` Richard B. Johnson
  0 siblings, 0 replies; 8+ messages in thread
From: Richard B. Johnson @ 2004-10-20 15:06 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Linux kernel

On Wed, 20 Oct 2004, Ian Campbell wrote:

> On Wed, 2004-10-20 at 15:36, Richard B. Johnson wrote:
>
>> Could whomever remade the kernel Makefile, please add
>> a variable, initially set to "", like CFLAGS_KERNEL, that
>> is exported and is always included on the compiler command-
>> line?
>
> Does the existing EXTRA_CFLAGS do what you want?
>

Well it's exported and gets on the command-line, but it's
not a "CFLAG" I want, but a definition to be passed to
the compiler. Using EXTRA_CFLAGS is no different than
using CFLAGS which, for a human readable implicit
documentation perspective, is incorrect (not a compiler flag).

> I believe you can also set CFLAGS_blah.o if you just want extra stuff
> for a single file.
>
> Ian.
>
> -- 
> Ian Campbell, Senior Design Engineer
>                                        Web: http://www.arcom.com
> Arcom, Clifton Road, 			Direct: +44 (0)1223 403 465
> Cambridge CB1 7EA, United Kingdom	Phone:  +44 (0)1223 411 200
>

Cheers,
Dick Johnson
Penguin : Linux version 2.6.9 on an i686 machine (5537.79 GrumpyMips).
                  98.36% of all statistics are fiction.

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

* Re: Module compilation
  2004-10-21 20:15 ` Sam Ravnborg
@ 2004-10-21 18:21   ` Richard B. Johnson
  2004-10-22  2:54     ` Herbert Poetzl
  0 siblings, 1 reply; 8+ messages in thread
From: Richard B. Johnson @ 2004-10-21 18:21 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Linux kernel

On Thu, 21 Oct 2004, Sam Ravnborg wrote:

> On Wed, Oct 20, 2004 at 10:36:00AM -0400, Richard B. Johnson wrote>
>> ...but it's not CFLAGS that needs to be modified, it's
>> a named variable that doesn't exist yet, perhaps "USERDEF",
>> or "DEFINES".
>
> Reading the above I cannot what amkes you say that EXTRA_CFLAGS
> or CFLAGS_module.o cannot be used?
> Is it the name you do not like or is it some fnctionality
> you are missing?
>

The name is wrong! There are zillions of ways to obtain the
functionality. Currently we need to piggy-back definitions
onto compiler flags.

Compiler flags are things like "-Wall" and "-O2", that tell
the compiler what to do. We need a name to use for definitions,
"-Dxxx", that #define constants (dynamically at compile-time)
in the code. Right now, -DMODULE and -D__KERNEL__ are piggybacked
onto CFLAGS. There really should be a variable called something
else like DEFINES and it should be exported.

>> I see that the normal "defines" is a constant
>> called "CHECKFLAGS", so this isn't appropriate for user
>> modification.
> CHECKFLAGS is only used when you use "make C=1" - to pass options
> to sparse.
>
> 	Sam
>

Cheers,
Dick Johnson
Penguin : Linux version 2.6.9 on an i686 machine (5537.79 GrumpyMips).
                  98.36% of all statistics are fiction.

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

* Re: Module compilation
  2004-10-20 14:36 Module compilation Richard B. Johnson
  2004-10-20 14:49 ` David Woodhouse
  2004-10-20 14:59 ` Ian Campbell
@ 2004-10-21 20:15 ` Sam Ravnborg
  2004-10-21 18:21   ` Richard B. Johnson
  2 siblings, 1 reply; 8+ messages in thread
From: Sam Ravnborg @ 2004-10-21 20:15 UTC (permalink / raw)
  To: Richard B. Johnson; +Cc: Linux kernel

On Wed, Oct 20, 2004 at 10:36:00AM -0400, Richard B. Johnson wrote> 
> ...but it's not CFLAGS that needs to be modified, it's
> a named variable that doesn't exist yet, perhaps "USERDEF",
> or "DEFINES".

Reading the above I cannot what amkes you say that EXTRA_CFLAGS
or CFLAGS_module.o cannot be used?
Is it the name you do not like or is it some fnctionality
you are missing?

>I see that the normal "defines" is a constant 
> called "CHECKFLAGS", so this isn't appropriate for user
> modification.
CHECKFLAGS is only used when you use "make C=1" - to pass options
to sparse.

	Sam

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

* Re: Module compilation
  2004-10-21 18:21   ` Richard B. Johnson
@ 2004-10-22  2:54     ` Herbert Poetzl
  0 siblings, 0 replies; 8+ messages in thread
From: Herbert Poetzl @ 2004-10-22  2:54 UTC (permalink / raw)
  To: Richard B. Johnson; +Cc: Sam Ravnborg, Linux kernel

On Thu, Oct 21, 2004 at 02:21:25PM -0400, Richard B. Johnson wrote:
> On Thu, 21 Oct 2004, Sam Ravnborg wrote:
> 
> >On Wed, Oct 20, 2004 at 10:36:00AM -0400, Richard B. Johnson wrote>
> >>...but it's not CFLAGS that needs to be modified, it's
> >>a named variable that doesn't exist yet, perhaps "USERDEF",
> >>or "DEFINES".
> >
> >Reading the above I cannot what amkes you say that EXTRA_CFLAGS
> >or CFLAGS_module.o cannot be used?
> >Is it the name you do not like or is it some fnctionality
> >you are missing?
> >
> 
> The name is wrong! There are zillions of ways to obtain the
> functionality. Currently we need to piggy-back definitions
> onto compiler flags.
> 
> Compiler flags are things like "-Wall" and "-O2", that tell
> the compiler what to do. We need a name to use for definitions,
> "-Dxxx", that #define constants (dynamically at compile-time)
> in the code. Right now, -DMODULE and -D__KERNEL__ are piggybacked
> onto CFLAGS. There really should be a variable called something
> else like DEFINES and it should be exported.

hmm, the man page for gcc states that

 -Dmacro 	is a preprocessor option, where
 -Wall 		is a compiler option, and
 -O2 		is an optimization option

but, all of those are options to the cpp/gcc
toolchain (or gcc compiler if you like), so
it sounds natural to me to put it there ...
(i.e. CFLAGS*)

best,
Herbert

> >>I see that the normal "defines" is a constant
> >>called "CHECKFLAGS", so this isn't appropriate for user
> >>modification.
> >CHECKFLAGS is only used when you use "make C=1" - to pass options
> >to sparse.
> >
> >	Sam
> >
> 
> Cheers,
> Dick Johnson
> Penguin : Linux version 2.6.9 on an i686 machine (5537.79 GrumpyMips).
>                  98.36% of all statistics are fiction.
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

end of thread, other threads:[~2004-10-22  3:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-20 14:36 Module compilation Richard B. Johnson
2004-10-20 14:49 ` David Woodhouse
2004-10-20 15:01   ` Richard B. Johnson
2004-10-20 14:59 ` Ian Campbell
2004-10-20 15:06   ` Richard B. Johnson
2004-10-21 20:15 ` Sam Ravnborg
2004-10-21 18:21   ` Richard B. Johnson
2004-10-22  2:54     ` Herbert Poetzl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).