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

Fails build v8js #84

Closed dguard closed 10 years ago

dguard commented 10 years ago

I'm getting error when try make php-v8js. I'm using gcc version 4.8.1. Versions of v8 library which I used to install: 3.20-3.24. (Ubuntu 13.10, PHP 5.5.3-1)

Also I used gcc 4.7.3 but had same result. Install via pecl fails too.

What release and version of gcc I must use to install it correctly?

$ make

/bin/bash /tmp/v8js/libtool --mode=compile g++ -std=c++11 -I. -I/tmp/v8js -DPHP_ATOM_INC -I/tmp/v8js/include -I/tmp/v8js/main -I/tmp/v8js -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /tmp/v8js/v8js.cc -o v8js.lo 
libtool: compile:  g++ -std=c++11 -I. -I/tmp/v8js -DPHP_ATOM_INC -I/tmp/v8js/include -I/tmp/v8js/main -I/tmp/v8js -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/v8js/v8js.cc  -fPIC -DPIC -o .libs/v8js.o
In file included from /usr/include/php5/main/php_ini.h:24:0,
                 from /usr/include/php5/main/fopen_wrappers.h:26,
                 from /usr/include/php5/main/php.h:402,
                 from /tmp/v8js/php_v8js_macros.h:20,
                 from /tmp/v8js/v8js.cc:24:
/usr/include/php5/Zend/zend_ini.h:115:97: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 #define ZEND_INI_END()  { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, NULL } };
                                                                                                 ^
/tmp/v8js/v8js.cc:61:1: note: in expansion of macro 'ZEND_INI_END'
 ZEND_INI_END()
 ^
/tmp/v8js/v8js.cc: In function 'void zim_V8Object___construct(int, zval*, zval**, zval*, int)':
/tmp/v8js/v8js.cc:516:54: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
   "Can't directly construct V8 objects!", 0 TSRMLS_CC);
                                                      ^
/tmp/v8js/v8js.cc: In function 'void zim_V8Function___construct(int, zval*, zval**, zval*, int)':
/tmp/v8js/v8js.cc:526:54: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
   "Can't directly construct V8 objects!", 0 TSRMLS_CC);
                                                      ^
/tmp/v8js/v8js.cc: In function 'void zim_V8Js___construct(int, zval*, zval**, zval*, int)':
/tmp/v8js/v8js.cc:821:66: error: no matching function for call to 'v8::FunctionTemplate::New()'
  v8::Local<v8::FunctionTemplate> tpl = v8::FunctionTemplate::New();
                                                                  ^
/tmp/v8js/v8js.cc:821:66: note: candidate is:
In file included from /usr/include/v8-debug.h:31:0,
                 from /tmp/v8js/v8js.cc:22:
