public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: non-gcc linux? (was Re: Where did kgcc go in 2.4.0-test10?)
  2000-11-02 19:18   ` Andi Kleen
@ 2000-11-04  5:34 Aaron Sethman
  2000-11-04  9:18 ` non-gcc linux? Tim Riker
  0 siblings, 1 reply; 32+ messages in thread
From: Aaron Sethman @ 2000-11-04  5:34 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Alan Cox, Tim Riker, Linux Kernel Mailing List

On Thu, 2 Nov 2000, Andi Kleen wrote:

> On Thu, Nov 02, 2000 at 07:07:12PM +0000, Alan Cox wrote:
> > > 1. There are architectures where some other compiler may do better
> > > optimizations than gcc. I will cite some examples here, no need to argue
> > 
> > I think we only care about this when they become free software.
> 
> SGI's pro64 is free software and AFAIK is able to compile a kernel on IA64.
> It is also not clear if gcc will ever produce good code on IA64.

Well if its compiling the kernel just fine without alterations to the
code, then fine. If not, if the SGI compiler is GPL'd pillage its sources
and get that code working in gcc. Otherwise, trying to get linux to work
with other C compilers doesn't seem worth the effort. 

Aaron

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 32+ messages in thread
* non-gcc linux?
@ 2000-11-04  4:25 Bryan Sparks
  0 siblings, 0 replies; 32+ messages in thread
From: Bryan Sparks @ 2000-11-04  4:25 UTC (permalink / raw)
  To: linux-kernel, tim, bryan_sparks

Let me see if I understand you correctly. Metrowerks (Motorola) makes a 
twenty something million dollar investment in your little company, and as 
part of the agreement (not to mention Metrowerk's sole motivation) you are 
required to create a version of Linux that compiles under their ANSI c tool 
chain. Furthermore, you are attempting to lobby the community into helping 
your effort under the pretense that it is for the good of Linux? Survey 
says...bzzzsst. Wrong answer Chuck, but for your consolation prize you get 
your own non-standard, divergent Linux.

Thanks for playing!
Bryan


Tim Riker wrote:

All,

Alright, I've been lurking long enough on this thread. What say we
consider the option of building the kernel with a compiler other than
gcc? This would imply a slightly different structure to the makefiles
and code.

There are two immediate reasons I can come up with for this:

1. There are architectures where some other compiler may do better
optimizations than gcc. I will cite some examples here, no need to argue
out the point unless you disagree with the POSSIBILITY that this may be
true on at least one architecture. Anyway, possibilities include
Compaq's compiler on alpha, HP's compiler on hppa, Intel's compiler (or
rather plugins to another vendors compiler) on ia64, Metrowerk's
compiler on PPC, etc.

2. There are architectures where gcc is not yet available, but vendor C
compilers are.

I suggest that we avoid gcc extensions as much as possible, barring
performance hits. When there is an ANSI way of doing things we should
choose that route. Where there is not, then isolate the gcc way such
that compiler vendors can either:

1. implement the gcc way and conditional compile that code.

2. implement some other way and easily add that conditional code.

I've been looking into this here at Lineo for some of these vendors.
Here is a brief list of things I've come across:

1. C++ style comments

Occurs in over 4000 lines of source and header files. :-( Should be
converted to ansi c comments? We will probably want to just skirt this
issue for now as the next rev of ANSI C is likely to include ANSI C++
style comments.

2. Inline assembly statements

mostly in arch/ tree. Frequently used in macros as well. Much of this
will incur performance penalties if moved to external assembly files.
Some would require moving supported C code over as well. Hence many of
these will probably translate into conditional compilation based on the
compiler to avoid and performance hit for the mainstream case.

3. Declaring attributes of functions

The __attribute__ options: noreturn, const, format, section,
constructor, destructor, unused, and weak. weak and section are needed.
The rest can be ignored? These might want to be converted to #defines
such that alternative compilers can implement them differently.

4. Specifying attributes of variables

The __attribute__ options: aligned, packed, section and weak. As above
these will likely be #defines to handle different compiler syntax.

5. Conditionals with omitted operands

The missing operands should just be added into the mainstream source.

6. Referring to a type with typeof

no recommendation yet.

7. Macros with variable numbers of arguments

no recommendation yet.

8. Inquiring on alignment of types or variables (__alignof__)

no recommendation yet.

Well, I got a bit more long winded than I planned, but there it is.
Thoughts?

"H. Peter Anvin" wrote:
>
>Followup to: <200011020011.QAA20585@pizda.ninka.net> By author: "David S. 
>Miller" <davem@redhat.com> In newsgroup: linux.dev.kernel > > We already 
>know we are a bunch of pinheads wrt. the userland compiler > issue, full 
>stop. It need not be restated several hundred more times. > Believe me, 
>after such a large fiasco, we have listened :-) > > But, on the other hand, 
>to say that "kgcc" comceptually is something > only Red Hat has ever done 
>is a factual error, that is all I am trying > to state, nothing more. >
>
>I think at least supporting a "kgcc" compiler makes sense, conceptually 
>(although it probably should have been called "kcc", but it's too late 
>now.)
>
>The kernel uses a lot of gcc extensions, and history shows that these 
>extensions aren't as stable as the compiler system as a whole.
>
>-hpa

