On 7 January 2012 11:37, Don <nospam@nospam.com> wrote:
On 06.01.2012 21:02, Adam Wilson wrote:
On Fri, 06 Jan 2012 10:27:58 -0800, Manu <turkeyman@gmail.com> wrote:

Okay, so I was trying to link to a C lib, and I realised... DMD doesn't
support/produce VS compatible libs.
I should have realised this sooner, noting the cv debuginfo.

So like... WTF?

How am I supposed to use DMD in Windows in anything other than trivial,
self-contained programs?
VisualC is the de facto standard in Windows. All libs are COFF, and
(unless
I'm working with GCC) everything I want to link to is produced from VC.

Let's also mention the debug info... Virtually every 3rd party tool
assumes
and/or works best with PDB debug info. Being required to run cv2pdb is
pretty lame.

So... why no support for COFF libs, and PDB debug info?
Surely at least a compiler option would do the business if there is some
kinky attachment to CV and OMF :/

I was hoping to start a project using D as a front end language
interacting
with my C/C++ engine lib... but I can't.
... and now that I think if it... how do ANY programs built with DMD
actually work? .. How does it link to system32.lib, user32.lib, etc?

DMD on Linux gets ELF with x64 support.
DMD on OSX gets Mach-O with x64 support.
DMD on Windows gets ... OMF with no x64 support.

COFF is an absolute requirements when working on Windows, yet DMD
doesn't support it. Everything, every programming interface, every
application running on x64 Windows is built with COFF, the default
output of every other compiler on Windows is COFF, everyone else
programming on Windows is expecting COFF.
Windows represents the largest OS install base in the world; and yet,
Windows based D programmers are told that they have to dig up extremely
esoteric tools from the darkest, smelliest, most cobwebbed corners of
the Internet, just to be able to interact with the the rest of the
Windows world.

This situation is simply unacceptable.

Everything else on Windows is COFF, if DMD ever wants to be accepted as
a mainstream Windows development tool, it simply *MUST* support COFF.
And no amount of wishing will ever change this. Without COFF, D will
ALWAYS be hamstrung on Windows, even if OMF ever got x64 support. Every
other platform that DMD supports got their native object formats. It is
now time to get the native Windows format in D.

All DMD needs to do is output the COFF files, any number of linkers
available on Windows can handle it from there. It doesn't have to
replace OMF and it doesn't even have to be the default option, but it
absolutely MUST be AN option.


>From everything I've seen, COFF seems to be very closely related to ELF. A large part of it is identical.
In the old DDL project on dsource, a lot of work was done in deciphering the formats. COFF is a lot better documented than Mach-O.

IMHO we should be looking at adding COFF output to the compiler, not to the linker.

Definitely. I'd be happy/prefer to use VisualC's linker if the D objects/libs were compatible.