This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR ada/66205 gnatbind generates invalid code when finalization is enabled in restricted runtime
- From: Arnaud Charlet <charlet at adacore dot com>
- To: Simon Wright <simon at pushface dot org>
- Cc: gcc-patches at gcc dot gnu dot org, Eric Botcazou <botcazou at adacore dot com>, Pierre-Marie de Rodat <derodat at adacore dot com>
- Date: Tue, 19 Dec 2017 09:40:30 +0100
- Subject: Re: [PATCH] PR ada/66205 gnatbind generates invalid code when finalization is enabled in restricted runtime
- Authentication-results: sourceware.org; auth=none
- References: <7942AA17-3258-4B36-8B93-35C0574583AA@pushface.org> <E8542217-EDC5-48AE-B087-F49528CF4AD1@pushface.org> <666D196C-C248-45B3-A20F-138CE6B00457@pushface.org> <20151112100205.GA9491@adacore.com> <F37044CA-476B-488D-8C3C-EB6E0DE799FA@pushface.org> <146E92A8-A4E2-420F-A83D-92A585E32A2A@pushface.org> <B1D23A9E-1B6B-47AD-90D8-138B3A162507@pushface.org>
Simon,
Unfortunately we've discovered that your patch is causing unexpected
consequences and break e.g. testing of ravenscar application, where
although the Ada RM requires no task termination, for practical
purposes, waiting for terminating task is something we rely upon for
automatic testing, so your patch is suitable after all, sorry about
the oversight.
After internal discussions at AdaCore, it appears that if you want
Finalization, you chould set Suppress_Standard_Library_On_Target to
False. All your troubles come from the fac tthat you tries to stick to
Suppress_Standard_Library_On_Target set to True, but this combination
(Suppress_Standard_Library_On_Target set to True, and Finalization enabled)
is simpled not supported in the GNAT runtime, and the binder doesn't
expect it either.
So I'm going to revert your change in bindgen.adb and will let you
experiment with setting Suppress_Standard_Library_On_Target to False in
your system.ads. This is what we do in e.g.. our ravenscar-full runtime
which supports precisely both ravenscar tasking, and finalization (among other
things), on bare metal targets, which seems to correspond to what you are
trying to do.
Arno
> gcc/ada/Changelog:
>
> 2017-12-05 Simon Wright <simon@pushface.org>
>
> PR ada/66205
> * bindgen.adb (Gen_AdaFinal): If the restriction
> No_Task_Termination is present, generate a null body.