--
Tim Riker - http://rikers.org/ - short SIGs! <g>
All I need to know I could have learned in Kindergarten
... if I'd just been paying attention.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 32+ messages in thread
* Re: non-gcc linux? (was Re: Where did kgcc go in 2.4.0-test10?)
@ 2000-11-02 21:06 Christoph Hellwig
  2000-11-02 21:21 ` non-gcc linux? Tim Riker
  0 siblings, 1 reply; 32+ messages in thread
From: Christoph Hellwig @ 2000-11-02 21:06 UTC (permalink / raw)
  To: Tim Riker; +Cc: Linux Kernel Mailing List

In article <3A01D463.9ADEF3AF@Rikers.org> you wrote:
> As is being discussed here, C99 has some replacements to the gcc syntax
> the kernel uses. I believe the C99 syntax will win in the near future,
> and thus the gcc syntax will have to be removed at some point. In the
> interim the kernel will either move towards supporting both, or a
> quantum jump to support the new gcc3+ compiler only. I am hoping a
> little thought can get put into this such that this change will be less
> painful down the road.

BTW: the C99 syntax for named structure initializers is supported from
gcc 2.7.<something> on. But a policy decision has been take to use
gcc synta in kernel.

	Christoph


-- 
Always remember that you are unique.  Just like everyone else.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 32+ messages in thread
* Re: non-gcc linux? (was Re: Where did kgcc go in 2.4.0-test10?)
@ 2000-11-02 21:04 Tim Riker
  2000-11-02 21:17 ` Alan Cox
  0 siblings, 1 reply; 32+ messages in thread
From: Tim Riker @ 2000-11-02 21:04 UTC (permalink / raw)
  To: Alan Cox; +Cc: Linux Kernel Mailing List

Alan,

Alan Cox wrote:
> 
> > > That need to run Linux - name one ? Why try to solve a problem when it hasn't
> > > happened yet. Let whoever needs to solve it do it.
> >
> > We have proposals here all under NDA. So I won't mention one of them.
> > Perhaps there are some of these folk on the list that would like to
> > comment?
> 
> Then I think it will be up to you to achieve the non gcc build or to teach
> your compiler gcc extensions (which may or may not be easier). The kernel also
> tends to know a few things about how gcc optimises code which shouldn't matter
> if your compiler is good enough to optimise nicely anyway.

This is completely reasonable. I guess what I'm asking is:

How can I insure that the largest possible amount of my efforts benefit
the community at large? Hopefully this will make it easier to move to
C99 or any other future compiler porting project.

> 
> AFAIK the only non gcc port of Linux isnt exactly a port but was ELKS done using
> bcc86 (Bruce Evans compiler)

I have not looked at this project. Thank you for the pointer. I hope to
learn form their experiences.

> 
> Alan

