From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 27 Aug 93 14:23:56 GMT From: psinntp!psinntp!jupiter.fuentez.com!hildjj@uunet.uu.net (Joe Hildebrand) Subject: Re: Cross compilers, anyone? Message-ID: List-Id: >> In article >> on comp.os.ms-windows.nt.misc Ian Kemmish writes: Ian> One of those customers who's always right:-) has just asked us Ian> for an evaluation copy of our product for NT running on an Ian> Alpha. I'm sure they will be just the first of many. But I'm Ian> not the sort of person who goes buying hardware just for the Ian> sake of it... Ian> It strikes me that cross-compilation between different NT Ian> machines ought to be one of those things that's so easy even Ian> big companies get it right. Ian> However, the standard MS compilers don't do it. Ian> The Development Tools Catalogue doesn't show anyone else doing Ian> it. Ian> And to rub salt in, the same source indicates that the DEC Ian> compiler uses DEC's front end, not Microsoft's (at least the Ian> mips port of NT appears to have got *that* part right:->) Ian> Does anyone know of any commercially supported NT<->NT cross Ian> compilers out there? This question was asked (with a slightly different slant) on comp.lang.ada, today. Background for comp.os.ms-windows.nt readers: NYU is writing a GNU Ada compiler called GNAT (GNU Ada Translator), which will be integrated with gcc. This was the response to a question about the feasibility of porting GNAT to other architectures (it is only available on Sparc and OS/2, now). Note the part where it says no one from the NT camp has asked for gcc to be ported. Is anyone out there interested in a FREE compiler for NT that can cross-compile to 100+ different machine architectures and does C, C++, Objective C, and Ada? Sorry for the length of this post, but I thought it was neccesary to provide complete information to the c.o.m.nt readers. In article <25kmdn$16u@cmcl2.NYU.EDU> kenner@lab.ultra.nyu.edu (Richard Kenner) writes: Richard> In article <1993Aug27.024824.21373@seas.gwu.edu> Richard> mfeldman@seas.gwu.edu (Michael Feldman) writes: Richard> >This question makes me wonder if anyone has yet tried to Richard> >_port_ GNAT. It's an interesting process, because GNAT Richard> >is written in Ada, not C. One could bootstrap it by using Richard> >a commercial Ada compiler - NYU first compiled GNAT with Richard> >Alsys. This process was documented in an NYU post Richard> >a while ago. Richard> In fact, you can't do this for any of the versions we've Richard> distributed, only the very early systems we had. Now the Richard> `gnat1' executable is mixed-language, containing the C Richard> code of the GCC backend and the Ada code for the Ada Richard> front-end. In fact, just recently we changed things so Richard> the backend (in C) calls Ada code for some tree-processing Richard> functions rather than providing duplicate C functions. Richard> Since no commercial compiler provides such a seamless integration Richard> between languages, GNAT can only be compiled with itself at this Richard> point. Richard> >But that's no fun - it requires a commercial compiler. An all-GNU Richard> >approach is to use the gcc cross-compilation facilities. If a GNU Richard> >SPARC-to-Sun3 cross exists (just to take one example), then one Richard> >compiles GNAT on the SPARC, takes the assembly to the Sun-3 Richard> >and re-assembles. It is alleged to be fairly easy if you're an Richard> >experienced gcc hand. Richard> That's right. In fact there are two approaches. You can Richard> build a full cross-system, including GNAT (and GCC) along Richard> with a cross-assembler and linker (e.g., GAS and GLD). Richard> Brett Porter, one of the folks on the GNAT project, Richard> recently did this to be able to run Ada code an evaluation Richard> board containing some variant of the 68k (actually, he was Richard> originally interested, I believe, in C code, but built a Richard> cross-GNAT to see if it would work and it did). Richard> This approach is quite straightforward and almost automatic. Richard> If you don't want to bother with a cross-assembler and Richard> linker, you can do as Mike suggests and just produce the Richard> assembler files with a cross-GCC, then take them to the Richard> target and assemble them there. It's straightforward, but Richard> involves some manual steps. I did this for the RS/6000 a Richard> few weeks ago and will shortly need to do it for DEC's Richard> MIPS-based workstations, since that's what will be at Richard> Tri-Ada. Richard> >Indeed, I believe NYU is using only GNAT to compile new versions, Richard> >using Alsys only for "occasional sanity checks" as I think one Richard> >of the NYU guys put it. Richard> That's very close to correct. I don't believe that the Richard> folks here who use Sparcs use Alsys anymore. Robert Richard> Dewar, though, uses a PC and still does most of his work Richard> with Alsys since the OS/2 version of GNAT has been lagging Richard> a bit. Richard> >If there are any gcc cross-compilatiuon gurus out there Richard> >with a little time to tinker, I think it would be fun to Richard> >start some porting, so when the final version pops out, Richard> >it will instantly be available on a bunch of platforms. Richard> I don't think there's much point in doing this work. For Richard> one thing, it's fairly straightforward to do it on each Richard> target individually. But the major issue is that doing it Richard> now for a target won't mean that it won't have to be Richard> redone later. If you make a binary for some target right Richard> now, that does NOT mean that that binary will necessarily Richard> be useful later. It is not at all uncommon for some code Richard> we've written in GNAT to hit a bug or unsupported feature Richard> in a previous GNAT version. When that happens, the Richard> binaries will be useless for compiling later versions and Richard> the cross-work will need to be redone. Richard> It it our plan to not require a binary to build GNAT, Richard> merely a C compiler. Most of the Ada code is at a fairly Richard> low level and fairly regular. We intend to provide an Richard> Ada-to-C translator for the subset of Ada used in most of Richard> GNAT. For some of the other Ada modules, such as error Richard> handling, we'll provide C code that will link, but not do Richard> much (i.e., abort when asked to print an error, since Richard> there won't be any compiling GNAT). This will allow a Richard> bootstrap path. Richard> Collecting executables for all systems on which GNAT will Richard> work is not practical. I just counted and found that GCC Richard> (and hence GNAT) has configuration files for 188 different Richard> systems, most of which are not binary-compatible with each Richard> other. It's true that many of these systems don't exist Richard> anymore or are only of extremely narrow interest, but Richard> there are still probably dozens of distinct configurations Richard> that are current. Having so many binaries doesn't seem Richard> practical. Richard> Unfortunately, what started this discussion was Windows Richard> NT. There are no ports of GCC to any Windows NT Richard> configuration. It was not clear which one was of interest Richard> to the original poster. I will be doing a GCC port to the Richard> DEC Alpha version of NT as soon as DEC can get such a Richard> machine to me. A port to NT on a PowerPC should also not Richard> be very far away, since we're starting to do the Richard> modifications to the RS/6000 configuration files to Richard> support the various Motorola chips that are Richard> implementations of the PowerPC architecture. Richard> As far as I know, no one is working on a GCC port to Richard> Windows NT on an x86. The x86 work lately seems to be Richard> concentrating on the various dialects of OSF/1 (Rose and Richard> Elf). I don't recall seeing any requests for a x86 NT Richard> port of GCC on the GCC mailing lists; most requests lately Richard> seem to be for the various embedded processors. Richard> If someone wants to do a GCC port to the x86 Windows NT, Richard> it would be appreciated and GNAT would fall out for free. Richard> Unlike porting to a new architecture, which requires a lot Richard> of knowlege about GCC, porting to a new system on a Richard> supported architecture merely requires (intimate) knowlege Richard> of the target operating system and is usually just a Richard> matter of setting appropriate configuration macros. The Richard> only time that it can get tricky is if none of the Richard> standard object file formats (a.out, COFF and it's Richard> variants, Rose, or ELF) are used and there is also a Richard> problem with using the system's assembler. I do not know Richard> if NT has these problems, but we've been running into them Richard> on OS/2. -- ---------- Joe Hildebrand Fuentez Systems Concepts hildjj@fuentez.com 11781 Lee-Jackson Hwy, Suite 700 Software Engineer Fairfax, VA 22033 Phone: (703)273-1447 Fax: (703)273-2972 Standard disclaimers apply