From: jan.de.kruyf@gmail.com
Subject: Re: gnat compiler issues with a partial build
Date: Fri, 12 Jun 2015 07:37:19 -0700 (PDT)
Date: 2015-06-12T07:37:19-07:00 [thread overview]
Message-ID: <64744fbd-3519-4c0a-8e64-60f55ac4912d@googlegroups.com> (raw)
In-Reply-To: <lyoakmkpc1.fsf@pushface.org>
On Thursday, June 11, 2015 at 9:38:39 PM UTC+2, Simon Wright wrote:
>
> > These checks are generated if you don't suppress them via -gnatp
> > regardless of the capabilities of the RTS.
>
> 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 from 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 that 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 small RTS at odd times. moreover, I am not very precise. I need to test my doings extensively. This means to me that I must get all the help I can with finding my bugs. (You can never prove they are absent, only that they are present).
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
> don't have an immediate handler the compiler will call
> Last_Chance_Handler directly instead of the __gnat_rcheck* subprograms.
That is exactly the part that does not work. I have been through that now over 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 partial compile for this kernel module that caused all this:
In the project file I now heave this:
---------------------------------------
package Builder is
Global_Configuration_Pragmas := "gnat.adc";
for Default_Switches ("ada") use
("-g", "-nostdlib",
"--RTS=" & Project'project_dir);
for Executable ("demo.adb") use "demo.x";
end Builder;
---------------------------------------
the "-nostdlib" flag here causes the link process to forget about any regular 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 downstream.
----------------------------------------
package Linker is
for Default_Switches ("Ada") use ("-v", "-Xlinker","-r");
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.
next prev parent reply other threads:[~2015-06-12 14:37 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-04 11:12 gnat compiler issues with a partial build jan.de.kruyf
2015-06-04 19:03 ` Lucretia
2015-06-09 8:11 ` jan.de.kruyf
2015-06-09 10:21 ` Mark Lorenzen
2015-06-09 11:28 ` jan.de.kruyf
2015-06-09 13:03 ` Mark Lorenzen
2015-06-09 18:57 ` jan.de.kruyf
2015-06-10 10:11 ` Mark Lorenzen
2015-06-10 15:34 ` jan.de.kruyf
2015-06-10 16:59 ` Simon Wright
2015-06-10 17:01 ` Simon Wright
2015-06-10 20:36 ` jan.de.kruyf
2015-06-11 5:01 ` Simon Wright
2015-06-11 14:08 ` jan.de.kruyf
2015-06-11 16:10 ` rrr.eee.27
2015-06-11 19:38 ` Simon Wright
2015-06-12 14:37 ` jan.de.kruyf [this message]
2015-06-12 15:05 ` Simon Wright
2015-06-12 15:12 ` jan.de.kruyf
2015-06-12 15:31 ` jan.de.kruyf
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox