View mode: basic / threaded / horizontal-split · Log in · Help
October 13, 2008
DMD in Cygwin linking with ELF objects
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.
October 13, 2008
Re: DMD in Cygwin linking with ELF objects
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
October 13, 2008
Re: DMD in Cygwin linking with ELF objects
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
October 13, 2008
Re: DMD in Cygwin linking with ELF objects
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
October 14, 2008
Re: DMD in Cygwin linking with ELF objects
On Mon, Oct 13, 2008 at 06:37:10PM -0400, Benji Smith wrote:
> I think the idea was to produce linux binaries from a compiler on a 
> windows system.
> 

I build Windows binaries from Linux by running the Windows version of dmd
under Wine on the code. It works pretty well almost out of the box
(some adjustments to sc.ini are all that's needed.)

I don't have any ideas about building Linux bins from Windows though.

> --benji

-- 
Adam D. Ruppe
http://arsdnet.net
Top | Discussion index | About this forum | D home