phpv8 / v8js

V8 Javascript Engine for PHP — This PHP extension embeds the Google V8 Javascript Engine
http://pecl.php.net/package/v8js
MIT License
1.84k stars 200 forks source link

Compiler error while installing from pecl #304

Closed alcaeus closed 7 years ago

alcaeus commented 7 years ago

Ubuntu 16.04, PHP 7.1.3 is installed through ppa:ondrej/php. Below is the output of pecl install v8js, the error is the following:

In file included from /usr/include/php/20160303/Zend/zend_types.h:27:0,
                 from /usr/include/php/20160303/Zend/zend.h:31,
                 from /usr/include/php/20160303/main/php.h:36,
                 from /tmp/pear/temp/v8js/php_v8js_macros.h:39,
                 from /tmp/pear/temp/v8js/v8js_array_access.cc:17:
/usr/include/php/20160303/Zend/zend_operators.h: In function ‘zend_long zend_dval_to_lval(double)’:
/usr/include/php/20160303/main/php_config.h:2549:34: error: ‘isfinite’ was not declared in this scope
 #define zend_finite(a) isfinite(a)

This does not happen with 7.1.2, only with 7.1.3. For reference, the same error appears when trying to install 1.3.3 and 1.3.4.

Full output of pecl install v8js:

root@machine:~# pecl install v8js
downloading v8js-1.3.5.tgz ...
Starting to download v8js-1.3.5.tgz (95,206 bytes)
.....................done: 95,206 bytes
28 source files, building
running: phpize
Configuring for:
PHP Api Version:         20160303
Zend Module Api No:      20160303
Zend Extension Api No:   320160303
Please provide the installation prefix of libv8 [autodetect] : 
building in /tmp/pear/temp/pear-build-rootcDraRf/v8js-1.3.5
running: /tmp/pear/temp/v8js/configure --with-php-config=/usr/bin/php-config --with-v8js
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php/20160303 -I/usr/include/php/20160303/main -I/usr/include/php/20160303/TSRM -I/usr/include/php/20160303/Zend -I/usr/include/php/20160303/ext -I/usr/include/php/20160303/ext/date/lib
checking for PHP extension directory... /usr/lib/php/20160303
checking for PHP installed headers prefix... /usr/include/php/20160303
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking for V8 Javascript Engine... yes, shared
checking for V8 files in default path... found in /usr
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for C standard version... c++11
checking how to allow c++11 narrowing... -Wno-narrowing
checking for libv8_libplatform... found
checking for V8 version... 5.2.371
checking for natives_blob.bin... not found
checking for snapshot_blob.bin... not found
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... (cached) gawk
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
running: make
/bin/bash /tmp/pear/temp/pear-build-rootcDraRf/v8js-1.3.5/libtool --mode=compile g++ -Wno-narrowing -std=c++11 -I. -I/tmp/pear/temp/v8js -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootcDraRf/v8js-1.3.5/include -I/tmp/pear/temp/pear-build-rootcDraRf/v8js-1.3.5/main -I/tmp/pear/temp/v8js -I/usr/include/php/20160303 -I/usr/include/php/20160303/main -I/usr/include/php/20160303/TSRM -I/usr/include/php/20160303/Zend -I/usr/include/php/20160303/ext -I/usr/include/php/20160303/ext/date/lib -I/usr  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/v8js/v8js_array_access.cc -o v8js_array_access.lo
libtool: compile:  g++ -Wno-narrowing -std=c++11 -I. -I/tmp/pear/temp/v8js -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootcDraRf/v8js-1.3.5/include -I/tmp/pear/temp/pear-build-rootcDraRf/v8js-1.3.5/main -I/tmp/pear/temp/v8js -I/usr/include/php/20160303 -I/usr/include/php/20160303/main -I/usr/include/php/20160303/TSRM -I/usr/include/php/20160303/Zend -I/usr/include/php/20160303/ext -I/usr/include/php/20160303/ext/date/lib -I/usr -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/v8js/v8js_array_access.cc  -fPIC -DPIC -o .libs/v8js_array_access.o
In file included from /usr/include/php/20160303/Zend/zend_types.h:27:0,
                 from /usr/include/php/20160303/Zend/zend.h:31,
                 from /usr/include/php/20160303/main/php.h:36,
                 from /tmp/pear/temp/v8js/php_v8js_macros.h:39,
                 from /tmp/pear/temp/v8js/v8js_array_access.cc:17:
