D.gnu - DMD and GDC static libraries are incompatible on Linux?
- Jeremy DeHaan (7/7) Feb 09 2015 I'm pretty sure I already know the answer to this, however I just
- ketmar (6/14) Feb 09 2015 DMD is not using GCC, only 'ld' from binutils. so yes, this is normal.=2...
- Jeremy DeHaan (3/5) Feb 09 2015 Oh, interesting. I didn't realize this.
- Jacob Carlborg (4/5) Feb 10 2015 Actually, DMD _is_ using GCC to link.
- ketmar (2/7) Feb 10 2015 yes. sorry for misinformation, i was sure that it calls 'ld' directly.=
- Leandro Lucarella (9/18) Feb 14 2015 But GCC only behaves as a wrapper of ld to link. :)
- ketmar (5/17) Feb 15 2015 yes, but it passes some funny options like linker script, path to system...
- Iain Buclaw via D.gnu (6/12) Feb 09 2015 GDC and DMD are not ABI compatible. There are many reasons why this
- Jeremy DeHaan (4/11) Feb 18 2015 I was thinking about this today and I had another question. What
- ketmar (5/15) Feb 18 2015 nope, if it using D API. only `extern(C)` is allowed, and you must own=2...
- Iain Buclaw via D.gnu (6/7) Feb 18 2015 True story, GDC got there first with shared library support before D2
- ketmar (4/13) Feb 18 2015 and gdc is *almost* there now, with some problems unsolved. i'm not=20
- Iain Buclaw via D.gnu (7/17) Feb 18 2015 The answer would still be no because of calling convention differences
- Daniel Murphy (3/7) Feb 19 2015 How different are we on linux these days?
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?
Feb 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. =20 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.=20 actually, you can't expect this to work, as object code representation is=20 not specified by the language, and generated code too. mixing compiled=20 libraries from dmd and gdc can have alot of unexpected effects, 'cause=20 even runtime is not similar.=
Feb 09 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.
Feb 09 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
Feb 10 2015
On Tue, 10 Feb 2015 09:07:14 +0100, Jacob Carlborg wrote:On 2015-02-09 19:56, ketmar wrote: =20yes. sorry for misinformation, i was sure that it calls 'ld' directly.=DMD is not using GCC, only 'ld' from binutils.=20 Actually, DMD _is_ using GCC to link.
Feb 10 2015
ketmar, el 10 de February a las 11:44 me escribiste:On Tue, 10 Feb 2015 09:07:14 +0100, Jacob Carlborg wrote: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 siempreOn 2015-02-09 19:56, ketmar wrote:yes. sorry for misinformation, i was sure that it calls 'ld' directly.DMD is not using GCC, only 'ld' from binutils.Actually, DMD _is_ using GCC to link.
Feb 14 2015
On Sun, 15 Feb 2015 06:09:33 +0100, Leandro Lucarella wrote:ketmar, el 10 de February a las 11:44 me escribiste:yes, but it passes some funny options like linker script, path to system=20 libraries and so on. and i'm so used to this that i was always thinking=20 about this phase as "calling 'ld'", completely forgetting about gcc=20 wrapper. ;-)=On Tue, 10 Feb 2015 09:07:14 +0100, Jacob Carlborg wrote: =20=20 But GCC only behaves as a wrapper of ld to link. :)On 2015-02-09 19:56, ketmar wrote: =20=20 yes. sorry for misinformation, i was sure that it calls 'ld' directly.DMD is not using GCC, only 'ld' from binutils.=20 Actually, DMD _is_ using GCC to link.
Feb 15 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.
Feb 09 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?
Feb 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:nope, if it using D API. only `extern(C)` is allowed, and you must own=20 all your GC-allocated objects, and you can't mix DMD and GDC libraries=20 (ah, well, you can't even build shared phobos with GDC yet), and... nope.=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.=20 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?
Feb 18 2015
On 18 February 2015 at 22:31, ketmar via D.gnu <d.gnu puremagic.com> wrote:(ah, well, you can't even build shared phobos with GDC yet), and...True story, GDC got there first with shared library support before D2 was released. *Then* D2 came out with TLS on by default for all static data. Shared libraries suddenly because a problem because the GC was no longer aware of TLS allocations without some magic data section hackery.
Feb 18 2015
On Wed, 18 Feb 2015 22:40:16 +0000, Iain Buclaw via D.gnu wrote:On 18 February 2015 at 22:31, ketmar via D.gnu <d.gnu puremagic.com> wrote:and gdc is *almost* there now, with some problems unsolved. i'm not=20 saying that gdc is bad ;-), it just need a helping hand. alas, my hands=20 are mounted to the wrong mount point. ;-)=(ah, well, you can't even build shared phobos with GDC yet), and...True story, GDC got there first with shared library support before D2 was released. *Then* D2 came out with TLS on by default for all static data. Shared libraries suddenly because a problem because the GC was no longer aware of TLS allocations without some magic data section hackery.
Feb 18 2015
On 18 February 2015 at 22:13, Jeremy DeHaan via D.gnu <d.gnu puremagic.com> wrote:On Monday, 9 February 2015 at 19:24:22 UTC, Iain Buclaw wrote:The answer would still be no because of calling convention differences - another reason why GDC and DMD are not ABI compatible. However, if you used an extern(C) API, then that should be at least some guarantee of shared library compatibility. Iain.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?
Feb 18 2015
"Iain Buclaw via D.gnu" wrote in message news:mailman.6598.1424298906.9932.d.gnu puremagic.com...The answer would still be no because of calling convention differences - another reason why GDC and DMD are not ABI compatible. However, if you used an extern(C) API, then that should be at least some guarantee of shared library compatibility.How different are we on linux these days?
Feb 19 2015