[Issue 16794] .deb not working on Ubuntu 16.10 because of default PIE linking
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sat Dec 10 19:05:01 PST 2016
https://issues.dlang.org/show_bug.cgi?id=16794
--- Comment #11 from Jonathan M Davis <issues.dlang at jmdavisProg.com> ---
Well, there are multiple issues here. The primary one (and really what the
focus of this bug report is given title) is that we need a solution that works
for the package that we provide for debian-based systems. Ideally, it should
support both static and shared libraries like we do on other linux systems,
which - if I understand correctly - means that everything needs to be built
with PIC in order to be able to link with the system libraries. Whether PIC is
actually useful for a static libary is a separate issue. Now, if we can't get
static libraries working at the moment, then at least getting shared libraries
working would be in a _far_ better place than we are now, but really, they both
should work. If it's possible to do it all without PIC and PIE and have it work
on debian-based systems, then that's fine too, since the main problem is being
able to use D at all (though I think that we do need PIE/PIC in order to work
with the system libraries, since they're built with PIC).
The other issue is just PIC in general. You should be able to build with
PIC/PIE or not on linux systems with D just like you would with C/C++. We
clearly have at least partial support for that, and we may have full support
for it. It's not entirely clear to me what the situation is.
If I build the druntime unittest build with 2.071.0 like I did before, then I
get an ICE. The same for 2.071.1. However, 2.072.x does not seem to have that
problem. Rather, it results in the "'__dmd_personality_v0' can not be used
when making a shared object; recompile with -fPIC" error, even though I
compiled with PIC=1. However, the _phobos unit tests compile and run with PIC=1
fine. So, I think that the problem is that druntime's unittest build doesn't
fully support PIC.
However, if I build master, I then get the ICE again - but with building the
normal druntime build and not just the unittest build. So, it looks like we
have problems with building PIE/PIC, depending on which version of the compiler
you're dealing with.
That being the case, I don't know how well dmd will work with PIC/PIE if we're
provide debian package with such a build. But it looks like it's quite possible
to bootstrap it and build 2.072.1 (as long as you don't care about running
druntime's unit tests anyway). We need to fix that ICE for master though (so,
bug #15935).
--
More information about the Digitalmars-d-bugs
mailing list