[Clc-crux64] to -fPIC or not to -fPIC

Lars Helmer lasso at spacecentre.se
Fri Apr 22 06:24:32 UTC 2005


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 at lists.berlios.de
> http://lists.berlios.de/mailman/listinfo/clc-crux64
>




More information about the crux64 mailing list