Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42211 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89331 invoked from network); 10 Dec 2008 10:16:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Dec 2008 10:16:58 -0000 Authentication-Results: pb1.pair.com smtp.mail=nlopess@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=nlopess@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 212.55.154.24 as permitted sender) X-PHP-List-Original-Sender: nlopess@php.net X-Host-Fingerprint: 212.55.154.24 relay4.ptmail.sapo.pt Linux 2.4/2.6 Received: from [212.55.154.24] ([212.55.154.24:43495] helo=sapo.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 43/A2-11210-8179F394 for ; Wed, 10 Dec 2008 05:16:58 -0500 Received: (qmail 7328 invoked from network); 10 Dec 2008 10:16:54 -0000 Received: from unknown (HELO sapo.pt) (10.134.37.165) by relay4 with SMTP; 10 Dec 2008 10:16:54 -0000 Received: (qmail 25651 invoked from network); 10 Dec 2008 10:16:54 -0000 X-AntiVirus: PTMail-AV 0.3-0.92.0 X-Virus-Status: Clean (0.00718 seconds) Received: from unknown (HELO pc07654) (nunoplopes@sapo.pt@[85.243.104.18]) (envelope-sender ) by mta15 (qmail-ldap-1.03) with SMTP for ; 10 Dec 2008 10:16:54 -0000 Message-ID: <89337ADBA54448E287D52F81B443B607@pc07654> To: "shire" , "PHP Internals List" References: In-Reply-To: Date: Wed, 10 Dec 2008 10:16:52 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 Subject: Re: [PHP-DEV] PCRE symbol visibility bug From: nlopess@php.net ("Nuno Lopes") I've commited a fix. I didn't patch the pcre_internal.h file directly, otherwise the patch would be reverted on the next upgrade of the pcre lib. Thanks, Nuno ----- Original Message ----- From: "shire" To: "PHP Internals List" Sent: Tuesday, December 09, 2008 10:09 PM Subject: [PHP-DEV] PCRE symbol visibility bug > > 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