October 16, 2016 Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10 | ||||
---|---|---|---|---|
| ||||
Posted in reply to tcak | 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?
|
October 16, 2016 Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nordlöw | 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.
|
October 17, 2016 Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nordlöw | 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 until this is fixed) so I'm just guessing.
Well, I haven't made any changes anywhere at all. I always download the deb file and install it. My program was compiling on 16.04, and wasn't compiling on 16.10.
So, I added
-defaultlib=libphobos2.so -fPIC
while compiling. That's it. But as you can guess, now I have to copy the libphobos on other computers as well as the executable. (libphotos2.so.0.71 is 9 MiB)
|
October 17, 2016 Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10 | ||||
---|---|---|---|---|
| ||||
Posted in reply to tcak | 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 complaining about libphobos2.a not being compiled with -fPIC flag.
-defaultlib is a DMD flag so that has not effect with the C++ compilations.
This must be fixed in the DMD Makefiles!
I you only tell me what to do I can make a PR to DMD that fixes these things.
|
October 17, 2016 Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nordlöw | 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.
|
October 17, 2016 Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nordlöw | 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 |
October 17, 2016 Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthias Klumpp | 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. https://issues.dlang.org/show_bug.cgi?id=5278 |
October 24, 2016 Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Martin Nowak | 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.
|
Copyright © 1999-2021 by the D Language Foundation