Re: Ch.10.2 Libraries - shared lib compilation - -fPIC

2019-05-24 Thread Josh Triplett
Russ Allbery wrote: > Andrey Rahmatullin writes: > > Text relocations are forbidden at least on amd64 though. > > https://stackoverflow.com/questions/7865059/why-does-gcc-force-pic-for-x64-shared-libs > > Yeah, but I believe not on i386. > > This is really a very 32-bit, x86-specific problem. Als

Re: Ch.10.2 Libraries - shared lib compilation - -fPIC

2019-05-24 Thread Russ Allbery
Andrey Rahmatullin writes: > It's not "contra-productive". It may cause some performance decrease in > some cases, but benefits are more important than that. In particular, having to do text relocations during dynamic linking means that the text segment has to be read/write, which interferes wit

Re: Ch.10.2 Libraries - shared lib compilation - -fPIC

2019-05-24 Thread Russ Allbery
Dudziak Krzysztof writes: > Well, however the phrase of text myself complains about tells -fPIC must > be used if package is built for any architecture. Do I read then > understand that phrase properly? Yes, the short version for essentially all packaging situations is that all shared libraries

RE: Ch.10.2 Libraries - shared lib compilation - -fPIC

2019-05-24 Thread Dudziak Krzysztof
> On Fri, May 24, 2019 at 10:06:55AM +, Dudziak Krzysztof wrote: > > Well, however the phrase of text myself complains about tells -fPIC > > must be used if package is built for any architecture. Do I read then > > understand > that phrase properly? > Yes, the policy requires you to use PIC wh

Re: Ch.10.2 Libraries - shared lib compilation - -fPIC

2019-05-24 Thread Andrey Rahmatullin
On Fri, May 24, 2019 at 10:28:53AM +, Dudziak Krzysztof wrote: > > > Well, however the phrase of text myself complains about tells -fPIC > > > must be used if package is built for any architecture. Do I read then > > > understand > > that phrase properly? > > Yes, the policy requires you to us

RE: Ch.10.2 Libraries - shared lib compilation - -fPIC

2019-05-24 Thread Dudziak Krzysztof
; To: Andrey Rahmatullin > Cc: Dudziak Krzysztof ; debian- > pol...@lists.debian.org > Subject: Re: Ch.10.2 Libraries - shared lib compilation - -fPIC > > Andrey Rahmatullin writes: > > > Text relocations are forbidden at least on amd64 though. > > https://eur01.safelin

Re: Ch.10.2 Libraries - shared lib compilation - -fPIC

2019-05-24 Thread Andrey Rahmatullin
On Fri, May 24, 2019 at 10:06:55AM +, Dudziak Krzysztof wrote: > Well, however the phrase of text myself complains about tells -fPIC must be > used > if package is built for any architecture. Do I read then understand that > phrase properly? Yes, the policy requires you to use PIC when buildi

Re: Ch.10.2 Libraries - shared lib compilation - -fPIC

2019-05-23 Thread Russ Allbery
Andrey Rahmatullin writes: > Text relocations are forbidden at least on amd64 though. > https://stackoverflow.com/questions/7865059/why-does-gcc-force-pic-for-x64-shared-libs Yeah, but I believe not on i386. This is really a very 32-bit, x86-specific problem. (Even other 32-bit architectures t

Re: Ch.10.2 Libraries - shared lib compilation - -fPIC

2019-05-23 Thread Andrey Rahmatullin
On Thu, May 23, 2019 at 10:39:39AM -0700, Russ Allbery wrote: > >> Isn't it that way for shared libraries IN GENERAL to need be compiled > >> as position-independent code then linked as such ? > > > No, one could also register the virtual addresses for all shared > > libraries in a central databas

Re: Ch.10.2 Libraries - shared lib compilation - -fPIC

2019-05-23 Thread Russ Allbery
Ansgar writes: > On Thu, 2019-05-23 at 10:50 +, Dudziak Krzysztof wrote: >> Isn't it that way for shared libraries IN GENERAL to need be compiled >> as position-independent code then linked as such ? > No, one could also register the virtual addresses for all shared > libraries in a central

Re: Ch.10.2 Libraries - shared lib compilation - -fPIC

2019-05-23 Thread Andrey Rahmatullin
On Thu, May 23, 2019 at 01:02:59PM +, Dudziak Krzysztof wrote: > Thanks for feedback from you. > > > > Isn't it that way for shared libraries IN GENERAL to need be compiled > > > as position-independent code then linked as such ? > > Not in theory. > Ansgar kindly elaborated the point bit more

RE: Ch.10.2 Libraries - shared lib compilation - -fPIC

2019-05-23 Thread Dudziak Krzysztof
: Andrey Rahmatullin [mailto:w...@debian.org] > Sent: Thursday, 23. May 2019 13:45 > To: Dudziak Krzysztof > Cc: debian-policy@lists.debian.org > Subject: Re: Ch.10.2 Libraries - shared lib compilation - -fPIC > > On Thu, May 23, 2019 at 10:50:08AM +, Dudziak Krzysztof wrote

Re: Ch.10.2 Libraries - shared lib compilation - -fPIC

2019-05-23 Thread Ansgar
On Thu, 2019-05-23 at 10:50 +, Dudziak Krzysztof wrote: > I have troubles on comprehending following statement > "If the package is architecture: any, then the shared library compilation and > linking flags must have -fPIC.." > Cit. Debian Policy, chapter 10.2, > https://www.debian.org/doc/de

Re: Ch.10.2 Libraries - shared lib compilation - -fPIC

2019-05-23 Thread Andrey Rahmatullin
On Thu, May 23, 2019 at 10:50:08AM +, Dudziak Krzysztof wrote: > Hi, > > I have troubles on comprehending following statement > "If the package is architecture: any, then the shared library compilation and > linking flags must have -fPIC.." > Cit. Debian Policy, chapter 10.2, > https://www.d

Ch.10.2 Libraries - shared lib compilation - -fPIC

2019-05-23 Thread Dudziak Krzysztof
Hi, I have troubles on comprehending following statement "If the package is architecture: any, then the shared library compilation and linking flags must have -fPIC.." Cit. Debian Policy, chapter 10.2, https://www.debian.org/doc/debian-policy/ch-files.html#s-libraries I have little to zero shar