comp.lang.ada
 help / color / mirror / Atom feed
From: Lucretia <laguest9000@googlemail.com>
Subject: Re: Cross-toolchain for DS [was: Newcomers to comp.lang.ada: welcome and how did you end up here ?]
Date: Sun, 12 Oct 2014 16:18:22 -0700 (PDT)
Date: 2014-10-12T16:18:22-07:00	[thread overview]
Message-ID: <0ec29b17-286e-49c3-a26c-88e5161ebda4@googlegroups.com> (raw)
In-Reply-To: <slrnm3l1rs.nrc.lithiumcat@nat.rebma.instinctive.eu>

On Sunday, 12 October 2014 14:52:04 UTC+1, Natasha Kerensikova  wrote:
> Hello,
> 
> On 2014-10-12, Luke A  Guest wrote:
> 
> > I wouldn't use that patch. When I get home I'll explain it and why you
> > don't want to use it and I'll show you a better way.
> 
> I'm looking forward to it.

Right, this is all from memory and I'll be referencing this https://github.com/Lucretia/tamp/blob/master/thirdparty/patches/gcc-4.6.1/gcc-4.6.1.diff file.

In the adaint.c file, I'm essentially making various functions available to the runtime for targets where __arm__ and __ELF__ preprocessor symbols are defined. This is so the runtime will link properly. I'm also returning default valus where they don't exist.

In gcc-interface/Makefile.in I add a ifdef block to check if the target we want is arm-eabi-elf and if so, define what runtime packages are used in building the tools, including the all important system.ads. In this block I mention that TOOLS_TARGET_PAIRS is mentioned within that file, but not used. This is a lack of cleanup from the gcc guys when they moved the building of the runtime to gcc-x.x.x/gnattools directory - and yeah, it's really confusing that it's still there.

Provided an entire mlib-tgt-specific-bare.adb which isn't required anymore as there is a specific version for bare metal runtimes now included in FSF GCC sources. This is the mlib-tgt-specific-xi.adb file.

Need to add system-bare-armel.ads, which is just an edit of one of the other system-*.ads files.

As mentioned above, gnattools/configure, is where the TOOLS_TARGET_PAIRS are now defined, so I added a case selection for arm-eabi-elf, this then tells teh configure script which mlib-tgt-specific-* file to use to build the gnat tools. This file defines whether you have dynamic linking for example, for bare metal compilers, static is all you get and this is what the *xi* specific package provides. Repeated for the .ac files.

The above provides a way to build that specific target without messing too much with the build infrastructure. This also builds a runtime, which is completely pointless and will never be used. This is not the way Rolf does it for AVR and subsequently Brian Drummond for MSP430, see the thread here https://gcc.gnu.org/ml/gcc/2014-01/msg00139.html and this is because they break the build by removing the dependency of libada on gnattools from the main configure script.

The idea really is to be able to turn off the build of the runtime when the target is something like *-elf or *-coff where there is no OS and therefore no libc. My last version (and this almost works cleanly) is referenced from here https://gcc.gnu.org/ml/gcc/2014-02/msg00205.html (finally found it!)

In that set of patches, I added the gnattools/configure patch like before but generalised for targets that are matched by "*-*-elf* | *-*-eabi*" and point to the mlib-tgt-specific-xi.adb.

Added a new flag to the main configure script --enable-cross-gnattools which essentially does what the AVR/MSP hack does, but in a non-destructive way, in other words, you can still build a normal hosted compiler with this patched source (never tested) as well a cross compiler with no rts but with gnattools.

That's all there was to those patches. Easy. You just need to supply your own RTS which you compile yourself, see tamp for a gpr based one. Also, see the above link on that last patch as I explain that for some reason you cannot build cleanly, for some reason the build stops, you have to clear a stamp file then restart, it's fiddly, but I'd like to get it to a point where it works cleanly and can be submitted back to FSF for inclusion. If anyone knows configure scripts better than me, can you apply it and check it to see what I've missing?

