Edit report at https://bugs.php.net/bug.php?id=74265&edit=1
ID: 74265
Comment by: reindl dot harald at gmail dot com
Reported by: deferraz at terra dot com dot br
Summary: Build problems after 7.0.17 release: undefined
reference to `isfinite'
Status: Closed
Type: Bug
Package: Compile Failure
Operating System: CentOS-5
PHP Version: 7.0.17
Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
[2017-05-03 05:23 UTC] rasmus@php.net
gcc version 4.1.2 ?? That compiler is over 10 years old. You are probably going to need to add
-std=c99 to your build flags to get it to work on any modern codebase, or for heaven's sake,
upgrade to a compiler from this decade.
Previous Comments:
------------------------------------------------------------------------
[2019-05-31 13:06:39] swathybollini at gmail dot com
php release 7.3.6 build fails with follwoing errors,
ext/standard/var.o: In function `php_var_export_ex':
var.c:(.text+0x1140): undefined reference to `isfinite'
ext/standard/hrtime.o: In function `php_hrtime_current':
hrtime.c:(.text+0x2c): undefined reference to `clock_gettime'
ext/standard/hrtime.o: In function `zif_hrtime':
hrtime.c:(.text+0x124): undefined reference to `clock_gettime'
main/php_variables.o: In function `php_auto_globals_create_server':
php_variables.c:(.text+0x14c0): undefined reference to `isfinite'
Zend/zend_operators.o: In function `zendi_smart_strcmp':
zend_operators.c:(.text+0x129c): undefined reference to `isfinite'
Zend/zend_operators.o: In function `convert_to_long_base':
zend_operators.c:(.text+0x4b60): undefined ext/standard/var.o: In function `php_var_export_ex':
var.c:(.text+0x1140reference): undefined toreference `toisfinite'
`Zend/isfinitezend_operators.o':
Inext /functionstandard /`hrtime.o:_zval_get_long_func_noisy ':In
zend_operators.cfunction: (`.text+php_hrtime_current0x4e28')::
undefinedhrtime.c reference: (to. text`+isfinite0x2c')
: zend_operators.c:undefined( .textreference+ 0x4f44)to: `undefined clock_gettimereference'
toext /`isfinitestandard'/
Zendhrtime.o/:zend_operators.o :Inzend_operators.c :(function.text +`0x65e8)zif_hrtime: ':more
undefinedhrtime.c :references( .to text`+isfinite'0x124 )follow:
undefined reference to `clock_gettime'
main/php_variables.o: In function `php_auto_globals_create_server':
php_variables.c:(.text+0x14c0): undefined reference to `isfinite'
Zend/zend_operators.o: In function `zendi_smart_strcmp':
zend_operators.c:(.text+0x129c): undefined reference to `isfinite'
Zend/zend_operators.o: In function `convert_to_long_base':
collect2: zend_operators.c:(.text+0x4b60): undefined reference to `isfiniteld returned 1 exit
status'
Zend
/zend_operators.o: In function `_zval_get_long_func_noisy':
zend_operators.c:(.text+0x4e28): undefined reference to `isfinite'
zend_operators.c:(.text+0x4f44): undefined reference to `isfinite'
Zend/zend_operators.o:zend_operators.c:(.text+0x65e8): more undefined references to `isfinite'
follow
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
make: *** Waiting for unfinished jobs....
make: *** [sapi/cgi/php-cgi] Error 1
ext/standard/var.o: In function `php_var_export_ex':
var.c:(.text+0x1140): undefined reference to `isfinite'
ext/standard/hrtime.o: In function `php_hrtime_current':
hrtime.c:(.text+0x2c): undefined reference to `clock_gettime'
ext/standard/hrtime.o: In function `zif_hrtime':
hrtime.c:(.text+0x124): undefined reference to `clock_gettime'
main/php_variables.o: In function `php_auto_globals_create_server':
php_variables.c:(.text+0x14c0): undefined reference to `isfinite'
Zend/zend_operators.o: In function `zendi_smart_strcmp':
zend_operators.c:(.text+0x129c): undefined reference to `isfinite'
Zend/zend_operators.o: In function `convert_to_long_base':
zend_operators.c:(.text+0x4b60): undefined reference to `isfinite'
Zend/zend_operators.o: In function `_zval_get_long_func_noisy':
zend_operators.c:(.text+0x4e28): undefined reference to `isfinite'
zend_operators.c:(.text+0x4f44): undefined reference to `isfinite'
Zend/zend_operators.o:zend_operators.c:(.text+0x65e8): more undefined references to `isfinite'
follow
collect2: ld returned 1 exit status
make: *** [sapi/phpdbg/phpdbg] Error 1
snapshot of config.log:
ac_cv_have_decl_isfinite=yes
configure:94926: checking whether isfinite is declared
configure:94926: powerpc-ccpu-linux-gnu-gcc -c -D_ALIZE_ -O2 -Wall -pipe -D_FILE_OFFSET_BITS=64
-D_LARGEFILE_SOURCE
-I/users/sbh/Mercurial/3.2_main/oxo_naos/libxml2/powerpc/gcc-4.1.1-glibc-2.5/include
-I/users/sbh/Mercurial/3.2_main/oxo_naos/zlib/powerpc/gcc-4.1.1-glibc-2.5/include
-fvisibility=hidden -D_ALIZE_ -O2 -Wall -pipe -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-I/users/sbh/Mercurial/3.2_main/oxo_naos/libxml2/powerpc/gcc-4.1.1-glibc-2.5/include
-I/users/sbh/Mercurial/3.2_main/oxo_naos/zlib/powerpc/gcc-4.1.1-glibc-2.5/include conftest.c
>&5
configure:94926: $? = 0
configure:94926: result: yes
Issue not resolved even after applying the patch given in http://git.php.net/?p=php-src.git;a=commit;h=2e8308260513015dbf80ff0239eca79dbca4f36e
gcc version used is 4.1.2
------------------------------------------------------------------------
[2017-07-11 16:13:06] spam2 at rhsoft dot net
Related To: Bug #74904
------------------------------------------------------------------------
[2017-06-16 21:54:09] jon at isparks dot com
I was able to build using this:
make CC="gcc -std=gnu99"
Testing this on an old version of gcc:
gcc --version
gcc (GCC) 4.1.2 20080704
------------------------------------------------------------------------
[2017-05-04 02:02:04] letshi at 163 dot com
I try modify PHP7.1.4 configure file.
I modify lineno 95508 95519 95530
modify ac_have_decl=1 to ac_have_decl=0
Compile Success On CentOS5.5 (gcc version 4.1.2)
95505 ac_fn_c_check_decl "$LINENO" "isfinite"
"ac_cv_have_decl_isfinite" "#include <math.h>
95506 "
95507 if test "x$ac_cv_have_decl_isfinite" = xyes; then :
95508 ac_have_decl=0
95509 else
95510 ac_have_decl=0
95511 fi
95512
95513 cat >>confdefs.h <<_ACEOF
95514 #define HAVE_DECL_ISFINITE $ac_have_decl
95515 _ACEOF
95516 ac_fn_c_check_decl "$LINENO" "isnan" "ac_cv_have_decl_isnan"
"#include <math.h>
95517 "
95518 if test "x$ac_cv_have_decl_isnan" = xyes; then :
95519 ac_have_decl=0
95520 else
95521 ac_have_decl=0
95522 fi
95523
95524 cat >>confdefs.h <<_ACEOF
95525 #define HAVE_DECL_ISNAN $ac_have_decl
95526 _ACEOF
95527 ac_fn_c_check_decl "$LINENO" "isinf" "ac_cv_have_decl_isinf"
"#include <math.h>
95528 "
95529 if test "x$ac_cv_have_decl_isinf" = xyes; then :
95530 ac_have_decl=0
95531 else
95532 ac_have_decl=0
95533 fi
------------------------------------------------------------------------
[2017-05-03 07:30:37] spam2 at rhsoft dot net
The same for the whole operating system - RHEL5 is officially EOL and nobody should consider
continue using it
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=74265
--
Edit this bug report at https://bugs.php.net/bug.php?id=74265&edit=1