>     Hello all, and ADA hackers in particular :-)

Ada, not ADA, that's not an acronym but a name, see http://www.adaic.org

>   However the main issues I've been having trouble with show up when I try
> and run the testsuite.
>
>   The first problem I ran into was total failure to throw and catch
> exceptions in ADA, failing with a SEGV every time.  It wasn't enough to
> just set EH_MECHANISM=-gcc in the target-specific section of
> gcc/ada/Makefile.in; I found that lots of the ada runtime had been compiled
> without EH frame data, so the unwinder couldn't throw through them and just
> blew up at runtime.

Yes, an annoying merge glitch.  The safest approach is probably to revert the 
EH_MECHANISM change, on the 4.3 branch at least.  This change is pre-approved 
if you get a working Ada compiler with it.

>   So I added "T_ADA_CFLAGS=-fexceptions" to the target clause in
> Makefile.in as well, but that seems wrong to me: surely the build system
> ought to do that already?

Neither, this is done automatically by the compiler, like in C++.

>   I also tried manually setting ZCX_By_Default to true in the
> system-$target.ads, and even then I was getting similar crashes to the
> above, because some of the library .o files still contained no DW2 eh_frame
> tables, which blows up at runtime when you throw.

Yes, ZCX_By_Default would have needed to be set to true in conjunction with 
the EH_MECHANISM change, the settings are coupled.

>   Next problem I ran into was this:
>
> ------------------------------------<snip>---------------------------------
>--- === acats support ===
> Generating support files...error: "macrosub.adb" must be recompiled
> ("system.ads" has been modified)
> error: "defs.ads" must be recompiled ("system.ads" has been modified)
> error: "getsubs.adb" must be recompiled ("system.ads" has been modified)
> error: "parsemac.adb" must be recompiled ("system.ads" has been modified)
> error: "s-stalib.adb" and "macrosub.adb" compiled with different exception
> handling mechanisms
> error: "a-except.adb" and "macrosub.adb" compiled with different exception
> handling mechanisms
>                    [ ... snip many more ... ]
> ------------------------------------<snip>---------------------------------
>---
>
>   I think it might be that this arises because the GNAT I'm using to
> bootstrap was configured for sjlj EH, and I'm trying to build one
> configured for ZCX.

Yes, very likely.

> 1.  Is it supposed to work to bootstrap gnat with a compiler using a
> different EH model from the one you're trying to build?

Yes, I think so.

> 2.  Where it uses the host compiler, would it be ok to use the newly-built
> target one instead if host==target, i.e. not a cross compiler?

Yes, probably.

> 3.  Should I have needed to add -fexceptions, and if not, why not?

No, see above.

-- 
Eric Botcazou

Reply via email to