Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42209 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82169 invoked from network); 9 Dec 2008 22:09:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Dec 2008 22:09:15 -0000 Authentication-Results: pb1.pair.com header.from=shire@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=shire@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 69.63.177.213 as permitted sender) X-PHP-List-Original-Sender: shire@php.net X-Host-Fingerprint: 69.63.177.213 sizzo.org Linux 2.6 Received: from [69.63.177.213] ([69.63.177.213:53885] helo=sizzo.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5E/21-11210-A8CEE394 for ; Tue, 09 Dec 2008 17:09:15 -0500 Received: from [172.24.57.93] (unknown [172.24.57.93]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by sizzo.org (Postfix) with ESMTPSA id BC28F4F9F02 for ; Tue, 9 Dec 2008 14:09:11 -0800 (PST) Message-ID: To: PHP Internals List Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Date: Tue, 9 Dec 2008 14:09:11 -0800 X-Mailer: Apple Mail (2.929.2) Subject: PCRE symbol visibility bug From: shire@php.net (shire) When using GCC 4.x with php-5.3, and an extension (such as APC) that references PCRE functions (pcre_exec) that are bundled with PHP in the pcre extension. The symbols defined in the PHP binaries don't include a visibility "default" attribute, and are currently set to "hidden" in CFLAGS. This makes the symbols unavailable to any .so extension, which triggers a fault. It seems like adding the visibility attribute to the bundled PHP code should fix this, but I wanted to post here as perhaps someone has a better suggestion. It would probably be better if this didn't modify the pcrelib/* files. I've included a patch as a possible fix, I can go ahead and commit this if this is what we want, but I'm hoping someone has some other suggestions. before: shire@shirebook:/usr/local/apache/libexec$ nm `which php` | grep pcre_exec 000266b4 t _php_pcre_exec after: shire@shirebook:/usr/local/apache/libexec$ nm `which php` | grep pcre_exec 000266b4 T _php_pcre_exec cvs diff: Diffing . cvs diff: Diffing doc Index: pcre_internal.h =================================================================== RCS file: /repository/php-src/ext/pcre/pcrelib/pcre_internal.h,v retrieving revision 1.1.2.1.2.5.2.5 diff -u -r1.1.2.1.2.5.2.5 pcre_internal.h --- pcre_internal.h 9 Sep 2008 07:55:08 -0000 1.1.2.1.2.5.2.5 +++ pcre_internal.h 9 Dec 2008 22:05:57 -0000 @@ -119,9 +119,17 @@ # endif # else # ifdef __cplusplus -# define PCRE_EXP_DECL extern "C" +# if defined(__GNUC__) && __GNUC__ >= 4 +# define PCRE_EXP_DECL __attribute__ ((visibility("default"))) extern "C" +# else +# define PCRE_EXP_DECL extern "C" +# endif # else -# define PCRE_EXP_DECL extern +# if defined(__GNUC__) && __GNUC__ >= 4 +# define PCRE_EXP_DECL __attribute__ ((visibility("default"))) extern +# else +# define PCRE_EXP_DECL extern +# endif # endif # ifndef PCRE_EXP_DEFN # define PCRE_EXP_DEFN PCRE_EXP_DECL -shire