assemblymingwdgnu-assemblergdc

Cant compile D program using GDC


I'm trying to compile D program using GDC. I'm currently on Windows XP SP3 and i use the "Windows X86 32bit (i686-w64-mingw32)" package downloaded from here: http://gdcproject.org/downloads (the link at the bottom). So when I unpack the binaries and I invoke gdc to compile a simple program like this:

import std.stdio;

void main() {
     writeln("Hello World. ");
}

I get a bunch of assembler errors:

http://pastebin.com/1kwU10Tz

I know that the link to the says "Unsupported alpha build" but I don't really get what this message means (perhaps you can tell me). But nevertheless I've triead to download earlier versions from the archive and all fail with similar errors.

Is there a way to solve this? Or am I missing some crucial point here.

EDIT: Here is assembly code generated by compiler: http://pastebin.com/w5q0rNNd


Solution

  • The GDC windows builds are really broken. For the latest releases we only checked that the code compiles. We did not even do smoke testing for these releases. We don't have the tools to properly test the MinGW port and as long as we can't test properly, there's no use in completing the port. I hope this will change later this year, but I won't promise anything ;-) For now, I removed the download link from the gdcproject page.

    TL;DR: Don't use the MinGW GDC builds, they're broken.

    Some information regarding the error messages: If you look at the ASM you see names like these: __D11TypeInfo_(null)6__initZ

    Symbols names must not contain parenthesis. Something is broken when printing the names on MinGW. The code to print these identifiers in GDC looks something like this: sprintf(name, "_D%lluTypeInfo_%s6__initZ", (unsigned long long) 9 + len, buf.data); So there's some problem with the OutBuffer or sprintf. I'll have to do some more debugging to find the real problem.

    Bug report: http://bugzilla.gdcproject.org/show_bug.cgi?id=201