From: anon@anon.org (anon)
Subject: Re: What are the limitations imposed by GNAT without runtime?
Date: Tue, 09 Oct 2007 20:10:39 GMT
Date: 2007-10-09T20:10:39+00:00 [thread overview]
Message-ID: <3fROi.657455$p47.348852@bgtnsc04-news.ops.worldnet.att.net> (raw)
In-Reply-To: 1191947316.791605.8420@50g2000hsm.googlegroups.com
-- The "Non Ada standard" aka the "GNAT obsolete" pragma statement
-- ( chapter 14.1 from the GNAT_RM.xxx )
pragma No_Run_Time ;
-- removes a number of RTL packages at link time but it also direct
-- the compiler that these packages are no longer available. Such as
-- "Ada.Text_IO" as well as some attributes/constructs such as
-- "Image". So, when you use such attributes/constructs or RTL
-- packages you will receive a compiler error, because you will have
-- to build these in your RTL or a replacement routine.
--
-- As I suggest before look at those project, because they have had
-- some of the same problems that you will run into and you can use
-- their code to see how they solve the problem.
--
--
-- Before begin this great task you need to know the complete features
-- of Ada, the compiler and its limitations, the computer system, the
-- processor assembly language as well as the hardware that is
-- installed. Also, with GCC 4.x Adacore altered the GNAT compiler for
-- its Ada 2005 specification by adding some componts that can cause
-- problems in creating Stand-Alone code such as a Kernel.
--
procedure Kernel is
type Wah is ( One, Two ) ;
-- ------------------------------------------------ --
-- Simple function replaces the Image attribute for --
-- Wah type --
-- ------------------------------------------------ --
function Image_Wah ( V : Wah ) return String is
begin -- Image_Wah
if V = One then
return "One" ;
else
return "Two" ;
end if ;
end Image_Wah ;
S : String := Image_Wah ( Wah'First ) ;
begin
null ;
end Kernel ;
In <1191947316.791605.8420@50g2000hsm.googlegroups.com>, Lucretia <lucretia9@lycos.co.uk> writes:
>Hi,
>
>I have just tested this again and it seems to work. Basically,
>configure gnat with --target=i386-elf, build, it stops failing cos
>there is no runtime. You can install and it gives you a gnat1 compiler
>in libexec/gcc/i386-elf/4.2.2/ and gnatbind in bin/.
>
>You have to copy the basic system.ads file from the source archive to
>lib/gcc/i386-elf/4.2.2/adainclude/.
>
>This then allows you can use i386-elf-gcc -c to compile source files.
>You can also use i386-elf-ld to link provided you supply a linker
>script and you'll also need some startup code.
>
>So, as a test I put the following code through the compiler just to
>see if it compiled:
>
>pragma No_Run_Time; -- This isn't in the manual, and I vaguely
>remember something about it being removed, no errors/warnings though.
>
>procedure Kernel is
>
> type Wah is (One, Two);
>
> S : String := Wah'Image(Wah'First);
>
>begin
> null;
>end Kernel;
>
>gives the following error:
>
>kernel.adb:7:20: construct not allowed in configurable run-time mode
>
>What does this mean?
>
>So, apart from tasking and exceptions, what other language constructs
>cannot be used in this mode?
>
>Thanks,
>Luke.
>
>P.S: I'll try not to be sarcastic ;D
>
next prev parent reply other threads:[~2007-10-09 20:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-09 16:28 What are the limitations imposed by GNAT without runtime? Lucretia
2007-10-09 20:10 ` anon [this message]
2007-10-10 4:39 ` Simon Wright
2007-10-10 10:07 ` Lucretia
2007-10-10 10:04 ` Lucretia
2007-10-10 17:51 ` anon
2007-10-10 19:00 ` Lucretia
2007-10-10 19:24 ` Lucretia
2007-10-11 3:05 ` anon
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox