dmd makes D appear slow

Iain Buclaw via Digitalmars-d digitalmars-d at puremagic.com
Sun May 31 03:18:56 PDT 2015


On 31 May 2015 at 10:45, Manu via Digitalmars-d <digitalmars-d at puremagic.com
> wrote:

> On 31 May 2015 at 17:59, Shachar Shemesh via Digitalmars-d
> <digitalmars-d at puremagic.com> wrote:
> > On 31/05/15 02:08, Manu via Digitalmars-d wrote:
> >>
> >> On 31 May 2015 at 04:39, Shachar Shemesh via Digitalmars-d
> >> <digitalmars-d at puremagic.com> wrote:
> >>>
> >>> On 30/05/15 11:00, Iain Buclaw via Digitalmars-d wrote:
> >>>>
> >>>>
> >>>>
> >>>> When he says Windows, he means MSVC, gcc backend will never support
> >>>> interfacing that ABI (at least I see no motivation as of writing).
> >>>>
> >>> I thought that's what MINGW was. A gcc backend that interfaces with the
> >>> Windows ABI. Isn't it?
> >>
> >>
> >> If your program is isolated, MinGW is fine. Great even!
> >> But the Windows ecosystem is built around Microsoft's COFF formatted
> >> libraries (as produced by Visual Studio), and most Windows libs that I
> >> find myself working with are closed-source, or distributed as
> >> pre-built binaries.
> >
> > Again, sorry for my ignorance. I just always assumed that the main
> > difference between mingw and cygwin is precisely that: that mingw
> > executables are PE formatted, and can import PE DLLs (such as the Win32
> DLLs
> > themselves).
> >
> > If that is not the case, what is the mingw format? How does it allow you
> to
> > link in the Win32 DLLs if it does not support COFF?
> >
> > Shachar
>
> I did once play with a coff mingw build, but I think the key issue I
> had there was the C runtime. GCC built code seems to produce intrinsic
> calls to glibc, and it is incompatible with MSVCRT.
> I'm pretty certain that GCC can't emit code to match the Win32
> exception model, and there's still the debuginfo data to worry about
> too.
>

Pretty much correct as far as I understand it.

- GCC uses DWARF to embed debug information into the program, rather that
store it in a separate PDB.
- GCC uses SJLJ exceptions in C++ that work to it's own libunwind model.
- GCC uses Itanium C++ mangling, so mixed MSVC/G++ is a no-go.
- GCC uses cdecl as the default calling convention (need to double check
this is correct though).

That said, GCC does produce a COFF binary that is understood by the Windows
platform (otherwise you wouldn't be able to run programs).  But interacting
with Windows libraries is restricted to the lowest API, that being anything
that was marked with stdcall, fastcall or cdecl.

MinGW is an entriely isolated runtime environment that fills the
missing/incompatible gaps between Windows and GNU/Posix runtime to allows
GCC built programs to run.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150531/c45155a5/attachment.html>


More information about the Digitalmars-d mailing list