Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10

2016-10-24 Thread Martin Nowak via Digitalmars-d-learn
On Monday, 17 October 2016 at 11:55:03 UTC, Martin Nowak wrote: Please update the bug report. https://issues.dlang.org/show_bug.cgi?id=5278 Updated, but do I seriously have to do everything? I'm not even an Ubuntu user.

Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10

2016-10-17 Thread Martin Nowak via Digitalmars-d-learn
On Thursday, 13 October 2016 at 18:35:43 UTC, Matthias Klumpp wrote: The new toolchains of Ubuntu (and Debian soon too) default to PIE code, so in order to link correctly, the project needs to be compiled with PIE/PIC to work. Please update the bug report.

Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10

2016-10-17 Thread Jacob Carlborg via Digitalmars-d-learn
On 2016-10-17 10:55, Nordlöw wrote: It's the target `idgen` that fails for me. "idgen" is a separate target [1]. It's a tool that generates some code. [1] https://github.com/dlang/dmd/blob/master/src/posix.mak#L389 -- /Jacob Carlborg

Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10

2016-10-17 Thread Nordlöw via Digitalmars-d-learn
On Monday, 17 October 2016 at 08:39:55 UTC, Nordlöw wrote: I you only tell me what to do I can make a PR to DMD that fixes these things. It's the target `idgen` that fails for me.

Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10

2016-10-17 Thread Nordlöw via Digitalmars-d-learn
On Monday, 17 October 2016 at 05:55:55 UTC, tcak wrote: So, I added -defaultlib=libphobos2.so -fPIC Where did you add it? To the command-line or Makefile? And which Make variable did you change? I've tried make -f posix.mak MODEL_FLAG="-fPIC" but C++ compilations still fail with

Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10

2016-10-17 Thread tcak via Digitalmars-d-learn
On Sunday, 16 October 2016 at 22:36:15 UTC, Nordlöw wrote: On Sunday, 16 October 2016 at 22:00:48 UTC, Nordlöw wrote: Which flag(s) in `src/posix.mak` did you change? Does make -f posix.mak MODEL_FLAG=-fPIC work? I'm sitting on a 16.04 system right now (which I don't dare to upgrade

Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10

2016-10-16 Thread Nordlöw via Digitalmars-d-learn
On Sunday, 16 October 2016 at 22:00:48 UTC, Nordlöw wrote: Which flag(s) in `src/posix.mak` did you change? Does make -f posix.mak MODEL_FLAG=-fPIC work? I'm sitting on a 16.04 system right now (which I don't dare to upgrade until this is fixed) so I'm just guessing.

Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10

2016-10-16 Thread Nordlöw via Digitalmars-d-learn
On Sunday, 16 October 2016 at 20:01:21 UTC, tcak wrote: Hmm. As the error message says, I compiled the program by adding "-fPIC", it really has stopped giving error messages. That came to me weird. Which flag(s) in `src/posix.mak` did you change?

Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10

2016-10-16 Thread tcak via Digitalmars-d-learn
On Sunday, 16 October 2016 at 17:42:44 UTC, tcak wrote: On Thursday, 13 October 2016 at 17:02:32 UTC, Nordlöw wrote: [...] I have upgraded my Ubuntu to 16.10 yesterday as well, and I am getting following error: /usr/bin/ld: obj/Debug/program.o: relocation R_X86_64_32 against symbol

Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10

2016-10-16 Thread tcak via Digitalmars-d-learn
On Thursday, 13 October 2016 at 17:02:32 UTC, Nordlöw wrote: I just upgraded my Ubuntu to 16.10 and now my rebuilding of dmd from git master fails as /usr/bin/ld: idgen.o: relocation R_X86_64_32 against symbol `__dmd_personality_v0' can not be used when making a shared object; recompile with

Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10

2016-10-14 Thread Nordlöw via Digitalmars-d-learn
On Thursday, 13 October 2016 at 19:11:36 UTC, Adam D. Ruppe wrote: Try `-defaultlib=libphobos2.so` with your dmd command line. The .so version is pic compiled. Or you can recompile the whole lib. I don't know how to do that from the command line. I don't want to hand modify the Makefile

Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10

2016-10-13 Thread Nordlöw via Digitalmars-d-learn
On Thursday, 13 October 2016 at 19:11:36 UTC, Adam D. Ruppe wrote: Try `-defaultlib=libphobos2.so` with your dmd command line. The .so version is pic compiled. Building DMD fails to how do I modify the call make -f posix.mak under the dmd checkout?

Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10

2016-10-13 Thread Adam D. Ruppe via Digitalmars-d-learn
Try `-defaultlib=libphobos2.so` with your dmd command line. The .so version is pic compiled. Or you can recompile the whole lib.

Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10

2016-10-13 Thread Nordlöw via Digitalmars-d-learn
On Thursday, 13 October 2016 at 18:35:43 UTC, Matthias Klumpp wrote: The new toolchains of Ubuntu (and Debian soon too) default to PIE code, so in order to link correctly, the project needs to be compiled with PIE/PIC to work. So how do I do this? Instructions? Can I bootstrap DMD or do I

Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10

2016-10-13 Thread Nordlöw via Digitalmars-d-learn
On Thursday, 13 October 2016 at 19:01:55 UTC, Nordlöw wrote: Can I bootstrap DMD or do I need to cross-compile to the new PIE/PIC? Is this what AUTO_BOOTSTRAP=1 is for and what does it do?

Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10

2016-10-13 Thread Matthias Klumpp via Digitalmars-d-learn
On Thursday, 13 October 2016 at 17:07:19 UTC, Nordlöw wrote: On Thursday, 13 October 2016 at 17:02:32 UTC, Nordlöw wrote: Am I using the wrong GCC version? Should I use GCC 5 instead? GCC 6.2 is default on 16.10. Compiling DMD with GCC 5 as make -f posix.mak HOST_CXX=g++-5 also fails with

Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10

2016-10-13 Thread Nordlöw via Digitalmars-d-learn
On Thursday, 13 October 2016 at 17:02:32 UTC, Nordlöw wrote: Am I using the wrong GCC version? Should I use GCC 5 instead? GCC 6.2 is default on 16.10. Compiling DMD with GCC 5 as make -f posix.mak HOST_CXX=g++-5 also fails with same errors.

Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10

2016-10-13 Thread Nordlöw via Digitalmars-d-learn
I just upgraded my Ubuntu to 16.10 and now my rebuilding of dmd from git master fails as /usr/bin/ld: idgen.o: relocation R_X86_64_32 against symbol `__dmd_personality_v0' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: