NYCPHP Meetup

NYPHP.org

[nycphp-talk] --with-pic ... what's pic?

Hans Zaunere lists at zaunere.com
Tue Nov 15 18:22:07 EST 2005



csnyder wrote on Tuesday, November 15, 2005 6:06 PM:
> So I have a PHP install (from a Debian package I think) that was
> configured with the --with-pic switch.
> 
> Does anyone know what this does? I've also seen --prefer-pic if that
> helps.

Oh, this one is easy...

PIC = position independent code

PIC has to do with the way shared objects are linked together, the Apache
DSO model, etc - if forking from Apache was a touch subject, then PIC is...

Perhaps some of the C gurus who hide on this list can fill in more details.
It's very platform dependant, quite complex, and quite subtle.  Supposedly
non-PIC is faster (since the linker can "know" where to link shared objects
together, and some platforms are (or, at least used to be) buggy with
regards to PIC code.

For some general reading:

http://sources.redhat.com/autobook/autobook/autobook_71.html
http://docs.hp.com/en/B2355-90655/ch07s03.html
http://www.delorie.com/gnu/docs/gcc/gccint_143.html
http://www.llnl.gov/CASC/components/docs/users_guide/node196.html
http://www.linuxjournal.com/article/1059

So what does this mean for PHP?

http://apache.dev.wapme.net/modules/php-4.0.5/INSTALL
http://www.php-editors.com/apache_manual/dso.html
http://www.phpbuilder.com/manual/zend.creating.php

(search for PIC in the above)

And there's been some recent discussion:

http://marc.theaimsgroup.com/?l=php-dev&w=2&r=1&s=pic&q=b

There's actually a lot of resources - Yahoo/Google for "position independent
code php", versus using the acronym.


---
Hans Zaunere / President / New York PHP
   www.nyphp.org  /  www.nyphp.com





More information about the talk mailing list