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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.50.82.100 with SMTP id h4mr33845506igy.9.1433968566394; Wed, 10 Jun 2015 13:36:06 -0700 (PDT) X-Received: by 10.140.48.11 with SMTP id n11mr95359qga.35.1433968566269; Wed, 10 Jun 2015 13:36:06 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!h15no1243693igd.0!news-out.google.com!k20ni414qgd.0!nntp.google.com!q107no463487qgd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 10 Jun 2015 13:36:06 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=105.210.1.171; posting-account=orbgeAkAAADzWCTlruxuX_Ts4lIq8C5J NNTP-Posting-Host: 105.210.1.171 References: <6d5f352b-d886-4cd4-8f88-4116fe34129a@googlegroups.com> <4bc35d01-158d-48bb-b241-d4e3c3ce4344@googlegroups.com> <373a8c7e-8538-4de3-9647-dead707b8a88@googlegroups.com> <1e1e5cf8-5535-4e9f-9d85-261466ad9ce2@googlegroups.com> <295e0eb8-4779-4c72-ba98-3fb0c507640d@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: gnat compiler issues with a partial build From: jan.de.kruyf@gmail.com Injection-Date: Wed, 10 Jun 2015 20:36:06 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:26262 Date: 2015-06-10T13:36:06-07:00 List-Id: On Wednesday, June 10, 2015 at 7:01:26 PM UTC+2, Simon Wright wrote: >=20 > > You need to be careful about the Ada features you use in the RTS. Stick > > to Ada95, only include packages under Ada, Interfaces, and GNAT. >=20 > and of course System. Yes Simon, but this is not where the problem originates. Sure this is how i= t should be done once a person gets there, but at the moment I am still try= ing to find out how to proceed from "bare metal Ada" with no runtime at all= to some small runtime that will work in the kernel. So for the time being I have the "runtime" as part of the project and I bas= ically use the ada compiler as a "small language compiler" without all the = trappings. Now the gnat compiler looks for certain symbols (read: routines to call) wh= en it is compiling. Example: for NEW it needs "__gnat_malloc" to get some m= emory from the pool or heap. So there will a 'U __gnat_malloc' in the object file for any package where = you asked for 'NEW' In your runtime the 'System.Memory' package has=20 pragma Export (C, Alloc, "__gnat_malloc"); And in the final full linking phase these two are matched, and your program= will call that routine when it needs memory off the heap. This holds true for all Unknown symbols the compiler spits out. They will b= e found either in the runtime, and then you can find them back in the adain= clude directory with grep. Or they are in some included systemlib. So that is why it is important not to have systemlib calls in a setup where= there are no system libs. And note on the side: I do not know if finalizat= ion perhaps needs some system lib! So the bottom line is that if an unknown symbol is not "Pragma Exported" fr= om the adainclude packages then you cannot use it if you have no systemlibs= . So then it is a feature in the language that cannot be used in that specifi= c setup. My issue is that no matter what I do in native, the compiler produces some = unknown symols that _are_ exported by the full native runtime, but _not_ by= zfp or ravenscar (but those are for small controllers in the gnat wold) And Mark L found out that the arm cross compiler does not produce them, oth= erwise he would have unresolved symols which he has not.=20 So I think this is at the moment the road to follow. Find out how the arm c= ross compiler compiles differently from the native compiler. cheers, bedtime now. j.