Bug 4010 – dmd should support linkers other than OPTLINK
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-03-26T04:34:28Z
Last change time
2017-10-25T03:00:21Z
Keywords
Optlink
Assigned to
No Owner
Creator
nfxjfg
Comments
Comment #0 by nfxjfg — 2010-03-26T04:34:28Z
Because of the general instability of OPTLINK, I request that dmd should be able to generate object files consumable by other linkers. OPTLINK is the only OMF linker I've found capable to link dmd's output.
Possible targets include the Microsoft linker (supports COFF) or the GNU linker (supports both COFF and ELF on Windows).
dmd already has an Linux and a MacOSX backend, both with different object file formats; this can't be a too unrealistic feature request.
Comment #1 by issues.dlang — 2011-01-06T20:50:39Z
This is actually one which I'd really like to see done at some point. The fact that you have to use dmc to build your C/C++ code is a huge blocker for D on Windows for anyone who works in an environment which is primarily using Microsoft or Intel's compiler. It would not be possible for me to use dmc for C++ where I work, which makes using D there much harder, even if I were to end up with a project where I would have a chance of choosing to use it in D.
There was a discussion about this on the D list a while back, and it was suggested that dmd at least be altered such that you could have a plugin architecture of some kind to swap out linkers. That way, even though dmd would still use dmc/optlink normally, someone other than Walter could then write and maintain a plugin which used Microsoft's compiler. So, we could potentially get support for other linkers without requiring Walter to deal with it.
Comment #2 by braddr — 2011-01-06T20:53:11Z
If someone wants to write the .obj writer for an alternate format, do it. How to wire it up with dmd is the least of the problems.
Comment #3 by issues.dlang — 2011-01-06T20:55:52Z
Likely true. But as with many things around here, it requires someone to step up and do it.
Comment #4 by bugzilla — 2011-01-06T22:59:05Z
It's more than just writing a different object file format, if the goal is to link with VC output. It's being ABI compatible with whatever the VC compiler puts out.
Comment #5 by andrej.mitrovich — 2012-12-20T15:08:34Z
(In reply to comment #4)
> It's more than just writing a different object file format, if the goal is to
> link with VC output. It's being ABI compatible with whatever the VC compiler
> puts out.
Is this issue now solved since x64 uses the VC linker?
Comment #6 by braddr — 2012-12-20T15:11:57Z
I wouldn't consider it done until win/32 is also migrated to the visual studio runtime and linker. I admit that's an expansion of the original description of this issue, but I think it's the spirit of it. And I agree with the spirit.
Comment #7 by andrej.mitrovich — 2012-12-20T15:16:10Z
(In reply to comment #6)
> I wouldn't consider it done until win/32 is also migrated to the visual studio
> runtime and linker. I admit that's an expansion of the original description of
> this issue, but I think it's the spirit of it. And I agree with the spirit.
I'm totally for having support for COFF on win32 too, but IIRC Walter mentioned win32 will stay with Optlink? (I might be wrong).
You can currently use one other linker on win32 though, Unilink. It often gives out readable error messages rather than crashing like Optlink.
Comment #8 by issues.dlang — 2012-12-20T15:23:39Z
Walter does not currently plan to make dmd on Windows produce COFF for 32-bit programs. It's considerably more work to do that on top of the 64-bit stuff, and he considers 32-bit to be dying out such that it's not worth the effort to convert it. I doubt that he'd be opposed to someone else doing that work, but as I understand it, he has no intention of doing it himself.
Comment #9 by braddr — 2012-12-20T17:21:56Z
Speaking for Walter is generally a bad idea. Anyway, I recall the thread as "64 bit first, 32 bit maybe later".
Comment #10 by issues.dlang — 2012-12-20T17:45:18Z
I'm just repeating what I remember of what he said. I'd obviously have to dig through the archives to get exact quotes though. And he could certainly change his mind. Regardless, we're definitely not getting COFF on 32-bit Windows right now.
Comment #11 by bugzilla — 2017-10-25T03:00:21Z
dmd will now support MS-COFF output with the -m32mscoff compiler switch.