comp.lang.ada
 help / color / mirror / Atom feed
From: Tom <tomahawkins@gmail.com>
Subject: Using GNAT in a C and assembly toolchain
Date: Mon, 3 May 2010 22:03:52 -0700 (PDT)
Date: 2010-05-03T22:03:52-07:00	[thread overview]
Message-ID: <bdef2689-1218-422a-a9e8-0bf574076809@b18g2000yqb.googlegroups.com> (raw)
In-Reply-To: m2zl0gkjdq.fsf@pushface.org

On May 3, 12:03 pm, Simon Wright <si...@pushface.org> wrote:
> I think your problem may be that your host compiler is an older version
> (4.4.3) than the source tree you're using to build the cross compiler
> (4.5.0). The recommendation is to build the host compiler first, then
> use that to build the cross.
>
> The symbols you're missing are (in 4.5.0 but not in 4.3.4, the only
> handy version I have for comparison) defined in adaint.c, and it looks
> as though adaint.o is being picked up from the pre-built host libraries
> (not surprising, the cross-compiler has to run on the host so needs to
> use host file attributes etc).

Thanks Simon.  That did the trick.  I now have a functioning Ada cross
compiler; I just need to learn how to use it.  I could use a few
pointers to get me started...

On our particular application -- an automotive ECU -- we're locked
into a proprietary C-based flow.  The operating system and hardware
abstraction layer come precompiled and the application code must be
compiled and linked with the established tool chain (GHS C, not Ada).
The application programmer defines a procedure, which is invoked by
the OS as a periodic rate.  This procedure references global C
variables to access the hardware abstraction layer.

The question is how can I best use Ada and GNAT in such an
environment?  One method that comes to mind is to compile Ada to
assembly code, which is then passed to GHS for assembling and linking
with the closed source OS and HAL.  I don't see an assembly switch,
like GCC's -S.  Would this mean I would need the compile Ada modules
individually with GCC instead of using gnatmake?  Are there any
options to compile Ada down to C by chance?

And how does gnatbind fit into this picture?  It appears to create
initialization code.  Would I just need to insert this code such that
it is invoked at power up?

-Tom



  reply	other threads:[~2010-05-04  5:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-03 15:04 Building GNAT Tom
2010-05-03 17:03 ` Simon Wright
2010-05-04  5:03   ` Tom [this message]
2010-05-04 19:50     ` Using GNAT in a C and assembly toolchain Simon Wright
2010-05-04 22:04       ` Randy Brukardt
2010-05-05  2:10       ` Robert A Duff
2010-05-05  7:54         ` sjw
2010-05-05  5:52       ` Tom
replies disabled

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