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.43.127.4 with SMTP id gy4mr20245710icc.11.1434119840732; Fri, 12 Jun 2015 07:37:20 -0700 (PDT) X-Received: by 10.140.47.68 with SMTP id l62mr228949qga.42.1434119839603; Fri, 12 Jun 2015 07:37:19 -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!h15no2185674igd.0!news-out.google.com!k20ni1182qgd.0!nntp.google.com!z60no831543qgd.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 12 Jun 2015 07:37:19 -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> <15483248-927d-4f25-a399-1a722e60a9b2@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <64744fbd-3519-4c0a-8e64-60f55ac4912d@googlegroups.com> Subject: Re: gnat compiler issues with a partial build From: jan.de.kruyf@gmail.com Injection-Date: Fri, 12 Jun 2015 14:37:19 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:26278 Date: 2015-06-12T07:37:19-07:00 List-Id: On Thursday, June 11, 2015 at 9:38:39 PM UTC+2, Simon Wright wrote: >=20 > > These checks are generated if you don't suppress them via -gnatp > > regardless of the capabilities of the RTS. >=20 > Yes, but if you have pragma Restrictions (No_Exception_Propagation) and > don't have an immediate handler the compiler will call > Last_Chance_Handler directly instead of the __gnat_rcheck* subprograms. right, I did some digging over lunch. The 'standard' gnat RTS builder, used elsewhere (which I probably copied fr= om the ZFP package without checking) builds an RTS with '-gnatpg'. This, it= appears, is what Adacore has taken as a standard way of doing things, if I= understand the compiler source right. And '-gnatp' indeed gets rid of the extra call-symbols. I cross-checked tha= t by compiling one of the problem sources in various ways. So Simon you were very right in saying that this is one of my alternatives. However, I am not Adacore. I am just a casual programmer that builds a smal= l RTS at odd times. moreover, I am not very precise. I need to test my doin= gs extensively. This means to me that I must get all the help I can with fi= nding my bugs. (You can never prove they are absent, only that they are pre= sent). so then, I do not know how Adacore manages this, but it is a poor solution = for me to just switch of runtime-checks for a first build of an RTS. (or in= my case the files that eventually will constitute the RTS) Ergo, I must put in dummies that trap those calls, and give some indication= of what is happening. (Which is exactly what I did). > Yes, but if you have pragma Restrictions (No_Exception_Propagation) and= =20 > don't have an immediate handler the compiler will call=20 > Last_Chance_Handler directly instead of the __gnat_rcheck* subprograms.= =20 That is exactly the part that does not work. I have been through that now o= ver and over with a nit comb. In any case the whole issue is now documented in some way for whoever comes= after us. -- Besides I managed to get rid of the cruft in the building process of a part= ial compile for this kernel module that caused all this: In the project file I now heave this: --------------------------------------- package Builder is Global_Configuration_Pragmas :=3D "gnat.adc"; for Default_Switches ("ada") use ("-g", "-nostdlib", "--RTS=3D" & Project'project_dir); for Executable ("demo.adb") use "demo.x"; end Builder; --------------------------------------- the "-nostdlib" flag here causes the link process to forget about any regul= ar libraries. In any other place (like in the linker package) did not work.= Maybe I made a mistake then, I could not tell anymore. The RTS points to nothing, because the lib is missing there. The partial link file "demo.x" I use in the module building process downstr= eam. ---------------------------------------- package Linker is for Default_Switches ("Ada") use ("-v", "-Xlinker","-r");=20 end Linker; ---------------------------------------- the "-Xlinker","-r" passes '-r' to the linker program and causes a partial = link. Works like a dream now. So thank you for your listening ear gentlemen. I highly appreciate it. This type of interaction is for me often the only way to get out of a dark = spot. cheers, j.