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.182.236.197 with SMTP id uw5mr12128925obc.32.1434039028972; Thu, 11 Jun 2015 09:10:28 -0700 (PDT) X-Received: by 10.140.80.168 with SMTP id c37mr155651qgd.39.1434039028866; Thu, 11 Jun 2015 09:10:28 -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!h15no1662533igd.0!news-out.google.com!4ni659qgh.1!nntp.google.com!z60no661909qgd.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 11 Jun 2015 09:10:28 -0700 (PDT) In-Reply-To: <6d5f352b-d886-4cd4-8f88-4116fe34129a@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=217.251.238.50; posting-account=mOyWBQoAAAD7S-NBmMUOr9hRClcL0vqR NNTP-Posting-Host: 217.251.238.50 References: <6d5f352b-d886-4cd4-8f88-4116fe34129a@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <15483248-927d-4f25-a399-1a722e60a9b2@googlegroups.com> Subject: Re: gnat compiler issues with a partial build From: rrr.eee.27@gmail.com Injection-Date: Thu, 11 Jun 2015 16:10:28 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:26268 Date: 2015-06-11T09:10:28-07:00 List-Id: On Thursday, June 4, 2015 at 1:12:27 PM UTC+2, jan.de...@gmail.com wrote: > First the good news: I was able to load and unload a mixed C and Ada kern= el module last night for the first time. >=20 > But I think I found a subtle problem in the compiler (gnat-gcc 4.7.4) whi= le doing my Linux kernel module. >=20 > ------------------------------------- > 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 > ------------------------------------- >=20 > They are all related to the Exception machinery and refer to about 4 or 5= symbols in "Ada.Exeptions" in the standard "x86 Linux" runtime. > They are caused by any construct where the compiler suspects that there m= ight be a runtime error under certain conditions. And they have to do with = exception propagation I suspect, from looking at a disassembly. > The bottom line is that, no-matter what I all switch off, the compiler so= metimes emits random subroutine calls in its error detection section. Norma= lly they don't bite you, because you would almost never hit them in a well = constructed program. But a kernel module with those simply will not load; e= nd. >=20 > The only vague reference to such a scenario might be in the "-gnatp" desc= ription in the gnat_ug. >=20 > So if any of the compiler theologians has any light on this: please feel = welcome to comment. The symbol shown (__gnat_rcheck_CE_*) is generated for language required ru= n time checks. Here it is an access check. They typically are range checks. These checks are generated if you don't suppress them via -gnatp regardless= of the capabilities of the RTS. Your coding style and the compiler switche= s must match the RTS capabilities. You don't suppress the run time checks b= y a pragma Restriction only, you also have to set the command line option -= gnatp. In another post you said that you don't wanted to use -gnatp as that would = be like coding in C. That is not my experience at all! The compiler still = does a fantastic job at compile time to ensure range and access properties.= Gnat found quite some subtle errors in my code even with checks suppressed= (-gnatp). RE