[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: access to hppa machine to work on Bug#558980



Carlos O'Donell wrote:
> On Sun, Dec 13, 2009 at 10:03 AM, Stephen Leake wrote:
>> Frans Pop gave me access to his machine. I have some more information
>> on the bug.
>>
>> If I compile from full GNADE source (not using the GNADE dynamic or
>> static libraries), the code works.
> 
> What does "from full GNADE source" mean?

I think that means "recompile the application program and the sources of
the library into a single, statically-linked program" as opposed to
"compile the library sources, create a (static|shared) library and link
into the executable".

[...]
>> With the static library, I get a stack overflow (caught and reported
>> by the Ada runtime), during elaboration of a compiler-provided
>> container library.
> 
> Could you please define "during elaboration?"

It seems only Ada programmers know about elaboration :)

In a nutshell, elaboration is all that happens between the transfer of
control from the dynamic loader to the executable and the start of
execution of the main subprogram (main() in C and C++, anything in Ada). 
Elaboration consists in allocating and initialalizing nonstatic global
variables, i.e. those declared outside of any subprogram but whose value is
unknown at compile time.  This might involve calling user-defined functions
that return the initial value of a variable.  Subprograms and Ada packages,
too, are elaborated; their elaboration consists only in making sure all the
global variables and other subprograms they depend on are already
elaborated.  Example:

-*- mode: c -*-
#include <stdlib.h>
int i = foo ();
int main () { puts ("this is called after elaboration\n"); return i; }
int foo () { puts ("this is called during elaboration\n"); return rand ();
}

The example illustrates the importance of controlling elaboration order. In
this case, i must be elaborated before main() is called but after puts()
and rand () are elaborated.

Ada offers precise control of elaboration order and the compiler can report
the elaboration order it has chosen for a given executable program.

-- 
Ludovic Brenta.



Reply to: