[M3devel] [M3commit] [modula3/cm3] 90b335: Fix special-case passing of static link parameter.
Jay K
jayk123 at hotmail.com
Mon Aug 28 02:59:27 CEST 2017
1. Thank you-- the C backend is under-understood & under appreciated.
2. This should be easy -- Modula-3
object methods are presumably like C++ virtual member functions.
There are some challenges to interop. One would want cm3
to generate headers & maybe glue code-- stuff around GC.
- Jay
________________________________
From: Rodney M. Bates <rodney_bates at lcwb.coop>
Sent: Sunday, August 27, 2017 9:33:41 AM
To: m3devel; Jay
Subject: Re: [M3commit] [modula3/cm3] 90b335: Fix special-case passing of static link parameter.
I really would not have expected gcc and C backends to interoperate in this way, while
still working with a range of standard C compilers. In fact, I am gratifyingly surprised
gcc and llvm backends do. But this does not detract from the C backend's major goal
of simplifying porting and bootstrapping on new machines and architectures.
What I would be really love to have is inter-language binary compatibility between Modula3
and C++ dispatching method calls, at least in the absence of multiple inheritance. But
that would probably be quite difficult and entail changes in Modula3's current runtime
model--a big and disruptive job.
On 08/24/2017 06:27 PM, Jay K wrote:
> Fyi the C backend completely works here, but everything must be compiled with the same backend, and gcc and C backend do not interoperate -- they pass the static link differently.
>
> - Jay
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> *From:* M3commit <m3commit-bounces at elegosoft.com> on behalf of GitHub <noreply at github.com>
> *Sent:* Thursday, August 24, 2017 3:32:53 PM
> *To:* m3commit at elegosoft.com
> *Subject:* [M3commit] [modula3/cm3] 90b335: Fix special-case passing of static link parameter.
>
> Branch: refs/heads/master
> Home: https://github.com/modula3/cm3
> Commit: 90b335e7ae53393d9dfc78f690e39a7cad49e086
> https://github.com/modula3/cm3/commit/90b335e7ae53393d9dfc78f690e39a7cad49e086
> Author: Rodney Bates <rodney.m.bates at acm.org>
> Date: 2017-08-24 (Thu, 24 Aug 2017)
>
> Changed paths:
> M m3-sys/llvm3.6.1/src/M3CG_LLVM.m3
>
> Log Message:
> -----------
> Fix special-case passing of static link parameter.
>
> Add the llvm 'nest' attribute to the static link parameter, both
> for direct and indirect calls. This causes llvm to pass this
> parameter in the way the target ABI specifies for a static link.
> Without this, everything was almost working except for execution
> of a finally block when an exception propagated through it. This
> would probably have worked too, if the runtime were also compiled
> with the llvm backend. But RTExFrame passes a static link to user
> code, and, if compiled by different back ends, these were using
> different parameter conventions.
>
> With this change, all test cases that pass using the gcc back end
> also pass using the llvm backend, plus one more (p140). Also, llvm
> incorrectly shows a failure on p004. This is only a reordering
> of warning messages produced by the front end, which is asked to
> unnest nested procedures in different order by these two back ends.
>
> This is with mixing m3cc-compiled runtime and llvm-compiled test
> cases, which bodes well for interoperability of these back ends.
>
>
>
>
> _______________________________________________
> M3commit mailing list
> M3commit at elegosoft.com
> https://m3lists.elegosoft.com/mailman/listinfo/m3commit
>
--
Rodney Bates
rodney.m.bates at acm.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20170828/cbb78aeb/attachment.html>
More information about the M3devel
mailing list