php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77883 Building with gcc-3.4.3 fails to export symbols
Submitted: 2019-04-12 14:33 UTC Modified: 2019-04-12 14:56 UTC
From: a dot hawkins at cabletime dot com Assigned:
Status: Open Package: *Compile Issues
PHP Version: 7.3.4 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: a dot hawkins at cabletime dot com
New email:
PHP Version: OS:

 

 [2019-04-12 14:33 UTC] a dot hawkins at cabletime dot com
Description:
------------
When building with the following version of gcc:

andyh@778:/home/andyh/development/778-phpv7$ arm_v5t_le-gcc --version
arm_v5t_le-gcc (GCC) 3.4.3 (MontaVista 3.4.3-25.0.104.0600975 2006-07-06)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure.ac checks if the -fvisibility=hidden flag is acceptable to the compiler. If it is, it uses it. However, this compiler supports this flag, but doesn't support the attribute required to be able to export symbols (this requires gcc v4 or above).

The result is that php builds, but it is not possible to load any modules, as php's symbols aren't correctly exported.

This flag should only be used if the compiler *also* supports the 'visibility' function attribute.


Patches

HAS_VISIBILITY_CFLAGS (last revision 2019-06-12 12:21 UTC by php at geoff dot dj)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-04-12 14:37 UTC] spam2 at rhsoft dot net
GCC 3.4.3 is not supported for PHP 7.3 and there is no point using a 15 years old environment and then expect the newest software to run on it
 [2019-04-12 14:44 UTC] levim@php.net
While I question the value of supporting this old of a GCC version on this new of a PHP version, if you can come up with a fix I don't see any reason not to patch it.
 [2019-04-12 14:47 UTC] levim@php.net
My previous statement does come with some caveats: the code/configuration needs to be simple. If it's an invasive change it won't get applied. Is this version of MontaVista (which I know nothing about) still supported?
 [2019-04-12 14:56 UTC] a dot hawkins at cabletime dot com
This version almost certainly isn't supported, no.

I suspect the 'fix' would be to wrap the:

AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],
                       [CFLAGS="$CFLAGS -fvisibility=hidden"])

inside a call to 

ax_gcc_func_attribute("visibility")

and only check the compile flag if the attribute is supported.

However, my autoconf skills are definitely sub-par...
 [2019-06-12 12:21 UTC] php at geoff dot dj
The following patch has been added/updated:

Patch Name: HAS_VISIBILITY_CFLAGS
Revision:   1560342119
URL:        https://bugs.php.net/patch-display.php?bug=77883&patch=HAS_VISIBILITY_CFLAGS&revision=1560342119
 [2019-06-12 12:29 UTC] php at geoff dot dj
I've added the patch I used. Feel free to ignore.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 14 12:01:32 2024 UTC