November 22, 2016
On Monday, 21 November 2016 at 19:23:23 UTC, Stefan Koch wrote:
> I will try to reproduce and fix the issue.

We are also working on a new GNU Guix package for ldc latest. More on that soon.
November 22, 2016
On Tuesday, 22 November 2016 at 10:30:00 UTC, Pjotr Prins wrote:
>
> We are also working on a new GNU Guix package for ldc latest. More on that soon.

We are very close to finishing 1.1.0-beta4. Because beta3 has serious regressions, please wait until beta4.

Thanks,
  Johan

November 22, 2016
On Sat, Nov 19, 2016 at 11:03:05PM +0000, deadalnix via Digitalmars-d wrote:
> A lot of users are reporting errors on debian and ubuntu. .o generated by dmd do not link and libphobos.a is unusable.
> 
> This is very bad and we should consider a hotfix. Is someone on it ?

FWIW, I'm using Debian/unstable and compiling dmd/druntime/phobos directly from git HEAD, and it seems to work fine.

Does this problem only happen for the shipped .deb packages?


T

-- 
The trouble with TCP jokes is that it's like hearing the same joke over and over.
November 23, 2016
On Tuesday, 22 November 2016 at 21:19:13 UTC, H. S. Teoh wrote:
> On Sat, Nov 19, 2016 at 11:03:05PM +0000, deadalnix via Digitalmars-d wrote:
>> A lot of users are reporting errors on debian and ubuntu. .o generated by dmd do not link and libphobos.a is unusable.
>> 
>> This is very bad and we should consider a hotfix. Is someone on it ?
>
> FWIW, I'm using Debian/unstable and compiling dmd/druntime/phobos directly from git HEAD, and it seems to work fine.
>
> Does this problem only happen for the shipped .deb packages?
>
>
> T

It happens with anything compiled without fPIC as far as I can tell. unless the relocation emission bug has been fixed in master, then that should happen as well.

November 23, 2016
On Tuesday, 22 November 2016 at 21:19:13 UTC, H. S. Teoh wrote:
> On Sat, Nov 19, 2016 at 11:03:05PM +0000, deadalnix via Digitalmars-d wrote:
>> A lot of users are reporting errors on debian and ubuntu. .o generated by dmd do not link and libphobos.a is unusable.
>> 
>> This is very bad and we should consider a hotfix. Is someone on it ?
>
> FWIW, I'm using Debian/unstable and compiling dmd/druntime/phobos directly from git HEAD, and it seems to work fine.
>
> Does this problem only happen for the shipped .deb packages?
>
>
> T

I think it's not a problem for you, because your system's linker probably adds fPIC by default when you're building druntime and phobos. In contrast the binaries available on dlang.org/download were probably built on machine that does not add -fPIC by default.
November 25, 2016
On Wednesday, 23 November 2016 at 14:00:15 UTC, ZombineDev wrote:
> On Tuesday, 22 November 2016 at 21:19:13 UTC, H. S. Teoh wrote:
>> On Sat, Nov 19, 2016 at 11:03:05PM +0000, deadalnix via Digitalmars-d wrote:
>>> A lot of users are reporting errors on debian and ubuntu. .o generated by dmd do not link and libphobos.a is unusable.
>>> 
>>> This is very bad and we should consider a hotfix. Is someone on it ?
>>
>> FWIW, I'm using Debian/unstable and compiling dmd/druntime/phobos directly from git HEAD, and it seems to work fine.
>>
>> Does this problem only happen for the shipped .deb packages?
>>
>>
>> T
>
> I think it's not a problem for you, because your system's linker probably adds fPIC by default when you're building druntime and phobos. In contrast the binaries available on dlang.org/download were probably built on machine that does not add -fPIC by default.

Haha, I spoke too soon.  It appears that the reason I didn't see this problem was because I hadn't upgraded gcc in a while. After updating to the latest gcc-6.2 a couple of days ago, dmd now fails horribly with linker errors.  I couldn't even rebuild dmd because the bootstrapping dmd 2.069 that I'm using also doesn't have Phobos compiled with -fPIC, so it dies when trying to compile idgen.

Anyway, I needed things working again, so I did some further investigation. Here's what I found:

- Under the latest Debian/Ubuntu gcc-6.2, it's *still* possible to retain the old (working) behaviour by specifying -no-pie to all invocations of gcc.  (By "all invocations" I mean also internal calls to gcc from inside dmd.)  Using this workaround in a wrapper script specified in HOST_CXX to dmd's posix.mak, it's possible to bootstrap dmd successfully from an older dmd that doesn't have Phobos compiled with -fPIC.

