comp.lang.ada
 help / color / mirror / Atom feed
* GNAT for an unsupported Unix-system?
@ 1997-11-10  0:00 Tor-Einar Jarnbjo
  1997-11-15  0:00 ` Chris Morgan
  0 siblings, 1 reply; 14+ messages in thread
From: Tor-Einar Jarnbjo @ 1997-11-10  0:00 UTC (permalink / raw)



Hi,

I recently downloaded the source-codes for the latest GNAT Ada-compiler,
but then I saw that I needed the last version of GNAT to compile the
new version of GNAT. Well, this results in an interesting problem when
trying to port GNAT to a Unix-system for which there are no binaries.

Does anyone have a suggestion on how to solve this? E.g. BinProlog is
written in Prolog, but has a small part written in C, making it possible
to compile enough of the compiler with gcc, to make it able to compile
itself. Is there a similar do-magic-thingy for GNAT, or perhaps another
free Ada-compiler written in C?

Tor-Einar





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

* Re: GNAT for an unsupported Unix-system?
  1997-11-10  0:00 GNAT for an unsupported Unix-system? Tor-Einar Jarnbjo
@ 1997-11-15  0:00 ` Chris Morgan
       [not found]   ` <1630.259T1446T2081822@cs.tu-berlin.de>
  0 siblings, 1 reply; 14+ messages in thread
From: Chris Morgan @ 1997-11-15  0:00 UTC (permalink / raw)



"Tor-Einar Jarnbjo" <bjote@cs.tu-berlin.de> writes:

> I recently downloaded the source-codes for the latest GNAT Ada-compiler,
> but then I saw that I needed the last version of GNAT to compile the
> new version of GNAT. Well, this results in an interesting problem when
> trying to port GNAT to a Unix-system for which there are no binaries.

You can build a cross-compiler easily enough for almost every known
Unix variant (and all important ones). That's how the existing ports
get done. I think GNAT started off life on SunOS and OS/2 and all the
other versions started off life as cross-compiles.

  
> Does anyone have a suggestion on how to solve this? E.g. BinProlog is
> written in Prolog, but has a small part written in C, making it possible
> to compile enough of the compiler with gcc, to make it able to compile
> itself. Is there a similar do-magic-thingy for GNAT, or perhaps another
> free Ada-compiler written in C?

There was a discussion about this on this very newsgroup a while
back. I suggested a subset language Tina (Tina Is Not Ada) which
contained just the features that the GNAT compiler itself needs and
which could be translated to C for the bootstrap problem. I even
speculated that this translation could be aided by a hacked GNAT
front-end which could traverse the tree representation of the compiler
and emit the C. Robert Dewar replied (as I remember) that they
considered schemes like this originally but found cross-compiling to
be a far better solution.

Regards,

Chris


-- 
Chris Morgan <mihalis@ix.netcom.com>




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

* Re: GNAT for an unsupported Unix-system?
       [not found]   ` <1630.259T1446T2081822@cs.tu-berlin.de>
@ 1997-11-17  0:00     ` Robert Dewar
       [not found]       ` <2164.263T879T7501343@cs.tu-berlin.de>
  0 siblings, 1 reply; 14+ messages in thread
From: Robert Dewar @ 1997-11-17  0:00 UTC (permalink / raw)



<<Thank you for the information. I really don't know why I didn't think
about this, and as I luckily have access to SparcStations at the
University, I'll probably get it done somehow. I can't see however,
why this solution is better than writing a small subset-compiler in
C, and I would suppose, that some, though not many, don't have access
to a system supported by the binary distributions. And, installing
and compiling gcc for crosscompiling is also not _that_ straight-
forward. At least it's much easier to do ./configure and then make.

Tor-Einar
>>


This solution is certainly *simpler* than writing a "small subset compiler
in C", since it requires zero work. Writing that small subset compiler in
C is a FAR bigger task than you think, a few person years of work I would
guess, GNAT does not use all of Ada 95, but it uses a very large subset.

The real point is that in practice, even if you don't know enough to build
a cross-compiler, someone somewhere has the knowledge and hardware to do so,
and in practice versions of GNAT have appeared pretty easily.

