[dmd-beta] D 1.075 and 2.060 betas

Andrej Mitrovic andrej.mitrovich at gmail.com
Wed Jul 25 15:39:27 PDT 2012


On 7/24/12, Walter Bright <walter at digitalmars.com> wrote:
> http://ftp.digitalmars.com/dmd2beta.zip

Found a linker bug for 2.060. Compiling with -c on a module-by-module
basis creates linking errors and a linker crash. Test-case for a Win32
machine:

$ git clone https://github.com/AndrejMitrovic/WindowsAPI.git

Open the WindowsAPI folder and paste this D script:
module build;

import std.array;
import std.conv;
import std.stdio;
import std.parallelism;
import std.file;
import std.path;
import std.process;
import std.string;

alias std.string.join join;

void main()
{
    string[] objFiles;
	
    string[] entries;
    foreach (string entry; dirEntries(r"win32", SpanMode.shallow))
        entries ~= entry;  // .array won't work.., to!string[] won't work..

    foreach (string entry; parallel(entries, 1))
    {
        string objFile = entry.stripExtension.setExtension(".obj");
        objFiles ~= objFile;

        string cmd = format("dmd -c -version=Unicode
-version=WindowsXP %s -of%s", entry, objFile);
        system(cmd);
    }

    system("echo void main() { } > test.d");
    string cmd = format("dmd test.d -version=Unicode
-version=WindowsXP %s", objFiles.join(" "));
    system(cmd);
}

Run it:
$ rdmd build.d

This is what I get:

 Error 32: Data Outside Segment Bounds : _DATA
win32\mmsystem.obj(mmsystem)
 Error 32: Data Outside Segment Bounds : _DATA
win32\mmsystem.obj(mmsystem)
 Error 32: Data Outside Segment Bounds : _DATA
win32\mmsystem.obj(mmsystem)
 Error 32: Data Outside Segment Bounds : _DATA
win32\mmsystem.obj(mmsystem)
 Error 32: Data Outside Segment Bounds : _DATA

and a crash:

---------------------------
Unexpected OPTLINK Termination at EIP=00402C6C
---------------------------
EAX=017C0000 EBX=004C22F8 ECX=00000004 EDX=0001FFFF
ESI=010524DC EDI=00003FF8 EBP=0012FFF0 ESP=0012FF84
First=00402000

The script works fine with 2.059.


More information about the dmd-beta mailing list