This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [Ada] no run-time compilation (was: Clean up No_Run_Time tests in exp_ch4.adb)
- From: Laurent GUERBY <laurent at guerby dot net>
- To: Arnaud Charlet <charlet at adacore dot com>
- Cc: gcc at gcc dot gnu dot org, Robert Dewar <dewar at adacore dot com>
- Date: Fri, 28 Mar 2008 23:12:40 +0100
- Subject: Re: [Ada] no run-time compilation (was: Clean up No_Run_Time tests in exp_ch4.adb)
- References: <20080327074846.GA4899@adacore.com> <1206655109.15075.984.camel@localhost> <20080328074425.GA31472@adacore.com> <1206690693.15075.994.camel@localhost> <20080328075641.GA32833@adacore.com> <1206704726.15075.1003.camel@localhost>
On Fri, 2008-03-28 at 12:45 +0100, Laurent GUERBY wrote:
> On Fri, 2008-03-28 at 08:56 +0100, Arnaud Charlet wrote:
> > > Is there a replacement for it?
> >
> > You can configure manually a self made run-time by setting flags
> > (e.g. Configurable_Run_Time and Suppress_Standard_Library) in system.ads
>
> Thanks! Is there a list of the minimal set of "run-time" files
> one has to keep around when building such a run-time (apart
> from system.ads)?
Answering my own question after a few experimentation, assuming an Ada
compiler in PATH (tested with 4.3.0 on x86_64-linux):
$ mkdir build
$ cd build
# copy gcc/src/ada/system.ads and s-maccod.ads locally, chmod 644
# edit system.ads
$ diff -U 0 system.ads_orig system.ads
--- system.ads_orig 2008-03-28 21:23:35.000000000 +0100
+++ system.ads 2008-03-28 21:23:27.000000000 +0100
@@ -131 +131 @@
- Configurable_Run_Time : constant Boolean := False;
+ Configurable_Run_Time : constant Boolean := True;
@@ -150 +150 @@
- Suppress_Standard_Library : constant Boolean := False;
+ Suppress_Standard_Library : constant Boolean := True;
$ cat > a.ads
procedure A;
pragma Export (C, A, "_start");
$ cat > a.adb
with System.Machine_Code; use System.Machine_Code;
procedure A is
NL : constant String := ASCII.LF & ASCII.HT;
begin
Asm (Template => "movl $1,%%eax" & NL
& "movl $42,%%ebx" & NL
& "int $0x80",
Outputs => No_Output_Operands,
Inputs => No_Input_Operands,
Clobber => "",
Volatile => True);
end A;
$ cat > gnat.adc
pragma Restrictions (No_Elaboration_Code, No_Exception_Handlers);
$ gnatmake -f -a -c -nostdinc -nostdlib -g -Os a
$ gcc -g -nodefaultlibs -nostdlib -nostartfiles -o a a.o
$ objdump -S a
$ ./a
$ echo $?
Laurent