As some of you may know, PHP 5.3 now supports GCC 4 -fvisibility switch
(http://news.php.net/php.cvs/48158). This feature allows better code
generation (especially when using -fPIC) and smaller binary sizes.
As a con, some extensions (those which export some sort of API) need some
updating, as only core extensions were updated so far. So if your extension
exports some function (usually by defining a EXTNAMEAPI macro in the
php_extname.h file), you may want to update the macro definition to detect
GCC 4.
e.g.:
#if windows
...
#elif defined(__GNUC__) && __GNUC__ >= 4
# define EXTNAMEAPI __attribute__ ((visibility("default")))
#else
# define EXTNAMEAPI
#endif
If you have any question, please ask me.
But we are explicitly compiling non-pic wherever we can, so is this
really going to give us much?
When compiling non-pic it doesn't give much, that's true. But it reduces the loading times of the executable and it also helps some aggressive link-time optimizations.
http://gcc.gnu.org/wiki/Visibility#line-4 has a summary of the benefits of this switch.
Anyway the bulk of the work is done. Now only non-core extensions that export some API (which are a minority) have to be updated.
Nuno