Bug #78149 [Dup]: when built using some older versions of gcc, php's API symbols aren't exported

From: Date: Wed, 12 Jun 2019 12:30:27 +0000
Subject: Bug #78149 [Dup]: when built using some older versions of gcc, php's API symbols aren't exported
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-221240@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78149&edit=1 ID: 78149 User updated by: php at geoff dot dj Reported by: php at geoff dot dj Summary: when built using some older versions of gcc, php's API symbols aren't exported Status: Duplicate Type: Bug Package: *Compile Issues Operating System: RHEL4.7 PHP Version: 7.2.19 Block user comment: N Private report: N New Comment: Have added a patch to bug 77883. Previous Comments: ------------------------------------------------------------------------ [2019-06-12 11:51:18] derick@php.net Duplicate of 77883 ------------------------------------------------------------------------ [2019-06-12 11:49:55] derick@php.net This is known, and I wrote about it too: https://derickrethans.nl/significant-symbols.html ------------------------------------------------------------------------ [2019-06-12 11:46:55] php at geoff dot dj Description: ------------ Several places in the code test for GNUC >= 4 before #defining API strings #elif defined(__GNUC__) && __GNUC__ >= 4 # define CWD_API __attribute__ ((visibility("default"))) #else # define CWD_API #endif This is all very well but some versions of gcc (eg the version in RHEL4, gcc 3.4.6) supports visibility attribute; this is made worse because the configure script actually tests whether visibility is supported by the compiler and (if so) adds the -fvisibility=hidden compile flag. This means that none of the API symbols are visible when built on those versions of gcc. Suggest adding a GCC_HAS_VISIBILITY or similar flag that the configure script can set after its test and that can be used in place of the GNUC >= 4 test above. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=78149&edit=1

« previous php.bugs (#221240) next »