Requesting D ABI clarifications
Gregor Richards
Richards at codu.org
Wed May 10 17:23:44 PDT 2006
<preface>
I'm writing a D compiler using C as an intermediary language et cetera
et cetera http://www.dsource.org/projects/tdc/
</preface>
I have the lofty goal of DMD compatibility on those systems that DMD
supports, but unfortunately the ABI spec on the page isn't complete ...
I believe I have everything right (it seems to work) except for:
A) Function calling semantics
- Some initial tests putting 'this' in %eax generated almost 100%
compatible code, but there were occasional strange, difficult to trace
errors - these could just be my mistakes, or I could be doing calling
semantics improperly. Is that the only major difference from C calling
conventions, or is there something else specific I need to do?
B) Exception handling
- For GNU/Linux, DMD's exception handling is for all intents and
purposes undocumed ... it mentions that it has a static location for
exception handling buffers, but that's about it. I think I should be
able to get SEH working (I've found a few nice docs on it), but don't
have much of a base point for GNU/Linux ... all I know is a few symbols
(_deh_end et al).
Could somebody (Walter?) either explain how these work in DMD or point
me to where these are explained? I would really like to be compatible,
or at least as compatible as possible, with the reference ABI ...
hopefully this is doable from C (I'm willing to use GCC __attribute__'s
and inline assembly where necessary, this is how I got a parameter into
%eax).
Thanks for any response.
- Gregor Richards
More information about the Digitalmars-d
mailing list