Also, to think that ./configure would ever be enough is ignoring the
runtime library issue. Porting the entire runtime library is not a trivial
task, and if you don't know enough to build a cross-compiler, you probably
won't succeed with the runtime (let alone the full tool chain including gdb).





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

* Re: GNAT for an unsupported Unix-system?
       [not found]         ` <dewar.880070329@merv>
@ 1997-11-23  0:00           ` Tor-Einar Jarnbjo
  1997-11-23  0:00             ` Robert Dewar
  0 siblings, 1 reply; 14+ messages in thread
From: Tor-Einar Jarnbjo @ 1997-11-23  0:00 UTC (permalink / raw)



On 21-Nov-97 01:00:09, Robert Dewar wrote in comp.lang.ada:
>Tor-Einar said

><<Yes, but I must admit that I use a very odd system (NetBSD-m68k), and I
>suppose the only way for me to get to an ADA-compiler is to compile it
>myself. My system is supposed to run SunOS4.1.1-binaries, but when I
>tried an older GNAT for SunOS, it core-dumped.
>>>

>Right, you need to build this version yourself, or find someone else who
>can! Clearly if you are using an unusual system, then you are less likely
>to find canned software for it!

Yes, but even though I'm using an unusual system, I'm very likely to
compile available sources.

>On the other hand, GNAT has appeared for some strange systems, e.g.
>Amiga :-)

Would it be a surprise if I say that the computer on which I use 
NetBSD-m68k is an Amiga :-) I know that I could get GNAT for AmigaDOS
(at least an old version), but since AmigaDOS is not Posix-compliant,
and if even though an extension tries to make it Posix-compliant, the
gcc and GNAT-ports are IMHO not very ideal.

Tor-Einar

--
Tor-Einar Jarnbjo
bjote@cs.tu-berlin.de
+49 30  41107941





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

* Re: GNAT for an unsupported Unix-system?
  1997-11-23  0:00           ` Tor-Einar Jarnbjo
@ 1997-11-23  0:00             ` Robert Dewar
  1997-11-24  0:00               ` Tor-Einar Jarnbjo
  0 siblings, 1 reply; 14+ messages in thread
From: Robert Dewar @ 1997-11-23  0:00 UTC (permalink / raw)



Tor said

<<Would it be a surprise if I say that the computer on which I use
NetBSD-m68k is an Amiga :-) I know that I could get GNAT for AmigaDOS
(at least an old version), but since AmigaDOS is not Posix-compliant,
and if even though an extension tries to make it Posix-compliant, the
gcc and GNAT-ports are IMHO not very ideal.>>


Then you are well setup to do the port, just get the Amiga DOS port, and
do a cross port to NetBSD-m68k -- shuld be straigntforward if you know
what you are doing, and if you don't, it will be insrtuctive to learn!





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

* Re: GNAT for an unsupported Unix-system?
  1997-11-23  0:00             ` Robert Dewar
@ 1997-11-24  0:00               ` Tor-Einar Jarnbjo
  1997-11-24  0:00                 ` Robert Dewar
  1997-11-25  0:00                 ` Geert Bosch
  0 siblings, 2 replies; 14+ messages in thread
From: Tor-Einar Jarnbjo @ 1997-11-24  0:00 UTC (permalink / raw)



On 23-Nov-97 19:22:40, Robert Dewar wrote in comp.lang.ada:
>Tor said

><<Would it be a surprise if I say that the computer on which I use
>NetBSD-m68k is an Amiga :-) I know that I could get GNAT for AmigaDOS
>(at least an old version), but since AmigaDOS is not Posix-compliant,
>and if even though an extension tries to make it Posix-compliant, the
>gcc and GNAT-ports are IMHO not very ideal.>>

>Then you are well setup to do the port, just get the Amiga DOS port, and
>do a cross port to NetBSD-m68k -- shuld be straigntforward if you know
>what you are doing, and if you don't, it will be insrtuctive to learn!

Ok, I'll try this. But, the GNAT-port for AmigaOS is version 2.06, so
do you know if any of the newest versions of GNAT will compile with
this old version, or do I have to get the older sources and do a step-
by-step upgrade. It says in the installation-guides, that it's only
guaranteed that GNAT will compile with the last version of GNAT, but
I might have luck, or not.

