Bug #81124 [Opn]: Determination of asm goto capability should be made by phpize configure script

From: Date: Thu, 10 Jun 2021 15:40:09 +0000
Subject: Bug #81124 [Opn]: Determination of asm goto capability should be made by phpize configure script
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-234356@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81124&edit=1

 ID:                 81124
 Updated by:         nikic@php.net
 Reported by:        php-bugs-2021 at ryandesign dot com
 Summary:            Determination of asm goto capability should be made
                     by phpize configure script
 Status:             Open
 Type:               Bug
 Package:            *Compile Issues
 Operating System:   macOS
 PHP Version:        8.0.7
 Block user comment: N
 Private report:     N

 New Comment:

I agree that this is a bug, but I'm not sure whether phpize is prepared for this. In particular
we'll end up including both the extension config.h (typically first, I think) and the main
php_config.h and will get symbol clashes at that point.

I think for stable releases we should just add an explicit exclude for old clang versions (i.e. set
ZEND_USE_ASM_ARITHMETIC=0 if HAVE_ASM_GOTO=1 but compiler too old), because I think that's the
main practical problem here.


Previous Comments:
------------------------------------------------------------------------
[2021-06-10 14:35:44] php-bugs-2021 at ryandesign dot com

Description:
------------
php 7.3.? and later use asm goto in zend_operators.h if HAVE_ASM_GOTO is set in php_config.h. A
problem arises if the compiler that was used to compile php supports asm goto but the compiler used
to compile a separate php module (with phpize) does not support asm goto. The error message in that
case is e.g.:

/opt/local/include/php73/php/Zend/zend_operators.h:523:10: error: expected '(' after
'asm'
        __asm__ goto(
                ^

See https://trac.macports.org/ticket/62022 for
the way that this affects php 7.3.x in MacPorts today, but note that as far as I know the potential
for similar issues continues to exist in all later php versions too.

A previous bug report about this issue #75951 was closed as not a bug because of the difference in
compilers. While perhaps you would prefer that all modules be compiled with the same compiler that
was used to compile php, that cannot always be assured. For example, maybe a user compiles php, then
changes their compiler (on macOS, maybe the user changes their Xcode version -- maybe it is updated
for them automatically by Apple Software Update), then compiles a php module. Or maybe the choice of
compiler is dictated by deficiencies in or requirements of a particular module (e.g. some require a
C++11-capable compiler and some don't).

php modules compiled with phpize get their own configure scripts, so presumably it was already
recognized that certain determinations must be made anew for each module. Would it be possible to
move or copy the determination of whether the compiler supports asm goto into this phpize-generated
configure script?



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=81124&edit=1


Thread (5 messages)

« previous php.bugs (#234356) next »