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.42.10.15 with SMTP id o15mr4205851ico.6.1433416346596; Thu, 04 Jun 2015 04:12:26 -0700 (PDT) X-Received: by 10.140.22.199 with SMTP id 65mr139864qgn.15.1433416345470; Thu, 04 Jun 2015 04:12:25 -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!h15no219091igd.0!news-out.google.com!4ni184qgh.1!nntp.google.com!q107no44570qgd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 4 Jun 2015 04:12:25 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=105.210.0.212; posting-account=orbgeAkAAADzWCTlruxuX_Ts4lIq8C5J NNTP-Posting-Host: 105.210.0.212 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <6d5f352b-d886-4cd4-8f88-4116fe34129a@googlegroups.com> Subject: gnat compiler issues with a partial build From: jan.de.kruyf@gmail.com Injection-Date: Thu, 04 Jun 2015 11:12:25 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:26174 Date: 2015-06-04T04:12:25-07:00 List-Id: Hallo, Back from working hard :) First the good news: I was able to load and unload a mixed C and Ada kernel= module last night for the first time. But I think I found a subtle problem in the compiler (gnat-gcc 4.7.4) while= doing my Linux kernel module. I have been struggling for a while already with undefined random symbols tu= rning up in the symbol list of the partial Ada compile. And these then prog= ress to the module into the final build and link. (with the kernel module b= uild machinery, this is why I do a partial link of the Ada stuff). So last night they had all disappeared, but this morning after adding a tot= ally irrelevant module (sort of a little "hallo world" thing) one of them w= as back in a total different place, like this: (this is from the standard m= emory_copy in any runtime) ------------------------------------- jan@janDell:~/MMS/programs-KERNEL/ec-master/obj$ nm memory_copy.o U __gnat_rcheck_CE_Access_Check 0000000000000000 T memcpy 0000000000000000 D memory_copy_E ------------------------------------- They are all related to the Exception machinery and refer to about 4 or 5 s= ymbols in "Ada.Exeptions" in the standard "x86 Linux" runtime. They are caused by any construct where the compiler suspects that there mig= ht be a runtime error under certain conditions. And they have to do with ex= ception propagation I suspect, from looking at a disassembly. Now in an zfp runtime, any standard runtime references should be switched o= ff in the compiler, or else an alternative should be supplied in the custom= runtime. But both ravenscar and zfp (ex Adacore) do not cater for this eve= ntuality. Needless to say that I have been through all exception related pragmas and = restrictions. And I did make a 'gnat.adc' file that is duly noted in the pr= oject file. So that any pragmas are global. Other than that I have been through all the target parameters in the privat= e part of the System package in the runtime. By the way the documentation for those things is in "targparm.ads" in the g= cc source. The bottom line is that, no-matter what I all switch off, the compiler some= times emits random subroutine calls in its error detection section. Normall= y they don't bite you, because you would almost never hit them in a well co= nstructed program. But a kernel module with those simply will not load; end= . The only vague reference to such a scenario might be in the "-gnatp" descri= ption in the gnat_ug. So if any of the compiler theologians has any light on this: please feel we= lcome to comment. Besides that, I think I must just construct some dummy procedures for those= symbols, that put the module into eternal sleep, with a message of course= . Thanks, j.