Tor-Einar

--
Tor-Einar Jarnbjo
bjote@cs.tu-berlin.de
+49 30  41107941





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

* Re: GNAT for an unsupported Unix-system?
  1997-11-24  0:00               ` Tor-Einar Jarnbjo
@ 1997-11-24  0:00                 ` Robert Dewar
  1997-11-27  0:00                   ` Tor-Einar Jarnbjo
  1997-11-25  0:00                 ` Geert Bosch
  1 sibling, 1 reply; 14+ messages in thread
From: Robert Dewar @ 1997-11-24  0:00 UTC (permalink / raw)



Tor-Einar says

<<Ok, I'll try this. But, the GNAT-port for AmigaOS is version 2.06, so
do you know if any of the newest versions of GNAT will compile with
this old version, or do I have to get the older sources and do a step-
by-step upgrade. It says in the installation-guides, that it's only
guaranteed that GNAT will compile with the last version of GNAT, but
I might have luck, or not.
>>

There is no possible hope of compiling the latest version of GNAT with
2.06. There are features that are simply not implemented that far back.
Indeed it is quite unusual that one can compile GNAT other than with
the previous version.

So if there is no more up to date AmigoOS port, that approach will not
work (are you sure there is no more recent Amiga port? I don't keep
track of them, but my memory was of a more recent port than that.





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

* Re: GNAT for an unsupported Unix-system?
  1997-11-24  0:00               ` Tor-Einar Jarnbjo
  1997-11-24  0:00                 ` Robert Dewar
@ 1997-11-25  0:00                 ` Geert Bosch
  1997-11-27  0:00                   ` Tor-Einar Jarnbjo
  1 sibling, 1 reply; 14+ messages in thread
From: Geert Bosch @ 1997-11-25  0:00 UTC (permalink / raw)



(Please, follow-ups to chat@gnat.com, subscribe using chat-request@gnat.com)

Tor-Einar Jarnbjo <bjote@cs.tu-berlin.de> wrote:

   Ok, I'll try this. But, the GNAT-port for AmigaOS is version 2.06, so
   do you know if any of the newest versions of GNAT will compile with
   this old version, or do I have to get the older sources and do a step-
   by-step upgrade. It says in the installation-guides, that it's only
   guaranteed that GNAT will compile with the last version of GNAT, but
   I might have luck, or not.

You will have to do a cross-compile, starting on a platform for which
a new binary release is available. If you have access to a Unix box
somewhere, the best way to proceed is as follows:
  *  build cross-gcc for your Unix to m68k, should work out of the box
  *  compile trivial C file to assembly (.s) and assemble/link on m68k
  *  if this works, build cross-gnat and compile all GNAT sources to .s
  *  build native GNAT on m68k: now you don't need the GNAT compiler
     because you have assembly sources

Note that you are very likely to get stuck if you try to go the "official"
route, since cross-binutils have (or at least had) some problems with
targetting the m68k platform. Transferring the .s files is much easier than
cross-linking anyway.

BTW, I did some cross-compiles for the m68k-sun-sunos4.1.1 from Linux,
but that is a long time ago. The latest version I built before my Sun-3
died is 3.01, so that won't help you even though you might be able to
run SunOS binaries.

Success!

Regards,
  Geert




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

* Re: GNAT for an unsupported Unix-system?
  1997-11-27  0:00                   ` Tor-Einar Jarnbjo
@ 1997-11-26  0:00                     ` Robert Dewar
  0 siblings, 0 replies; 14+ messages in thread
From: Robert Dewar @ 1997-11-26  0:00 UTC (permalink / raw)



Tor Einar says

<<I've tried 2.06 and it doesn't seem to be too stable. It might be
because I have a 68060-processor, and I've read that some older versions
of gcc for AmigaOS produced code which might cause problems on the
68060s. Perhaps GNAT 2.06 was compiled with one of them.
>>

2.06 has been superceded by at least 12 new versions of GNAT over several
years. At this stage it is sadly out of date, and will not seem usable to
those used to anything like GNAT's current state of maturity 






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

* Re: GNAT for an unsupported Unix-system?
  1997-11-24  0:00                 ` Robert Dewar
@ 1997-11-27  0:00                   ` Tor-Einar Jarnbjo
  1997-11-26  0:00                     ` Robert Dewar
  0 siblings, 1 reply; 14+ messages in thread
From: Tor-Einar Jarnbjo @ 1997-11-27  0:00 UTC (permalink / raw)



On 24-Nov-97 08:06:08, Robert Dewar wrote in comp.lang.ada:
>Tor-Einar says

><<Ok, I'll try this. But, the GNAT-port for AmigaOS is version 2.06, so
>do you know if any of the newest versions of GNAT will compile with
>this old version, or do I have to get the older sources and do a step-
>by-step upgrade. It says in the installation-guides, that it's only
>guaranteed that GNAT will compile with the last version of GNAT, but
>I might have luck, or not.
>>>

>There is no possible hope of compiling the latest version of GNAT with
>2.06. There are features that are simply not implemented that far back.
>Indeed it is quite unusual that one can compile GNAT other than with
>the previous version.

>So if there is no more up to date AmigoOS port, that approach will not
>work (are you sure there is no more recent Amiga port? I don't keep
>track of them, but my memory was of a more recent port than that.

Well, at least 2.06 is the only version on Aminet and Geek-Gadgets
(which are the only distribution-sites I could think of having GNAT).

I've tried 2.06 and it doesn't seem to be too stable. It might be 
because I have a 68060-processor, and I've read that some older versions
of gcc for AmigaOS produced code which might cause problems on the
68060s. Perhaps GNAT 2.06 was compiled with one of them.

Tor-Einar

--
Tor-Einar Jarnbjo
bjote@cs.tu-berlin.de
+49 30  41107941





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

* Re: GNAT for an unsupported Unix-system?
  1997-11-25  0:00                 ` Geert Bosch
@ 1997-11-27  0:00                   ` Tor-Einar Jarnbjo
  1997-11-27  0:00                     ` Richard Kenner
  0 siblings, 1 reply; 14+ messages in thread
From: Tor-Einar Jarnbjo @ 1997-11-27  0:00 UTC (permalink / raw)



On 25-Nov-97 11:46:50, Geert Bosch wrote in comp.lang.ada:
>(Please, follow-ups to chat@gnat.com, subscribe using chat-request@gnat.com)

>You will have to do a cross-compile, starting on a platform for which
>a new binary release is available. If you have access to a Unix box
>somewhere, the best way to proceed is as follows:
>  *  build cross-gcc for your Unix to m68k, should work out of the box
>  *  compile trivial C file to assembly (.s) and assemble/link on m68k
>  *  if this works, build cross-gnat and compile all GNAT sources to .s
>  *  build native GNAT on m68k: now you don't need the GNAT compiler
>     because you have assembly sources

Ok, to cross-compile GNAT from Solaris, I was about to do the following:

1. Install GNAT
2. Compile gcc and GNAT with "--target=amiga-netbsd" set when running
   configure. This should compile gcc (and GNAT I hope) as a cross-
   compiler for Solaris making output for m68k-NetBSD
3. Use the cross-compiler to compile (but not assemble) itself and GNAT
   again, then move everything to the Amiga and then assemble and link
   the .s-files there.

But I get stuck somewhere in step two. According to the GNAT installation
guide, I shall patch the gcc-sources, move the src/ada-directory into
the gcc-tree, do the touch-thingy, configure gcc and then do (though
I use gmake instead of make):

make CC=gcc CFLAGS="-O2" LANGUAGES="c ada"

After some compilation, this produces the program "xgcc" which is then
used to do some more compiling. The problem is that xgcc is already
made to compile for the m68k and the Solaris "as" doesn't find the m68k-
assembler very interesting, so no hope. I tried to replace xgcc with
gcc (from the GNAT binaries) but this core-dumps when I try to continue
the make-process.

I suppose this is rather a gcc-question than related to ADA, but if 
you've already cross-compiled GNAT, you might know what I'm doing
wrong here, as it to me is not very obvious :-(

Tor-Einar

--
Tor-Einar Jarnbjo
bjote@cs.tu-berlin.de
+49 30  41107941





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

* Re: GNAT for an unsupported Unix-system?
  1997-11-27  0:00                   ` Tor-Einar Jarnbjo
@ 1997-11-27  0:00                     ` Richard Kenner
  1997-11-28  0:00                       ` Dale Stanbrough
  0 siblings, 1 reply; 14+ messages in thread
From: Richard Kenner @ 1997-11-27  0:00 UTC (permalink / raw)



In article <2021.270T782T1141698@cs.tu-berlin.de> "Tor-Einar Jarnbjo" <bjote@cs.tu-berlin.de> writes:
>But I get stuck somewhere in step two. According to the GNAT installation
>guide, I shall patch the gcc-sources, move the src/ada-directory into
>the gcc-tree, do the touch-thingy, configure gcc and then do (though
>I use gmake instead of make):
>
>make CC=gcc CFLAGS="-O2" LANGUAGES="c ada"
>
>After some compilation, this produces the program "xgcc" which is then
>used to do some more compiling. The problem is that xgcc is already
>made to compile for the m68k and the Solaris "as" doesn't find the m68k-
>assembler very interesting, so no hope. I tried to replace xgcc with
>gcc (from the GNAT binaries) but this core-dumps when I try to continue
>the make-process.

When you just say LANGUAGES="c ada", more gets compiled than you need to
just build the .s files with the gnat-cross target.  All you need to build
is gnat1.  But it's already been built by the time you start getting the
errors you are getting, so just ignore them and go on to the next step.




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

* Re: GNAT for an unsupported Unix-system?
  1997-11-27  0:00                     ` Richard Kenner
@ 1997-11-28  0:00                       ` Dale Stanbrough
  1997-12-01  0:00                         ` Scott Ingram
  0 siblings, 1 reply; 14+ messages in thread
From: Dale Stanbrough @ 1997-11-28  0:00 UTC (permalink / raw)



Richard Kenner writes:
 
"When you just say LANGUAGES="c ada", more gets compiled than you need to
 just build the .s files with the gnat-cross target.  All you need to
build
 is gnat1.  But it's already been built by the time you start getting the
 errors you are getting, so just ignore them and go on to the next step."


Are there any good books/articles that describe how to build GNU
software, 
esp. describing the model of the compiler and how to host it to another
machine?


Dale




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

* Re: GNAT for an unsupported Unix-system?
  1997-11-28  0:00                       ` Dale Stanbrough
@ 1997-12-01  0:00                         ` Scott Ingram
  0 siblings, 0 replies; 14+ messages in thread
From: Scott Ingram @ 1997-12-01  0:00 UTC (permalink / raw)



Dale Stanbrough wrote:
> 
> Are there any good books/articles that describe how to build GNU
> software,
> esp. describing the model of the compiler and how to host it to another
> machine?
> 
> Dale

Try:
http://www.fsf.org/links/links.html#FreeSoftwareDocumentation

-- 
Scott Ingram
Sonar Processing and Analysis Laboratory
Johns Hopkins University Applied Physics Laboratory




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

end of thread, other threads:[~1997-12-01  0:00 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-11-10  0:00 GNAT for an unsupported Unix-system? Tor-Einar Jarnbjo
1997-11-15  0:00 ` Chris Morgan
     [not found]   ` <1630.259T1446T2081822@cs.tu-berlin.de>
1997-11-17  0:00     ` Robert Dewar
     [not found]       ` <2164.263T879T7501343@cs.tu-berlin.de>
     [not found]         ` <dewar.880070329@merv>
1997-11-23  0:00           ` Tor-Einar Jarnbjo
1997-11-23  0:00             ` Robert Dewar
1997-11-24  0:00               ` Tor-Einar Jarnbjo
1997-11-24  0:00                 ` Robert Dewar
1997-11-27  0:00                   ` Tor-Einar Jarnbjo
1997-11-26  0:00                     ` Robert Dewar
1997-11-25  0:00                 ` Geert Bosch
1997-11-27  0:00                   ` Tor-Einar Jarnbjo
1997-11-27  0:00                     ` Richard Kenner
1997-11-28  0:00                       ` Dale Stanbrough
1997-12-01  0:00                         ` Scott Ingram

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