- Druntime and Phobos' makefiles already support the PIC=1 option, which will build libphobos2.a with -fPIC.  To get dmd working again, make sure you `make clean; make PIC=1` in druntime followed by phobos (in that order, since otherwise libphobos2.a may pick up old non-PIC objects from druntime and it will break).

- After this is done, libphobos2.a is now built with -fPIC, so it is now compatible with Debian/Ubuntu's PIE-by-default configuration.  However, there is one last thing: dmd itself will emit a dmd-personality-v0 symbol in the generated object file(s), which will fail to link with the new libphobos2.a because, by default, this symbol is not specified as PIC, so the linker considers it incompatible with the new libphobos2.a.  So now we need to append "-fPIC" to the settings in the system dmd.conf, wherever you installed it (in my case, it was in /etc/dmd.conf), otherwise you will have to manually type "-fPIC" every time you invoke dmd.

- I did some googling, and found references to compiling with `-fPIC -defaultlib=libphobos2.so` instead, i.e., if you don't want to recompile druntime/phobos with -fPIC yourself.  This also works, *provided* you install the Phobos .so's in your system's lib directories.  If you're running dmd off the git repos directly, like I am, this requires symlinking libphobos2.*.so into /usr/local/lib or /usr/lib, otherwise none of your D executables will run.  I consider this too intrusive, especially for the bleeding edge phobos off git HEAD, so I settled for building libphobos.a with -fPIC instead, as described above.

Hope this info will be helpful to anyone else who's experiencing this problem. It cost me almost 2-3 hours' worth of frustration. :-/
November 25, 2016
On Sunday, 20 November 2016 at 03:28:33 UTC, Walter Bright wrote:
> On 11/19/2016 3:03 PM, deadalnix wrote:
>> A lot of users are reporting errors on debian and ubuntu. .o generated by dmd do
>> not link and libphobos.a is unusable.
>>
>> This is very bad and we should consider a hotfix. Is someone on it ?
>
> Bugzilla numbers?

https://issues.dlang.org/show_bug.cgi?id=16794  (links to other bugs included in report)
November 25, 2016
On Friday, 25 November 2016 at 23:27:52 UTC, H. S. Teoh wrote:
> On Sunday, 20 November 2016 at 03:28:33 UTC, Walter Bright wrote:
>> On 11/19/2016 3:03 PM, deadalnix wrote:
>>> A lot of users are reporting errors on debian and ubuntu. .o generated by dmd do
>>> not link and libphobos.a is unusable.
>>>
>>> This is very bad and we should consider a hotfix. Is someone on it ?
>>
>> Bugzilla numbers?
>
> https://issues.dlang.org/show_bug.cgi?id=16794  (links to other bugs included in report)

I don't think compiling everything as PIC is an appropriate way to go.

Still, I find myself unable to use D at all on my debian boxes.

November 25, 2016
On Fri, Nov 25, 2016 at 11:59:26PM +0000, deadalnix via Digitalmars-d wrote:
> On Friday, 25 November 2016 at 23:27:52 UTC, H. S. Teoh wrote:
> > On Sunday, 20 November 2016 at 03:28:33 UTC, Walter Bright wrote:
> > > On 11/19/2016 3:03 PM, deadalnix wrote:
> > > > A lot of users are reporting errors on debian and ubuntu. .o generated by dmd do not link and libphobos.a is unusable.
> > > > 
> > > > This is very bad and we should consider a hotfix. Is someone on it ?
> > > 
> > > Bugzilla numbers?
> > 
> > https://issues.dlang.org/show_bug.cgi?id=16794  (links to other bugs
> > included in report)
> 
> I don't think compiling everything as PIC is an appropriate way to go.
> 
> Still, I find myself unable to use D at all on my debian boxes.

Well, until DMD supports PIE (which if I understand correctly is a subset of PIC), there seems to be no easy way around this debacle.

The other alternative is to make dmd invoke gcc with -no-pie when linking.  Is there an easy way to do this?


T

-- 
An elephant: A mouse built to government specifications. -- Robert Heinlein
November 26, 2016
Am Fri, 25 Nov 2016 22:52:18 +0000
schrieb H. S. Teoh <hsteoh@quickfur.ath.cx>:


> - I did some googling, and found references to compiling with `-fPIC -defaultlib=libphobos2.so` instead, i.e., if you don't want to recompile druntime/phobos with -fPIC yourself.  This also works, *provided* you install the Phobos .so's in your system's lib directories.  If you're running dmd off the git repos directly, like I am, this requires symlinking libphobos2.*.so into /usr/local/lib or /usr/lib, otherwise none of your D executables will run.  I consider this too intrusive, especially for the bleeding edge phobos off git HEAD, so I settled for building libphobos.a with -fPIC instead, as described above.
> 

You can also add the install path of the phobos/druntime.so files to the LD_LIBRARY_PATH environment variable.