linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to do -nostdinc?
@ 2002-12-15 12:06 Keith Owens
  2002-12-15 13:47 ` Marius Gedminas
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Keith Owens @ 2002-12-15 12:06 UTC (permalink / raw)
  To: linux-kernel

There are two ways of setting the -nostdinc flag in the kernel Makefile :-

(1) -nostdinc $(shell $(CC) -print-search-dirs | sed -ne 's/install: \(.*\)/-I \1include/gp')
(2) -nostdinc -iwithprefix include

The first format breaks with non-English locales, however the fix is trivial.

(1a) -nostdinc $(shell LANG=C $(CC) -print-search-dirs | sed -ne 's/install: \(.*\)/-I \1include/gp')

The second format is simpler but there have been reports that it does
not work with some versions of gcc.  I have been unable to find a
definitive statement about which versions of gcc fail and whether the
problem has been fixed.  Anybody care to provide a definitive
statement?

If kernel build cannot rely on gcc working with -nostdinc -iwithprefix include
then we need to convert to (1a).


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

* Re: How to do -nostdinc?
  2002-12-15 12:06 How to do -nostdinc? Keith Owens
@ 2002-12-15 13:47 ` Marius Gedminas
  2002-12-15 15:11 ` Russell King
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Marius Gedminas @ 2002-12-15 13:47 UTC (permalink / raw)
  To: linux-kernel

On Sun, Dec 15, 2002 at 11:06:41PM +1100, Keith Owens wrote:
> There are two ways of setting the -nostdinc flag in the kernel Makefile :-
> 
> (1) -nostdinc $(shell $(CC) -print-search-dirs | sed -ne 's/install: \(.*\)/-I \1include/gp')
> (2) -nostdinc -iwithprefix include
> 
> The first format breaks with non-English locales, however the fix is trivial.
> 
> (1a) -nostdinc $(shell LANG=C $(CC) -print-search-dirs | sed -ne 's/install: \(.*\)/-I \1include/gp')

Wouldn't LC_ALL=C be more reliable?

Marius Gedminas
-- 
No proper program contains an indication which as an operator-applied
occurrence identifies an operator-defining occurrence which as an
indication-applied occurrence identifies an indication-defining occurrence
different from the one identified by the given indication as an
indication-applied occurrence.
                -- ALGOL 68 Report

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

* Re: How to do -nostdinc?
  2002-12-15 12:06 How to do -nostdinc? Keith Owens
  2002-12-15 13:47 ` Marius Gedminas
