comp.lang.ada
 help / color / mirror / Atom feed
* Answers for Ludovic Brenta and Georg Bauhaus (Re: ada compiler?)
@ 2007-11-15  9:33 anon
  2007-11-15 10:23 ` Georg Bauhaus
  0 siblings, 1 reply; 2+ messages in thread
From: anon @ 2007-11-15  9:33 UTC (permalink / raw)


1. The best way set "-fstack-check" as a default to install the gcc 
   source tree. And as many language packages as you want to 
   default using "-fstack-check". I would say skip JAVA for now.

2. Check for current GNAT or upgrade to GNU GPL version if needed 

3. Configure gcc system as normal with this extra option added 

  --enable-fstack-check

aka

  ../source/configure --enable-fstack-check <other options> 


4. Build GCC system the normal way as describe in manual or the way 
   you like, may be in stages. 

Note: This way, the complete language packages define in the configure 
'--enable-language="c,ada,..."' will be set to use stack checking. As 
for Java you might want to skip this, since the "-fstack-check" routines 
does slow down the execution and JAVA is slow enough. For languages, 
that you want to use without the "stack-check" rebuild in another 
directory the normal way.

The other way I stated only modifies the 'gnat1' but a lot of people here 
may get upset if I show you those instructions. So, you can skip <part 1> 
from the other post. 

Now, the '-fstack-check' add the following three statements to the start 
of each routine.

;        Assembly (x86)       

	leal -4392(%esp),%eax
	pushl %eax              
	call __gnat_stack_check 


--  or the Ada version
    AX := Stack - 4392 ;    --  Insure routine has at least 4392 stack size
    stack_check ( AX )  ;    --  returns if AX is valid stack location 
                               --  else result in Storage_Error exception

Note: the initial constant 4392 may be a different value on other 
systems. 

The 'Stack_Check' function can be found in 
System.Stack_Checking.Operations.Stack_Check function 
defined in the s-stchop.adb file. 


For GNAT RTS, there are 4 packages, that deal with the stacks.

System.Secondary_Stack           => s-secsta.ad?
System.Stack_Usage               => s-stausa.ad?
System.Stack_Checking            => s-stache.ad?
System.Stack_Checking.Operations => s-stchop.ad? -- core routines







^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-11-15 10:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-15  9:33 Answers for Ludovic Brenta and Georg Bauhaus (Re: ada compiler?) anon
2007-11-15 10:23 ` Georg Bauhaus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox