Bug #74904 [NEW]: zend_operators.h: Error: The function "isfinite" must have a prototype.
| From: | john dot woods at greatplainsmfg dot com | Date: | Tue, 11 Jul 2017 16:06:13 +0000 |
| Subject: | Bug #74904 [NEW]: zend_operators.h: Error: The function "isfinite" must have a prototype. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-209992@lists.php.net to get a copy of this message | ||
From: john dot woods at greatplainsmfg dot com
Operating system: Solaris 11.3.21.5.0 (x86-64)
PHP version: 7.1.7
Package: Compile Failure
Bug Type: Bug
Bug description:zend_operators.h: Error: The function "isfinite" must have a prototype.
Description:
------------
We are compiling PHP 7.1.7 on Solaris 11.3.21.5.0 + idr3199, using
Solaris Studio 12.5 compilers.
During the build of the ./ext/intl extension, the following libtool
command fails to build ext/intl/intl_convertcpp.lo:
/bin/sh /tmp/SOURCE_DIR/libtool --silent --preserve-dup-deps
--mode=compile CC -I/usr/include -Wno-write-strings
-D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Iext/intl/
-I/tmp/SOURCE_DIR/ext/intl/ -DPHP_ATOM_INC -I/tmp/SOURCE_DIR/include
-I/tmp/SOURCE_DIR/main -I/tmp/SOURCE_DIR -I/tmp/SOURCE_DIR/ext/date/lib
-I/usr/include/libxml2 -I/usr/local/include
-I/tmp/SOURCE_DIR/ext/sqlite3/libsqlite -I/tmp/SOURCE_DIR/TSRM
-I/tmp/SOURCE_DIR/Zend -D_POSIX_PTHREAD_SEMANTICS -g -c
/tmp/SOURCE_DIR/ext/intl/intl_convertcpp.cpp -o
ext/intl/intl_convertcpp.lo
"/tmp/SOURCE_DIR/Zend/zend_portability.h", line 251: Warning
(Anachronism): Attempt to redefine __restrict__ without using #undef.
"/tmp/SOURCE_DIR/Zend/zend_operators.h", line 117: Error: The function
"isfinite" must have a prototype.
"/tmp/SOURCE_DIR/Zend/zend_operators.h", line 128: Error: The function
"isfinite" must have a prototype.
2 Error(s) and 1 Warning(s) detected.
*** Error code 1
make: Fatal error: Command failed for target
`ext/intl/intl_convertcpp.lo'
Upon investigation, the "isfinite" comes from zend_finite(), which gets
#define(d) as "isfinite" only if HAVE_DECL_ISFINITE is true (lines
93-101 of Zend/configure.in). The HAVE_DECL_ISFINITE is set by the main
configure script, if "isfinite" is defined by #include(ing) <math.h>.
I'm convinced that the root of this problem is that "isfinite" is a
valid function with Solaris Studio's C compiler. But with the C++
compiler, "std::isfinite" is not defined, since the default C++ dialect
is C++ 03. The file it is trying to build is
ext/intl/intl_convertcpp.cpp.
I tried adding "-std=sun03" or "-std=c++03" to CXXFLAGS, but still had
the problem. I also tried setting the flags to "-std=c++11" and
"-std=c++14", to force the C++ 11 or C++ 14 dialect, but those options
prevented linking to the GCC/G++ libraries, which caused other compile
problems.
The only way I could get this to compile and work, was forcing
HAVE_DECL_ISFINITE, HAVE_DECL_ISNAN, and HAVE_DECL_ISINF to be 0 in the
main configure script, to avoid this altogether. I know it's a bad hack,
but it did actually work around the issue.
I don't believe this is a duplicate of Bug #74265, since this is a C++
issue.
Test script:
---------------
export CC=cc
export CPP="CC -E"
export CXX=CC
export CFLAGS="-m64 -std=c11"
export CPPFLAGS="-m64"
export CXXFLAGS="-m64"
export LD_PRELOAD_64=/usr/local/lib/preloadable_libiconv.so
export LD_LIBRARY_PATH=/usr/local/lib
./configure --with-apxs2=/usr/local/apache2/bin/apxs
--with-iconv=/usr/local --enable-intl --enable-inline-optimization
--without-sqlite3 --without-pdo-sqlite
make
--
Edit bug report at https://bugs.php.net/bug.php?id=74904&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74904&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74904&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74904&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74904&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74904&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74904&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74904&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74904&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74904&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74904&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74904&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74904&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74904&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74904&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74904&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74904&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74904&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74904&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74904&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74904&r=mysqlcfg