@ 2002-12-15 15:11 ` Russell King
  2002-12-16  0:17 ` Steffen Persvold
  2002-12-16 18:29 ` Sam Ravnborg
  3 siblings, 0 replies; 8+ messages in thread
From: Russell King @ 2002-12-15 15:11 UTC (permalink / raw)
  To: Keith Owens; +Cc: linux-kernel

On Sun, Dec 15, 2002 at 11:06:41PM +1100, Keith Owens wrote:
> The second format is simpler but there have been reports that it does
> not work with some versions of gcc.  I have been unable to find a
> definitive statement about which versions of gcc fail and whether the
> problem has been fixed.  Anybody care to provide a definitive
> statement?

When the problem appeared, it turned out to be an incorrectly configured
and/or built gcc installation.  (therefore, by definition,  not a kernel
problem.)

I believe the reporter of the problem subsequently fixed his compiler
installation.

I do, however, think we need to lobby the gcc people to get the
"depreciated" status of -iwithprefix reversed - it is a simple solution
to an otherwise disgusting amount of grep/awk/sed.

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


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

* Re: How to do -nostdinc?
  2002-12-15 12:06 How to do -nostdinc? Keith Owens
  2002-12-15 13:47 ` Marius Gedminas
  2002-12-15 15:11 ` Russell King
@ 2002-12-16  0:17 ` Steffen Persvold
  2002-12-16 18:29 ` Sam Ravnborg
  3 siblings, 0 replies; 8+ messages in thread
From: Steffen Persvold @ 2002-12-16  0:17 UTC (permalink / raw)
  To: Keith Owens; +Cc: linux-kernel

On Sun, 15 Dec 2002, Keith Owens wrote:

> There are two ways of setting the -nostdinc flag in the kernel Makefile :-
> 
> (1) -nostdinc $(shell $(CC) -print-search-dirs | sed -ne 's/install: \(.*\)/-I \1include/gp')
> (2) -nostdinc -iwithprefix include
> 
> The first format breaks with non-English locales, however the fix is trivial.
> 
> (1a) -nostdinc $(shell LANG=C $(CC) -print-search-dirs | sed -ne 's/install: \(.*\)/-I \1include/gp')
> 
> The second format is simpler but there have been reports that it does
> not work with some versions of gcc.  I have been unable to find a
> definitive statement about which versions of gcc fail and whether the
> problem has been fixed.  Anybody care to provide a definitive
> statement?
> 
> If kernel build cannot rely on gcc working with -nostdinc -iwithprefix include
> then we need to convert to (1a).

Well, it works fine with gcc-2.91.66 (egcs-1.1.2 release), gcc-2.96 (RH 
7.{1,2,3} versions), and gcc-3.2 (RH 8.0 version)

Of course there are other versions out there but 2.91 is rather old...

Regards,
-- 
  Steffen Persvold   |       Scali AS      
 mailto:sp@scali.com |  http://www.scali.com
Tel: (+47) 2262 8950 |   Olaf Helsets vei 6
Fax: (+47) 2262 8951 |   N0621 Oslo, NORWAY


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

* Re: How to do -nostdinc?
  2002-12-15 12:06 How to do -nostdinc? Keith Owens
                   ` (2 preceding siblings ...)
  2002-12-16  0:17 ` Steffen Persvold
@ 2002-12-16 18:29 ` Sam Ravnborg
  2002-12-16 21:26   ` Keith Owens
  3 siblings, 1 reply; 8+ messages in thread
From: Sam Ravnborg @ 2002-12-16 18:29 UTC (permalink / raw)
  To: Keith Owens; +Cc: linux-kernel

On Sun, Dec 15, 2002 at 11:06:41PM +1100, Keith Owens wrote:
> There are two ways of setting the -nostdinc flag in the kernel Makefile :-
> 
> (1) -nostdinc $(shell $(CC) -print-search-dirs | sed -ne 's/install: \(.*\)/-I \1include/gp')
> (2) -nostdinc -iwithprefix include
> 
> The first format breaks with non-English locales, however the fix is trivial.
> 
> (1a) -nostdinc $(shell LANG=C $(CC) -print-search-dirs | sed -ne 's/install: \(.*\)/-I \1include/gp')
> 
Hi Keith.

Based on the comments received, solution (2) seems to be OK.
Do you agree?

	Sam

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

* Re: How to do -nostdinc?
  2002-12-16 18:29 ` Sam Ravnborg
@ 2002-12-16 21:26   ` Keith Owens
  2002-12-16 22:44     ` J.A. Magallon
  2002-12-16 23:16     ` H. Peter Anvin
  0 siblings, 2 replies; 8+ messages in thread
From: Keith Owens @ 2002-12-16 21:26 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: linux-kernel

On Mon, 16 Dec 2002 19:29:19 +0100, 
Sam Ravnborg <sam@ravnborg.org> wrote:
>On Sun, Dec 15, 2002 at 11:06:41PM +1100, Keith Owens wrote:
>> There are two ways of setting the -nostdinc flag in the kernel Makefile :-
>> 
>> (1) -nostdinc $(shell $(CC) -print-search-dirs | sed -ne 's/install: \(.*\)/-I \1include/gp')
>> (2) -nostdinc -iwithprefix include
>> 
>> The first format breaks with non-English locales, however the fix is trivial.
>> 
>> (1a) -nostdinc $(shell LANG=C $(CC) -print-search-dirs | sed -ne 's/install: \(.*\)/-I \1include/gp')
>> 
>Hi Keith.
>
>Based on the comments received, solution (2) seems to be OK.
>Do you agree?

Does gcc still mark -iwithprefix as deprecated?  If it does then do not
rely on it and use (1a).  If gcc will support -iwithprefix then use (2).


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

* Re: How to do -nostdinc?
  2002-12-16 21:26   ` Keith Owens
