[Issue 15218] DMD should link dynamically to libphobos by default

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Oct 21 14:36:02 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=15218

Marco Leise <Marco.Leise at gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Marco.Leise at gmx.de

--- Comment #4 from Marco Leise <Marco.Leise at gmx.de> ---
(In reply to Adam D. Ruppe from comment #1)
> I absolutely, strongly disagree. Dynamic linking Phobos is a bad idea - it
> will lead to serious breakage around every corner for every application.
> 
> Phobos changes with every release. All executables compiled before an update
> will now be liable to break.

You link to a versioned soname "ldd `which dub`":
libphobos2.so.0.68 => /opt/dmd-2.068/lib64/libphobos2.so.0.68
This way dub wont break when I install 2.069 and the package manager is smart
enough to keep the library around until I recompile dub with the more recent
version of Phobos.

> […]
> 
> Phobos is also not commonly in the system library location, so on Linux,
> this means running programs won't work without either changing that or
> setting the library path, another big annoying hassle. I'd virtually break
> the zip distribution (which is Linux distro agnostic and used by those of us
> who aren't on .rpm or .deb).
> 
> […]
>
> If you want me to ever get on board with dynamic linking phobos, work to get
> it included with all the OSes as an independent end-user component first.

The risk of ABI breakage between compiler versions makes it so that I still
have to install GtkD (and other libraries) into separate compiler-arch-version
specific directories. As for DMD's Phobos itself, two files don't carry the
version in their name:

libphobos2.a
libphobos2.so
libphobos2.so.0.69
libphobos2.so.0.69.0

I'll look into moving the other two into system library path. It still doesn't
solve anything when it comes to additional libraries. God knows what happens
when you compile with dmd-2.069 and link to a library that was compiled against
Phobos-2.068 or with a different D compiler.

--


More information about the Digitalmars-d-bugs mailing list