Thanks.
Luke A. Guest.


  parent reply	other threads:[~2014-10-12 23:18 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-06 22:42 Newcomers to comp.lang.ada: welcome and how did you end up here ? Simon Clubley
2014-10-06 23:18 ` brbarkstrom
2014-10-07  8:10 ` Gour
2014-10-07 10:49   ` Luke A. Guest
2014-10-08  7:23     ` Gour
2014-10-08  8:35       ` Brian Drummond
2014-10-08  9:15         ` Simon Wright
2014-10-08 19:14           ` -fdump-ada-spec (was: Newcomers to comp.lang.ada: welcome and how did you end up here ?) Ludovic Brenta
2014-10-08 19:48             ` -fdump-ada-spec Simon Wright
2014-10-08  9:17         ` Newcomers to comp.lang.ada: welcome and how did you end up here ? Gour
2014-10-08 11:23       ` Dmitry A. Kazakov
2014-10-10  9:18         ` Gour
2014-10-08 13:33       ` Luke A. Guest
2014-10-07 20:06 ` Stribor40
2014-10-07 20:21   ` Jeffrey Carter
2014-10-07 21:28     ` David Botton
2014-10-09  5:57       ` Dirk Craeynest
2014-10-10  0:58     ` rriehle
2014-10-08  7:08   ` Dmitry A. Kazakov
2014-10-09 11:58 ` Mark Carroll
2014-10-09 13:31   ` Simon Wright
2014-10-09 18:04     ` Brian Drummond
2014-10-09 20:02       ` Dmitry A. Kazakov
2014-10-09 18:35     ` Mark Carroll
2014-10-09 21:08       ` Simon Clubley
2014-10-10  7:28         ` Natasha Kerensikova
2014-10-10  9:07           ` Mark Carroll
2014-10-10  9:33             ` Björn Lundin
2014-10-10 11:41               ` Natasha Kerensikova
2014-10-10 13:35                 ` Björn Lundin
2014-10-10 17:10                   ` Natasha Kerensikova
2014-10-10 18:22                     ` Luke A. Guest
2014-10-10 14:51                 ` Lucretia
2014-10-10 14:28           ` Lucretia
2014-10-10 19:47           ` Simon Clubley
2014-10-10 21:38             ` Luke A. Guest
2014-10-12 10:56               ` Cross-toolchain for DS [was: Newcomers to comp.lang.ada: welcome and how did you end up here ?] Natasha Kerensikova
2014-10-12 11:40                 ` Simon Clubley
2014-10-12 12:27                   ` Peter Chapin
2014-10-12 19:42                     ` Simon Clubley
2014-10-12 13:25                 ` Luke A. Guest
2014-10-12 13:52                   ` Natasha Kerensikova
2014-10-12 14:40                     ` Luke A. Guest
2014-10-12 20:09                     ` Natasha Kerensikova
2014-10-19 14:34                       ` Natasha Kerensikova
2014-10-19 15:48                         ` Luke A. Guest
2014-10-23  8:22                           ` Natasha Kerensikova
2014-10-12 23:18                     ` Lucretia [this message]
2014-10-15  9:46                       ` Brian Drummond
2014-10-15 16:50                         ` Lucretia
2014-10-15  9:58                 ` Brian Drummond
2014-10-15 10:32                   ` Natasha Kerensikova
2014-10-16 12:04                     ` Brian Drummond
2014-10-11 10:53             ` Newcomers to comp.lang.ada: welcome and how did you end up here ? Brian Drummond
2014-10-12  1:33         ` David Botton
2014-10-12  1:25       ` David Botton
2014-10-12 14:40         ` Luke A. Guest
2014-10-09 19:06   ` Shark8
2014-11-04 16:28   ` Nicholas Collin Paul de Gloucester
2014-11-04 16:45     ` Barry Danforth
2014-11-04 17:18       ` David Botton
2014-10-09 12:50 ` john
2014-10-09 21:08 ` gdotone
2014-10-10 16:25 ` Stribor40
2014-10-10 17:09   ` Luke A. Guest
2014-10-10 17:59     ` Stribor40
2014-10-10 18:22       ` Luke A. Guest
2014-11-08 23:51 ` HerrDoktor
2014-11-09  7:44   ` Karl Stromberg
2014-11-09  9:28     ` HerrDoktor
2014-11-09  9:42     ` HerrDoktor
2014-11-09  9:59       ` Karl Stromberg
2014-11-09 10:25         ` HerrDoktor
2014-11-09 16:31           ` David Botton
2014-11-09 16:29         ` David Botton
replies disabled

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