DMD in Cygwin linking with ELF objects

Gregor Richards Richards at codu.org
Mon Oct 13 16:01:23 PDT 2008


Benji Smith wrote:
> Gregor Richards wrote:
>> Simon Lehmayr wrote:
>>> Is there a possiblity to get a cygwin compatible D compiler binary 
>>> which creates ELF objects just as the pure Linux version does from 
>>> DigitalMars?
>>> As far as I know the cygwin-included GDC is ancient, the current GDC 
>>> is not really finished (lots of bugs remain) and the windows DMD only 
>>> produces some strange OMF object format. I need ELF objects to link 
>>> with my project using cygwin on Windows.
>>>
>>
>> ... what? Cygwin doesn't use ELF, so unless you're using something 
>> really strange like my ELF-on-Windows environment something is wrong 
>> here.
>>
>>  - Gregor Richards
> 
> I think the idea was to produce linux binaries from a compiler on a 
> windows system.
> 
> It'd be very cool (and personally, I see no reason it ought to depend on 
> cygwin). A compiler should not be dependent upon its environment to 
> produce compatible binaries.
> 
> In an ideal world, I'd just tell the compiler to use its linux backend 
> rather than its windows backend (and to link with linux libraries, 
> located in a directory of my choice). There's no hard and fast reason 
> why the reverse couldn't be true as well, compiling windows binaries 
> from a linux machine.
> 
> (NOTE: I am not actually *suggesting* this, because I realize it'd be a 
> gargantuan amount of work. I've just been thinking about this lately, 
> because I need to produce multi-platform binaries, and I'd rather do all 
> my compilation in one place, even if I still need to run acceptance 
> tests on those other platforms.)
> 
> --benji

A cross-compiler? That's a totally different issue. You can build a GDC 
cross-compiler, but having a current GDC compiler is neither a 
prerequisite nor even very helpful. I've made GDC cross-compilers in 
both of these directions, as well as various others (don't ask X_X )

  - Gregor Richards



More information about the Digitalmars-d mailing list