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