[Clc-crux64] to -fPIC or not to -fPIC
![](https://secure.gravatar.com/avatar/78cdd8ca70b52e8608101ab9c0499b1b.jpg?s=120&d=mm&r=g)
All right, I'm a little bothered by my current build, w/out -fPIC in the CFLAGS/CXXFLAGS. I've had to recompile so many packages after the fact, when another package comes and tells me to recompile so-an-so lib w/-fPIC, that I'm considering putting it back in the pkgmk.conf and recompiling base/opt. Pro: 1. Don't have to worry about adding "export CFLAGS="$CFLAGS -fPIC" to every other Pkgfile (seems to be required with a boatload of the multimedia apps I've been compiling) 2. Isn't position independent code a Good Thing(tm)? Not being schooled in the black arts of c programming, I have a hard time explaining to myself why, but I think it has to do with where objects can be loaded in a system's address space... Con: 1. Ummm... Gentoo-wisdom says not to add it to CFLAGS/CXXFLAGS. Anyone know why? 2. From http://www.linux.duke.edu/~mstenner/free-docs/autobook-1.3/autobook_71.html "PIC objects are usually slightly larger and slower at runtime than the equivalent non-PIC object". Slightly larger doesn't bother me much -- probably few of us running x86_64 processors w/tight disk space anyway, right? Slightly slower -- well, although my amd64 can probably afford slightly slower, I would like to squeeze every ounce of performance I can out of this box... So, I'm taking recommendations here. Does anyone care enough one way or the other to convince me of their position? Jeremy
![](https://secure.gravatar.com/avatar/b951120e74e4bcf4e84700191e0a8582.jpg?s=120&d=mm&r=g)
i say go with -fPIC. if no other reason then at least to stay as close as possible to the original ports. there is always the opportunity to remove the flag manually if the need arises. just my 2 öre. cheers, lars On Wed, April 20, 2005 5:27 pm, Jeremy Jones said:
All right, I'm a little bothered by my current build, w/out -fPIC in the CFLAGS/CXXFLAGS. I've had to recompile so many packages after the fact, when another package comes and tells me to recompile so-an-so lib w/-fPIC, that I'm considering putting it back in the pkgmk.conf and recompiling base/opt.
Pro:
1. Don't have to worry about adding "export CFLAGS="$CFLAGS -fPIC" to every other Pkgfile (seems to be required with a boatload of the multimedia apps I've been compiling)
2. Isn't position independent code a Good Thing(tm)? Not being schooled in the black arts of c programming, I have a hard time explaining to myself why, but I think it has to do with where objects can be loaded in a system's address space...
Con:
1. Ummm... Gentoo-wisdom says not to add it to CFLAGS/CXXFLAGS. Anyone know why?
2. From http://www.linux.duke.edu/~mstenner/free-docs/autobook-1.3/autobook_71.html "PIC objects are usually slightly larger and slower at runtime than the equivalent non-PIC object". Slightly larger doesn't bother me much -- probably few of us running x86_64 processors w/tight disk space anyway, right? Slightly slower -- well, although my amd64 can probably afford slightly slower, I would like to squeeze every ounce of performance I can out of this box...
So, I'm taking recommendations here. Does anyone care enough one way or the other to convince me of their position?
Jeremy
_______________________________________________ Clc-crux64 mailing list Clc-crux64@lists.berlios.de http://lists.berlios.de/mailman/listinfo/clc-crux64
![](https://secure.gravatar.com/avatar/78cdd8ca70b52e8608101ab9c0499b1b.jpg?s=120&d=mm&r=g)
hi, On Fri, 2005-04-22 at 08:24 +0200, Lars Helmer wrote:
i say go with -fPIC. if no other reason then at least to stay as close as possible to the original ports. there is always the opportunity to remove the flag manually if the need arises.
Done. iso image rebuilt, ports updated.
just my 2 öre.
Will 2 ore buy me a beer? Most of a beer? Jeremy
![](https://secure.gravatar.com/avatar/b951120e74e4bcf4e84700191e0a8582.jpg?s=120&d=mm&r=g)
On Fri, April 22, 2005 5:15 pm, Jeremy Jones said:
hi,
On Fri, 2005-04-22 at 08:24 +0200, Lars Helmer wrote:
i say go with -fPIC. if no other reason then at least to stay as close as possible to the original ports. there is always the opportunity to remove the flag manually if the need arises.
Done. iso image rebuilt, ports updated.
great! don't know if i'll try it though, the old one working so nicely so far...
just my 2 öre.
Will 2 ore buy me a beer? Most of a beer?
nah. öre is like the swedish counterpart to cent, but only worth a bit more than a tenth of it. but given your nice work i'll personally buy you at least one beer if you'll happen to be passing through somewhere around the south of sweden... :) cheers lars
Jeremy
_______________________________________________ Clc-crux64 mailing list Clc-crux64@lists.berlios.de http://lists.berlios.de/mailman/listinfo/clc-crux64
participants (2)
-
Jeremy Jones
-
Lars Helmer