@ 2002-12-16 22:44     ` J.A. Magallon
  2002-12-16 23:16     ` H. Peter Anvin
  1 sibling, 0 replies; 8+ messages in thread
From: J.A. Magallon @ 2002-12-16 22:44 UTC (permalink / raw)
  To: Keith Owens; +Cc: Sam Ravnborg, linux-kernel


On 2002.12.16 Keith Owens wrote:
>On Mon, 16 Dec 2002 19:29:19 +0100, 
>Sam Ravnborg <sam@ravnborg.org> wrote:
>>On Sun, Dec 15, 2002 at 11:06:41PM +1100, Keith Owens wrote:
>>> There are two ways of setting the -nostdinc flag in the kernel Makefile :-
>>> 
>>> (1) -nostdinc $(shell $(CC) -print-search-dirs | sed -ne 's/install: \(.*\)/-I \1include/gp')
>>> (2) -nostdinc -iwithprefix include
>>> 
>>> The first format breaks with non-English locales, however the fix is trivial.
>>> 
>>> (1a) -nostdinc $(shell LANG=C $(CC) -print-search-dirs | sed -ne 's/install: \(.*\)/-I \1include/gp')
>>> 
>>Hi Keith.
>>
>>Based on the comments received, solution (2) seems to be OK.
>>Do you agree?
>
>Does gcc still mark -iwithprefix as deprecated?  If it does then do not
>rely on it and use (1a).  If gcc will support -iwithprefix then use (2).
>

gcc-3.2, info:

`-iwithprefix DIR'
`-iwithprefixbefore DIR'
     Append DIR to the prefix specified previously with `-iprefix', and
     add the resulting directory to the include search path.
     `-iwithprefixbefore' puts it in the same place `-I' would;
     `-iwithprefix' puts it where `-idirafter' would.

     Use of these options is discouraged.

-- 
J.A. Magallon <jamagallon@able.es>      \                 Software is like sex:
werewolf.able.es                         \           It's better when it's free
Mandrake Linux release 9.1 (Cooker) for i586
Linux 2.4.20-jam1 (gcc 3.2 (Mandrake Linux 9.1 3.2-4mdk))

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

* Re: How to do -nostdinc?
  2002-12-16 21:26   ` Keith Owens
  2002-12-16 22:44     ` J.A. Magallon
@ 2002-12-16 23:16     ` H. Peter Anvin
  1 sibling, 0 replies; 8+ messages in thread
From: H. Peter Anvin @ 2002-12-16 23:16 UTC (permalink / raw)
  To: linux-kernel

Followup to:  <20218.1040073993@ocs3.intra.ocs.com.au>
By author:    Keith Owens <kaos@ocs.com.au>
In newsgroup: linux.dev.kernel
> 
> Does gcc still mark -iwithprefix as deprecated?  If it does then do not
> rely on it and use (1a).  If gcc will support -iwithprefix then use (2).
> 

If they do, let's apply a cluebat and explain to them that there is no
acceptable substitute for many nonhosted applications, not just the
Linux kernel.

	-hpa
-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt	<amsp@zytor.com>

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

end of thread, other threads:[~2002-12-16 23:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-15 12:06 How to do -nostdinc? Keith Owens
2002-12-15 13:47 ` Marius Gedminas
2002-12-15 15:11 ` Russell King
2002-12-16  0:17 ` Steffen Persvold
2002-12-16 18:29 ` Sam Ravnborg
2002-12-16 21:26   ` Keith Owens
2002-12-16 22:44     ` J.A. Magallon
2002-12-16 23:16     ` H. Peter Anvin

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).