http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48835

Mikael Pettersson <mikpe at it dot uu.se> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #24491|0                           |1
        is obsolete|                            |

--- Comment #23 from Mikael Pettersson <mikpe at it dot uu.se> 2011-07-14 
08:44:51 UTC ---
Created attachment 24753
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24753
working patch for gcc-4.5.3 (v4)

Here's the current working patch I'm using with gcc-4.5.3 on m68k-linux.  As
the diffstat shows

 gcc/ada/gcc-interface/Makefile.in |   28 ++++++
 gcc/ada/s-memory.adb              |   17 ++++
 gcc/ada/s-memory.ads              |    1 
 gcc/ada/system-linux-m68k.ads     |  153
++++++++++++++++++++++++++++++++++++++
 4 files changed, 198 insertions(+), 1 deletion(-)

not much is needed beyond the obvious target fragment in Makefile.in and the
new system-linux-m68k.ads.  The s-memory.ad{b,s} patches work around the
__gnat_malloc issue by adding a private Gnat_Malloc wrapper function that
returns a proper pointer, and changing the __gnat_malloc export to refer to
that function rather than the integer-returning Alloc function.  This should be
safe though unnecessary on other platforms (initially tested on i686).

If the special attribute is implemented, then what it needs to do is to say
that a particular integer-typed function (from Ada's perspective) should be
treated as returning the equivalent of C's void*, with unchecked conversions
inserted in the function's return points and in every caller.

In principle at least three functions need this treatment: __gnat_malloc,
__gnat_realloc, and system__soft_links__get_jmpbuf_address_soft.  However,
__gnat_realloc doesn't seem to be used by gnat itself, and ..get_jmpbuf..
doesn't appear to be needed for ZCX EH (I did have to patch get_jmpbuf_decl
related code earlier when I still used SJLJ EH).

Once my current final verification bootstrap finishes I'll upload the gcc-4.5.3
binaries and start working on gcc-4.6.1 and gcc-4.7.0.

Reply via email to