PS, while I'm writing to you. I reread my earlier reply to you and Ben
was right about chewing me out for it. My bad.
-- 
Tim Riker - http://rikers.org/ - short SIGs! <g>
All I need to know I could have learned in Kindergarten
... if I'd just been paying attention.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 32+ messages in thread
* non-gcc linux? (was Re: Where did kgcc go in 2.4.0-test10?)
@ 2000-11-02 18:55 Tim Riker
  2000-11-02 19:07 ` Alan Cox
  0 siblings, 1 reply; 32+ messages in thread
From: Tim Riker @ 2000-11-02 18:55 UTC (permalink / raw)
  To: Linux Kernel Mailing List

All,

Alright, I've been lurking long enough on this thread. What say we
consider the option of building the kernel with a compiler other than
gcc? This would imply a slightly different structure to the makefiles
and code.

There are two immediate reasons I can come up with for this:

1. There are architectures where some other compiler may do better
optimizations than gcc. I will cite some examples here, no need to argue
out the point unless you disagree with the POSSIBILITY that this may be
true on at least one architecture. Anyway, possibilities include
Compaq's compiler on alpha, HP's compiler on hppa, Intel's compiler (or
rather plugins to another vendors compiler) on ia64, Metrowerk's
compiler on PPC, etc.

2. There are architectures where gcc is not yet available, but vendor C
compilers are.

I suggest that we avoid gcc extensions as much as possible, barring
performance hits. When there is an ANSI way of doing things we should
choose that route. Where there is not, then isolate the gcc way such
that compiler vendors can either:

1. implement the gcc way and conditional compile that code.

2. implement some other way and easily add that conditional code.

I've been looking into this here at Lineo for some of these vendors.
Here is a brief list of things I've come across:

1. C++ style comments

Occurs in over 4000 lines of source and header files. :-( Should be
converted to ansi c comments? We will probably want to just skirt this
issue for now as the next rev of ANSI C is likely to include ANSI C++
style comments.

2. Inline assembly statements

mostly in arch/ tree. Frequently used in macros as well. Much of this
will incur performance penalties if moved to external assembly files.
Some would require moving supported C code over as well. Hence many of
these will probably translate into conditional compilation based on the
compiler to avoid and performance hit for the mainstream case.

3. Declaring attributes of functions

The __attribute__ options: noreturn, const, format, section,
constructor, destructor, unused, and  weak. weak and section are needed.
The rest can be ignored? These might want to be converted to #defines
such that alternative compilers can implement them differently.

4. Specifying attributes of variables

The __attribute__ options: aligned, packed, section and weak. As above
these will likely be #defines to handle different compiler syntax.

5. Conditionals with omitted operands

The missing operands should just be added into the mainstream source.

6. Referring to a type with typeof

no recommendation yet.

7. Macros with variable numbers of arguments

no recommendation yet.

8. Inquiring on alignment of types or variables (__alignof__)

no recommendation yet.

Well, I got a bit more long winded than I planned, but there it is.
Thoughts?

"H. Peter Anvin" wrote:
> 
> Followup to:  <200011020011.QAA20585@pizda.ninka.net>
> By author:    "David S. Miller" <davem@redhat.com>
> In newsgroup: linux.dev.kernel
> >
> > We already know we are a bunch of pinheads wrt. the userland compiler
> > issue, full stop.  It need not be restated several hundred more times.
> > Believe me, after such a large fiasco, we have listened :-)
> >
> > But, on the other hand, to say that "kgcc" comceptually is something
> > only Red Hat has ever done is a factual error, that is all I am trying
> > to state, nothing more.
> >
> 
> I think at least supporting a "kgcc" compiler makes sense,
> conceptually (although it probably should have been called "kcc", but
> it's too late now.)
> 
> The kernel uses a lot of gcc extensions, and history shows that these
> extensions aren't as stable as the compiler system as a whole.
> 
>         -hpa
-- 
Tim Riker - http://rikers.org/ - short SIGs! <g>
All I need to know I could have learned in Kindergarten
... if I'd just been paying attention.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

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

end of thread, other threads:[~2000-11-06 23:15 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <fa.fvk85sv.1oigpiv@ifi.uio.no>
     [not found] ` <fa.cq7bdsv.gggbio@ifi.uio.no>
2000-11-06  0:34   ` non-gcc linux? Russ Allbery
2000-11-06  1:01     ` Tim Riker
2000-11-06 23:14       ` Adam Sampson
2000-11-04  5:34 non-gcc linux? (was Re: Where did kgcc go in 2.4.0-test10?) Aaron Sethman
2000-11-04  9:18 ` non-gcc linux? Tim Riker
2000-11-04 10:58   ` Alan Cox
2000-11-05 20:52     ` Tim Riker
2000-11-05 21:06       ` Jakub Jelinek
2000-11-05 21:18         ` Tim Riker
2000-11-05 22:42         ` Marc Lehmann
2000-11-05 23:05           ` Tim Riker
2000-11-06  0:05             ` Marc Lehmann
2000-11-06  8:53             ` Thomas Pornin
2000-11-05 23:26           ` Ion Badulescu
2000-11-06  6:34             ` Eric W. Biederman
2000-11-05 22:46         ` Alan Cox
2000-11-05 22:45       ` Alan Cox
2000-11-05 22:52         ` Tim Riker
2000-11-04 12:20   ` Kai Henningsen
  -- strict thread matches above, loose matches on Subject: below --
2000-11-04  4:25 Bryan Sparks
2000-11-02 21:06 non-gcc linux? (was Re: Where did kgcc go in 2.4.0-test10?) Christoph Hellwig
2000-11-02 21:21 ` non-gcc linux? Tim Riker
2000-11-02 21:04 non-gcc linux? (was Re: Where did kgcc go in 2.4.0-test10?) Tim Riker
2000-11-02 21:17 ` Alan Cox
2000-11-02 21:23   ` Andi Kleen
2000-11-02 21:27     ` non-gcc linux? Tim Riker
2000-11-02 21:41       ` Andi Kleen
2000-11-02 21:43         ` Tim Riker
2000-11-03  7:21       ` Gábor Lénárt
2000-11-04 11:39         ` Kai Henningsen
2000-11-02 18:55 non-gcc linux? (was Re: Where did kgcc go in 2.4.0-test10?) Tim Riker
2000-11-02 19:07 ` Alan Cox
2000-11-02 19:18   ` Andi Kleen
2000-11-02 19:17     ` non-gcc linux? Tim Riker
2000-11-02 19:52       ` Andrea Arcangeli
2000-11-02 20:00         ` Tim Riker
2000-11-02 20:29           ` Andrea Arcangeli
2000-11-02 22:23           ` D. Hugh Redelmeier
2000-11-02 22:31             ` Jeff Garzik
2000-11-03 22:02               ` D. Hugh Redelmeier

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