public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: C as target platform?
@ 2002-08-23  9:35 Erik Schnetter
  0 siblings, 0 replies; 7+ messages in thread
From: Erik Schnetter @ 2002-08-23  9:35 UTC (permalink / raw)
  To: gcc

On Fri, 23 Aug 2002 08:47:26 -0400, Daniel Jacobowitz <drow at mvista 
dot com> wrote:
> On Fri, Aug 23, 2002 at 09:03:05AM +0200, Helmut Zeisel wrote:
> > Could C (or even KR-C) as a supported target platform solve
> > many of the problems with respect to a front-end
> > written in C++ or any other language?
> > 
> > In that case, one would have not only a Fortran to C
> > (similar to the existing F2C), but also an ADA2C, C++2C etc.
> > 
> > For bootstrapping (and maybe for the distribution) of GCC,
> > one could use the C-"compiled" version of GCC,
> > although the real source is written in some other language.
>
> Code to compile to C has been repeatedly declined, at RMS's request. 
> It makes using GCC as a frontend for a proprietary compiler too
> attractive.

An alternative would be an assembler-to-C converter.  Pick an easy 
assembler language supported by gcc (e.g. Sparc or MMIX), and write a 
standalone application that converts it to C.  If you read object code, 
then parsing is not a problem.  The produced C code need not be 
optimal, and a "reasonable" C compiler will produce "reasonable" 
programmes from it.

-erik

-- 
Erik Schnetter <schnetter@uni-tuebingen.de>
Web: http://www.tat.physik.uni-tuebingen.de/~schnette/

My email is as private as my paper mail.  I therefore support encrypting
and signing email messages.  Tell me if I can encrypt messages to you.
(For more information, go e.g. to http://www.pgpi.org .)

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

* Re: C as target platform?
  2002-08-23  3:22 Robert Dewar
@ 2002-08-23  9:35 ` David Brown
  0 siblings, 0 replies; 7+ messages in thread
From: David Brown @ 2002-08-23  9:35 UTC (permalink / raw)
  To: Robert Dewar; +Cc: gcc, helmut.zeisel

On Fri, Aug 23, 2002 at 06:22:36AM -0400, Robert Dewar wrote:

> In fact to port GNAT to a brand new architecture, the basic cross port is
> a trivial part of the work, perhaps 5% or less. Ada is not C, and just getting
> a non-tasking bootstrap without the tools and without the run-time library
> (particularly the tasking support) is a trivially easy part of the porting
> process for a new architecture in our experience. 

A while back, even before GNAT was integrated with the GCC source tree,
I managed to build a cross compiler for GNAT on an x86 linux machine
that targeted and ARM7.  That wasn't very hard at all.  The hard part
was writing enough of a runtime to have a useful system.

It probably took me less than a day to get it compiling.  It is even
easier with the code integrated, since it usually just builds.  That's
with the lack of real clean support for a cross compiler, I had to do
quite a bit by hand.

Of course, my target couldn't hope to ever host gcc itself (it has no
filesystem, a small amount of ram, and the code goes in ROM).

Dave Brown

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

* Re: C as target platform?
  2002-08-23  7:52   ` Kevin Handy
@ 2002-08-23  7:55     ` Jason Merrill
  0 siblings, 0 replies; 7+ messages in thread
From: Jason Merrill @ 2002-08-23  7:55 UTC (permalink / raw)
  To: Kevin Handy; +Cc: Daniel Jacobowitz, Helmut Zeisel, gcc

On Fri, 23 Aug 2002 08:57:15 -0600, Kevin Handy <kth@srv.net> wrote:

> My opinion is that either case should be handled by improving
> GCC  to add the desired optimizations/back-ends,  not by
> artificially limiting the capabilities of the compiler.  You should
> eliminate the competition by having a better compiler.

The idea is to motivate people who want the desired optimization/back-ends
to add them to GCC, rather than use an existing "good enough" alternative.

Jason

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

* Re: C as target platform?
  2002-08-23  6:16 ` Daniel Jacobowitz
@ 2002-08-23  7:52   ` Kevin Handy
  2002-08-23  7:55     ` Jason Merrill
  0 siblings, 1 reply; 7+ messages in thread
From: Kevin Handy @ 2002-08-23  7:52 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: Helmut Zeisel, gcc

Daniel Jacobowitz wrote:

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

* Re: C as target platform?
  2002-08-23  0:03 Helmut Zeisel
@ 2002-08-23  6:16 ` Daniel Jacobowitz
  2002-08-23  7:52   ` Kevin Handy
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2002-08-23  6:16 UTC (permalink / raw)
  To: Helmut Zeisel; +Cc: gcc

On Fri, Aug 23, 2002 at 09:03:05AM +0200, Helmut Zeisel wrote:
> Could C (or even KR-C) as a supported target platform solve
> many of the problems with respect to a front-end
> written in C++ or any other language?
> 
> In that case, one would have not only a Fortran to C
> (similar to the existing F2C), but also an ADA2C, C++2C etc.
> 
> For bootstrapping (and maybe for the distribution) of GCC,
> one could use the C-"compiled" version of GCC,
> although the real source is written in some other language.

Code to compile to C has been repeatedly declined, at RMS's request. 
It makes using GCC as a frontend for a proprietary compiler too
attractive.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

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

* Re: C as target platform?
@ 2002-08-23  3:22 Robert Dewar
  2002-08-23  9:35 ` David Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Robert Dewar @ 2002-08-23  3:22 UTC (permalink / raw)
  To: gcc, helmut.zeisel

<<For bootstrapping (and maybe for the distribution) of GCC,
one could use the C-"compiled" version of GCC,
although the real source is written in some other language.
>>

That's one possibility, another is to generate canonical simple machine
code (e.g. a mips subset) and provide a simulator. We actually looked 
into these possibilities closely early on in the GNAT project since we
were concerned about the bootstrap issue.

But in practice we found that using the cross-port approach worked just
fine for both us and many volunteers who generated cross-ports under
their own steam without any help from us (Nextstep, OpenBSD, FreeBSD,
Amiga, MS/DOS, are some of the ports that appeared this way).

In fact to port GNAT to a brand new architecture, the basic cross port is
a trivial part of the work, perhaps 5% or less. Ada is not C, and just getting
a non-tasking bootstrap without the tools and without the run-time library
(particularly the tasking support) is a trivially easy part of the porting
process for a new architecture in our experience. 

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

* C as target platform?
@ 2002-08-23  0:03 Helmut Zeisel
  2002-08-23  6:16 ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Helmut Zeisel @ 2002-08-23  0:03 UTC (permalink / raw)
  To: gcc

Could C (or even KR-C) as a supported target platform solve
many of the problems with respect to a front-end
written in C++ or any other language?

In that case, one would have not only a Fortran to C
(similar to the existing F2C), but also an ADA2C, C++2C etc.

For bootstrapping (and maybe for the distribution) of GCC,
one could use the C-"compiled" version of GCC,
although the real source is written in some other language.

Helmut

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

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

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-23  9:35 C as target platform? Erik Schnetter
  -- strict thread matches above, loose matches on Subject: below --
2002-08-23  3:22 Robert Dewar
2002-08-23  9:35 ` David Brown
2002-08-23  0:03 Helmut Zeisel
2002-08-23  6:16 ` Daniel Jacobowitz
2002-08-23  7:52   ` Kevin Handy
2002-08-23  7:55     ` Jason Merrill

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 read-only IMAP folder(s) and NNTP newsgroup(s).