/usr/include/v8.h:3341:34: note: static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Handle<v8::Value>, v8::Handle<v8::Signature>, int)
   static Local<FunctionTemplate> New(
                                  ^
/usr/include/v8.h:3341:34: note:   candidate expects 5 arguments, 0 provided
/tmp/v8js/v8js.cc:848:72: error: no matching function for call to 'v8::FunctionTemplate::New()'
  v8::Local<v8::FunctionTemplate> php_obj_t = v8::FunctionTemplate::New();
                                                                        ^
/tmp/v8js/v8js.cc:848:72: note: candidate is:
In file included from /usr/include/v8-debug.h:31:0,
                 from /tmp/v8js/v8js.cc:22:
/usr/include/v8.h:3341:34: note: static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Handle<v8::Value>, v8::Handle<v8::Signature>, int)
   static Local<FunctionTemplate> New(
                                  ^
/usr/include/v8.h:3341:34: note:   candidate expects 5 arguments, 0 provided
In file included from /tmp/v8js/v8js.cc:24:0:
/tmp/v8js/v8js.cc: In function 'void zim_V8Js_executeString(int, zval*, zval**, zval*, int)':
/tmp/v8js/php_v8js_macros.h:50:50: error: invalid conversion from 'long int' to 'v8::Isolate*' [-fpermissive]
 #define V8JS_INT(v)   v8::Integer::New(v, isolate)
                                                  ^
/tmp/v8js/php_v8js_macros.h:119:110: note: in expansion of macro 'V8JS_INT'
 #define V8JS_GLOBAL_SET_FLAGS(isolate,flags) V8JS_GLOBAL(isolate)->SetHiddenValue(V8JS_SYM("__php_flags__"), V8JS_INT(flags))
                                                                                                              ^
/tmp/v8js/v8js.cc:1041:2: note: in expansion of macro 'V8JS_GLOBAL_SET_FLAGS'
  V8JS_GLOBAL_SET_FLAGS(isolate, flags);
  ^
In file included from /usr/include/v8-debug.h:31:0,
                 from /tmp/v8js/v8js.cc:22:
/usr/include/v8.h:1977:25: error:   initializing argument 1 of 'static v8::Local<v8::Integer> v8::Integer::New(v8::Isolate*, int32_t)' [-fpermissive]
   static Local<Integer> New(Isolate* isolate, int32_t value);
                         ^
In file included from /tmp/v8js/v8js.cc:24:0:
/tmp/v8js/php_v8js_macros.h:50:50: error: invalid conversion from 'v8::Isolate*' to 'int32_t {aka int}' [-fpermissive]
 #define V8JS_INT(v)   v8::Integer::New(v, isolate)
                                                  ^
/tmp/v8js/php_v8js_macros.h:119:110: note: in expansion of macro 'V8JS_INT'
 #define V8JS_GLOBAL_SET_FLAGS(isolate,flags) V8JS_GLOBAL(isolate)->SetHiddenValue(V8JS_SYM("__php_flags__"), V8JS_INT(flags))
                                                                                                              ^
/tmp/v8js/v8js.cc:1041:2: note: in expansion of macro 'V8JS_GLOBAL_SET_FLAGS'
  V8JS_GLOBAL_SET_FLAGS(isolate, flags);
  ^
In file included from /usr/include/v8-debug.h:31:0,
                 from /tmp/v8js/v8js.cc:22:
/usr/include/v8.h:1977:25: error:   initializing argument 2 of 'static v8::Local<v8::Integer> v8::Integer::New(v8::Isolate*, int32_t)' [-fpermissive]
   static Local<Integer> New(Isolate* isolate, int32_t value);
                         ^
In file included from /usr/include/php5/main/php.h:35:0,
                 from /tmp/v8js/php_v8js_macros.h:20,
                 from /tmp/v8js/v8js.cc:24:
/tmp/v8js/v8js.cc: In function 'void php_v8js_persistent_zval_ctor(zval**)':
/usr/include/php5/Zend/zend.h:615:57: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 #define zend_bailout()  _zend_bailout(__FILE__, __LINE__)
                                                         ^
/tmp/v8js/v8js.cc:1238:4: note: in expansion of macro 'zend_bailout'
    zend_bailout();
    ^
/tmp/v8js/v8js.cc: In function 'void php_v8js_persistent_zval_dtor(zval**)':
/usr/include/php5/Zend/zend.h:615:57: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 #define zend_bailout()  _zend_bailout(__FILE__, __LINE__)
                                                         ^
/tmp/v8js/v8js.cc:1251:4: note: in expansion of macro 'zend_bailout'
    zend_bailout();
    ^
In file included from /usr/include/php5/main/php.h:39:0,
                 from /tmp/v8js/php_v8js_macros.h:20,
                 from /tmp/v8js/v8js.cc:24:
/tmp/v8js/v8js.cc: At global scope:
/usr/include/php5/Zend/zend_API.h:111:30: warning: narrowing conversion of '-1' from 'int' to 'zend_uint {aka unsigned int}' inside { } [-Wnarrowing]
 #define ZEND_END_ARG_INFO()  };
                              ^
/tmp/v8js/v8js.cc:1398:1: note: in expansion of macro 'ZEND_END_ARG_INFO'
 ZEND_END_ARG_INFO()
 ^
/usr/include/php5/Zend/zend_API.h:111:30: warning: narrowing conversion of '-1' from 'int' to 'zend_uint {aka unsigned int}' inside { } [-Wnarrowing]
 #define ZEND_END_ARG_INFO()  };
                              ^
/tmp/v8js/v8js.cc:1412:1: note: in expansion of macro 'ZEND_END_ARG_INFO'
 ZEND_END_ARG_INFO()
 ^
/usr/include/php5/Zend/zend_API.h:111:30: warning: narrowing conversion of '-1' from 'int' to 'zend_uint {aka unsigned int}' inside { } [-Wnarrowing]
 #define ZEND_END_ARG_INFO()  };
                              ^
/tmp/v8js/v8js.cc:1415:1: note: in expansion of macro 'ZEND_END_ARG_INFO'
 ZEND_END_ARG_INFO()
 ^
make: *** [v8js.lo] Error 1
spsole commented 10 years ago

I was getting the same problem. Workarround i used a older forked version https://github.com/stesie/v8js.git V8 JavaScript Engine (tags/3.24.0)

My system PHP 5.5.3-1ubuntu2.1 (cli) (built: Dec 12 2013 04:24:35) g++ (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1

dguard commented 10 years ago

My problem was in using fish instead of bash. When I switched back to bash it was build successfully.