Compiling dub dub-0.9.24 with the compiler flag -fPIC leads to:
Internal error: backend/elfobj.c 1027
dmd failed with exit code 1.
Comment #1 by issues.dlang — 2016-11-30T02:30:10Z
The same thing happens when compiling druntime with PIC=1 on the latest (k)ubuntu - 16.10:
Internal error: backend/elfobj.c 1027
posix.mak:184: recipe for target 'generated/linux/release/64/libdruntime.a' failed
Comment #2 by mk — 2016-12-01T10:50:04Z
(In reply to Jonathan M Davis from comment #1)
> The same thing happens when compiling druntime with PIC=1 on the latest
What DMD version ? Also see issue 16031.
Comment #3 by issues.dlang — 2016-12-07T11:06:55Z
(In reply to Martin Krejcirik from comment #2)
> (In reply to Jonathan M Davis from comment #1)
> > The same thing happens when compiling druntime with PIC=1 on the latest
>
> What DMD version ? Also see issue 16031.
From the looks of it, I was trying 2.071.0. I have now tried more versions. 2.071.1 exhibits the problem as well, but 2.071.2 and later do not. Also, it looks like it was only happening with the unittest build. In either case, it looks like this problem no longer affects the druntime build. I have no idea if this is still a problem for dub or not.
Comment #4 by greensunny12 — 2017-12-12T06:26:25Z
This hasn't been a problem for DUB in this entire year. I can only use -fPIC on my hardened system and DUB built fine over the entire year -> closing as "fixed".