From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,5f14691e88205f0c X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!b18g2000yqb.googlegroups.com!not-for-mail From: Tom Newsgroups: comp.lang.ada Subject: Using GNAT in a C and assembly toolchain Date: Mon, 3 May 2010 22:03:52 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 173.29.157.41 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1272949432 8532 127.0.0.1 (4 May 2010 05:03:52 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 4 May 2010 05:03:52 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: b18g2000yqb.googlegroups.com; posting-host=173.29.157.41; posting-account=cl5BOgoAAABrMbXC_XIqL102qJaIFR34 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:11308 Date: 2010-05-03T22:03:52-07:00 List-Id: On May 3, 12:03=A0pm, Simon Wright 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