/usr/include/php/20160303/Zend/zend_operators.h: In function ‘zend_long zend_dval_to_lval(double)’:
/usr/include/php/20160303/main/php_config.h:2549:34: error: ‘isfinite’ was not declared in this scope
 #define zend_finite(a) isfinite(a)
                                  ^
/usr/include/php/20160303/Zend/zend_portability.h:314:52: note: in definition of macro ‘UNEXPECTED’
 # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
                                                    ^
/usr/include/php/20160303/Zend/zend_operators.h:117:18: note: in expansion of macro ‘zend_finite’
  if (UNEXPECTED(!zend_finite(d)) || UNEXPECTED(zend_isnan(d))) {
                  ^
/usr/include/php/20160303/main/php_config.h:2549:34: note: suggested alternative:
 #define zend_finite(a) isfinite(a)
                                  ^
/usr/include/php/20160303/Zend/zend_portability.h:314:52: note: in definition of macro ‘UNEXPECTED’
 # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
                                                    ^
/usr/include/php/20160303/Zend/zend_operators.h:117:18: note: in expansion of macro ‘zend_finite’
  if (UNEXPECTED(!zend_finite(d)) || UNEXPECTED(zend_isnan(d))) {
                  ^
In file included from /tmp/pear/temp/v8js/php_v8js_macros.h:31:0,
                 from /tmp/pear/temp/v8js/v8js_array_access.cc:17:
/usr/include/c++/5/cmath:601:5: note:   ‘std::isfinite’
     isfinite(_Tp __x)
     ^
In file included from /usr/include/php/20160303/Zend/zend_types.h:27:0,
                 from /usr/include/php/20160303/Zend/zend.h:31,
                 from /usr/include/php/20160303/main/php.h:36,
                 from /tmp/pear/temp/v8js/php_v8js_macros.h:39,
                 from /tmp/pear/temp/v8js/v8js_array_access.cc:17:
/usr/include/php/20160303/Zend/zend_operators.h: In function ‘zend_long zend_dval_to_lval_cap(double)’:
/usr/include/php/20160303/main/php_config.h:2549:34: error: ‘isfinite’ was not declared in this scope
 #define zend_finite(a) isfinite(a)
                                  ^
/usr/include/php/20160303/Zend/zend_portability.h:314:52: note: in definition of macro ‘UNEXPECTED’
 # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
                                                    ^
/usr/include/php/20160303/Zend/zend_operators.h:128:18: note: in expansion of macro ‘zend_finite’
  if (UNEXPECTED(!zend_finite(d)) || UNEXPECTED(zend_isnan(d))) {
                  ^
/usr/include/php/20160303/main/php_config.h:2549:34: note: suggested alternative:
 #define zend_finite(a) isfinite(a)
                                  ^
/usr/include/php/20160303/Zend/zend_portability.h:314:52: note: in definition of macro ‘UNEXPECTED’
 # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
                                                    ^
/usr/include/php/20160303/Zend/zend_operators.h:128:18: note: in expansion of macro ‘zend_finite’
  if (UNEXPECTED(!zend_finite(d)) || UNEXPECTED(zend_isnan(d))) {
                  ^
In file included from /tmp/pear/temp/v8js/php_v8js_macros.h:31:0,
                 from /tmp/pear/temp/v8js/v8js_array_access.cc:17:
/usr/include/c++/5/cmath:601:5: note:   ‘std::isfinite’
     isfinite(_Tp __x)
     ^
Makefile:203: recipe for target 'v8js_array_access.lo' failed
make: *** [v8js_array_access.lo] Error 1
ERROR: `make' failed
stesie commented 7 years ago

Thanks for reporting, ... this was pretty quick comparing release date of PHP 7.1.3 :-)

stesie commented 7 years ago

Just released version 1.3.6 that ships this patch

alcaeus commented 7 years ago

Thanks you so much!