Jump to page: 1 2
Thread overview
DMD and GDC static libraries are incompatible on Linux?
Feb 09, 2015
Jeremy DeHaan
Feb 09, 2015
ketmar
Feb 10, 2015
Jeremy DeHaan
Feb 10, 2015
Jacob Carlborg
Feb 10, 2015
ketmar
Feb 15, 2015
Leandro Lucarella
Feb 15, 2015
ketmar
Feb 09, 2015
Iain Buclaw
Feb 18, 2015
Jeremy DeHaan
Feb 18, 2015
ketmar
Feb 18, 2015
Iain Buclaw
Feb 18, 2015
ketmar
Feb 18, 2015
Iain Buclaw
Feb 19, 2015
Daniel Murphy
February 09, 2015
I'm pretty sure I already know the answer to this, however I just wanted to ask to make sure.

I was talking with someone the other day. They were using Linux and tried to link static libraries built with DMD during a build with GDC. I thought this would work due to both DMD and GDC using GCC on Linux, but GDC wouldn't find any of the symbols in the DMD static libraries. Is this normal?
February 09, 2015
On Mon, 09 Feb 2015 17:56:53 +0000, Jeremy DeHaan wrote:

> I'm pretty sure I already know the answer to this, however I just wanted to ask to make sure.
> 
> I was talking with someone the other day. They were using Linux and tried to link static libraries built with DMD during a build with GDC. I thought this would work due to both DMD and GDC using GCC on Linux, but GDC wouldn't find any of the symbols in the DMD static libraries. Is this normal?

DMD is not using GCC, only 'ld' from binutils. so yes, this is normal. actually, you can't expect this to work, as object code representation is not specified by the language, and generated code too. mixing compiled libraries from dmd and gdc can have alot of unexpected effects, 'cause even runtime is not similar.

February 09, 2015
On 9 February 2015 at 17:56, Jeremy DeHaan via D.gnu <d.gnu@puremagic.com> wrote:
> I'm pretty sure I already know the answer to this, however I just wanted to ask to make sure.
>
> I was talking with someone the other day. They were using Linux and tried to link static libraries built with DMD during a build with GDC. I thought this would work due to both DMD and GDC using GCC on Linux, but GDC wouldn't find any of the symbols in the DMD static libraries. Is this normal?

GDC and DMD are not ABI compatible.  There are many reasons why this is so, but the one that is likely affecting you is because DMD emits references to symbols that do not exist in GDC's runtime library.

Iain.
February 10, 2015
On Monday, 9 February 2015 at 18:56:44 UTC, ketmar wrote:
>
> DMD is not using GCC, only 'ld' from binutils. so yes, this is normal.

Oh, interesting. I didn't realize this.

Thanks for the info, guys. I thought as much.

February 10, 2015
On 2015-02-09 19:56, ketmar wrote:

> DMD is not using GCC, only 'ld' from binutils.

Actually, DMD _is_ using GCC to link.

-- 
/Jacob Carlborg
February 10, 2015
On Tue, 10 Feb 2015 09:07:14 +0100, Jacob Carlborg wrote:

> On 2015-02-09 19:56, ketmar wrote:
> 
>> DMD is not using GCC, only 'ld' from binutils.
> 
> Actually, DMD _is_ using GCC to link.

yes. sorry for misinformation, i was sure that it calls 'ld' directly.

February 15, 2015
ketmar, el 10 de February a las 11:44 me escribiste:
> On Tue, 10 Feb 2015 09:07:14 +0100, Jacob Carlborg wrote:
> 
> > On 2015-02-09 19:56, ketmar wrote:
> > 
> >> DMD is not using GCC, only 'ld' from binutils.
> > 
> > Actually, DMD _is_ using GCC to link.
> 
> yes. sorry for misinformation, i was sure that it calls 'ld' directly.

But GCC only behaves as a wrapper of ld to link. :)

-- 
Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
----------------------------------------------------------------------
una vez mas voy a arrastrar mi alma por el suelo
y no me importa sentirme mal, si es lo que quiero
tragando polvo, llorando sangre, anocheciendo
una vez mas voy a cerrar mis ojos para siempre
February 15, 2015
On Sun, 15 Feb 2015 06:09:33 +0100, Leandro Lucarella wrote:

> ketmar, el 10 de February a las 11:44 me escribiste:
>> On Tue, 10 Feb 2015 09:07:14 +0100, Jacob Carlborg wrote:
>> 
>> > On 2015-02-09 19:56, ketmar wrote:
>> > 
>> >> DMD is not using GCC, only 'ld' from binutils.
>> > 
>> > Actually, DMD _is_ using GCC to link.
>> 
>> yes. sorry for misinformation, i was sure that it calls 'ld' directly.
> 
> But GCC only behaves as a wrapper of ld to link. :)

yes, but it passes some funny options like linker script, path to system libraries and so on. and i'm so used to this that i was always thinking about this phase as "calling 'ld'", completely forgetting about gcc wrapper. ;-)

February 18, 2015
On Monday, 9 February 2015 at 19:24:22 UTC, Iain Buclaw wrote:
> GDC and DMD are not ABI compatible.  There are many reasons why this
> is so, but the one that is likely affecting you is because DMD emits
> references to symbols that do not exist in GDC's runtime library.
>
> Iain.

I was thinking about this today and I had another question. What about shared libraries? If I were to release a library on Linux in shared library form, would it be compatible between compilers?
February 18, 2015
On Wed, 18 Feb 2015 22:13:04 +0000, Jeremy DeHaan wrote:

> On Monday, 9 February 2015 at 19:24:22 UTC, Iain Buclaw wrote:
>> GDC and DMD are not ABI compatible.  There are many reasons why this is so, but the one that is likely affecting you is because DMD emits references to symbols that do not exist in GDC's runtime library.
>>
>> Iain.
> 
> I was thinking about this today and I had another question. What about shared libraries? If I were to release a library on Linux in shared library form, would it be compatible between compilers?

nope, if it using D API. only `extern(C)` is allowed, and you must own all your GC-allocated objects, and you can't mix DMD and GDC libraries (ah, well, you can't even build shared phobos with GDC yet), and...

nope.

« First   ‹ Prev
1 2