After hitting some troubles with optlink in the past (though my problems got solved others may be not)
I was in constant search for alternatives.
The good news:
there *do* happen to be very versatile linker for windows able to produce 32/64bit PE, that supports OMF format and so on. Another cool thing that has is so called mix-mode linking i.e. linking objects produced by different compilers with different RTLs (tricky but might worth the effort).
Link to ftp with docs and binary: ftp://ftp.styx.cabel.net/pub/UniLink/
According to author it does fully support DMC++ along with a huge pack of other C++ compilers.

Now the bad news:
it doesn't quite work with DMD for the moment. It's able to link test.d, but fails to link test2.d. (see attach) Stating that the resulting OMF is invalid. I asked the developer about it, his reply:
/reply

DM is in list of supported compilers (with DM C extensions). But D
extension in sample is suspicious. There it attempt to define "select
any" comdat that referenced to TLS-type segment. This is similar to common
backend error. Another possibility is that it is an D "extension". But
we don't possess documentation of D object format extensions and only
can gess what it is.

If the D becomes common used language we can "examine" its new
features and take in into consideration. But... Maybe is's easier to
contact with D developer and ask for new features in objects.
/end reply

QUESTION
--->>>
So here I am asking what kind of OMF extensions DMD uses, and what's difference 
between test.d and test2.d in terms of object file output?
<<<---

Any hints on where to look for them are also welcome.
If they are minor then we can convince the developer
and have 64bit linker to experiment with on windows.

NOTES

I used dmd 2.051, though with 2.050 it's the same issue;
command line:
dmd -c<xxx>.d

For those interested in experimenting with unilink themselves,
use the following config (ulink.cfg) adjusting the path to dmd as needed:
-zkernel32;advapi32;user32;wsock32;shell32;snn.lib
-LC:\dmd2\windows\lib
-Go

Then linking is just: ulink <xxx>.obj

--
Dmitry Olshansky

import std.stdio;
void main(){

        writeln("Hello world!\n");      
}
import std.stdio;
void main(){
//      auto magic = A!(int)(42);
        writeln(32);
}

Reply via email to