Bug #74039 [Com]: is_infinite(-INF) returns false
| From: | georgi at unixsol dot org | Date: | Mon, 20 Mar 2017 12:48:45 +0000 |
| Subject: | Bug #74039 [Com]: is_infinite(-INF) returns false | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-207962@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74039&edit=1
ID: 74039
Comment by: georgi at unixsol dot org
Reported by: bugs dot php dot net at chsc dot dk
Summary: is_infinite(-INF) returns false
Status: Closed
Type: Bug
Package: Math related
Operating System: Alpine Linux
PHP Version: 7.0.15
Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
The C example code does not compile on CentOS 5:
georgi@cent5:~$ cat > z.c
#include <math.h>
#ifndef isfinite
# error Not defined
#endif
void main() {}
georgi@cent5:~$ gcc z.c
z.c:3:3: error: #error Not defined
z.c: In function âmainâ:
z.c:5: warning: return type of âmainâ is not âintâ
georgi@cent5:~$ rpm -qa | grep glibc | sort | uniq
glibc-2.5-58.el5_6.3
glibc-common-2.5-58.el5_6.3
glibc-devel-2.5-58.el5_6.3
glibc-headers-2.5-58.el5_6.3
Previous Comments:
------------------------------------------------------------------------
[2017-03-17 19:12:35] nikic@php.net
CentOS issue also reported in bug #74265.
------------------------------------------------------------------------
[2017-03-17 16:50:40] nikic@php.net
Does
#include <math.h>
#ifndef isfinite
# error Not defined
#endif
void main() {}
compile for you? This seems pretty weird, because glibc should have isfinite().
------------------------------------------------------------------------
[2017-03-17 16:32:12] georgi at unixsol dot org
The fix in https://github.com/php/php-src/commit/714d825b62e719447686da6efe3b4063c2f25749
breaks the build for me for PHP 7.1.3 and PHP 7.0.17 branches:
The build fails with:
ext/filter/.libs/logical_filters.o: In function `php_filter_float':
/home/georgi/build/BUILD/php71-7.1.3/src/ext/filter/logical_filters.c:411: undefined reference to
`isfinite'
ext/intl/collator/.libs/collator_is_numeric.o: In function `collator_is_numeric':
/home/georgi/build/BUILD/php71-7.1.3/src/ext/intl/collator/collator_is_numeric.c:255: undefined
reference to `isfinite'
ext/standard/.libs/math.o: In function `zif_is_finite':
/home/georgi/build/BUILD/php71-7.1.3/src/ext/standard/math.c:589: undefined reference to
`isfinite'
ext/standard/.libs/math.o: In function `_php_math_round':
/home/georgi/build/BUILD/php71-7.1.3/src/ext/standard/math.c:133: undefined reference to
`isfinite'
/home/georgi/build/BUILD/php71-7.1.3/src/ext/standard/math.c:201: undefined reference to
`isfinite'
ext/standard/.libs/var.o:/home/georgi/build/BUILD/php71-7.1.3/src/ext/standard/var.c:473: more
undefined references to `isfinite' follow
After reverting 714d825b62e719447686da6efe3b4063c2f25749, I can build both 7.0 and 7.1 as before.
I can provide any logs necessary to track the problem. The build machine is CentOS 5.5 with
glibc-devel-2.5-58.el5_6.3.
------------------------------------------------------------------------
[2017-02-05 17:15:44] nikic@php.net
Fixed by https://github.com/php/php-src/commit/9ea0949f43959ff0cf519e7a10ef9de7a538cde3.
------------------------------------------------------------------------
[2017-02-05 01:51:03] ajf@php.net
See also: bug #73954
------------------------------------------------------------------------
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=74039
--
Edit this bug report at https://bugs.php.net/bug.php?id=74039&edit=1