Closed pogor closed 2 years ago
I'm getting the same result, wonder if something wrong...
If you choose to build the older version (2.1.0), it won't produce any error messages (Only warning) and it is able to use, try it out!
Thank you! I compile version v8 from issue#419 - 7.5.289. It's works!
I'm confused, is there a problem now or isn't there? Have you tried to build V8 6.9 with most recent php-v8js initially and that failed? Or what's wrong?
@stesie I'm getting a similar build error as op when trying to build latest 2.1.1 release (php7.2, Ubuntu 16.04, libv8 compiled to latest via README.Linux.md):
Error specifics:
/bin/bash /tmp/v8js/libtool --mode=compile g++ -Wno-narrowing -std=c++11 -I. -I/tmp/v8js -DPHP_ATOM_INC -I/tmp/v8js/include -I/tmp/v8js/main -I/tmp/v8js -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib -I/opt/v8/include -I/opt/v8 -DHAVE_CONFIG_H -g -O2 -c /tmp/v8js/v8js_convert.cc -o v8js_convert.lo
libtool: compile: g++ -Wno-narrowing -std=c++11 -I. -I/tmp/v8js -DPHP_ATOM_INC -I/tmp/v8js/include -I/tmp/v8js/main -I/tmp/v8js -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib -I/opt/v8/include -I/opt/v8 -DHAVE_CONFIG_H -g -O2 -c /tmp/v8js/v8js_convert.cc -fPIC -DPIC -o .libs/v8js_convert.o
/tmp/v8js/v8js_convert.cc: In function ‘v8::Local<v8::Value> v8js_hash_to_jsarr(zval*, v8::Isolate*)’:
/tmp/v8js/v8js_convert.cc:82:65: warning: ‘v8::Local<v8::Context> v8::Isolate::GetEnteredContext()’ is deprecated: Use GetEnteredOrMicrotaskContext(). [-Wdeprecated-declarations]
v8::Local<v8::Context> v8_context = isolate->GetEnteredContext();
^
In file included from /opt/v8/include/v8-internal.h:14:0,
from /opt/v8/include/v8.h:25,
from /tmp/v8js/php_v8js_macros.h:52,
from /tmp/v8js/v8js_convert.cc:22:
/opt/v8/include/v8.h:8007:32: note: declared here
Local<Context> GetEnteredContext());
^
/opt/v8/include/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
declarator __attribute__((deprecated(message)))
^
/tmp/v8js/v8js_convert.cc: In function ‘v8::Local<v8::Value> zval_to_v8js(zval*, v8::Isolate*)’:
/tmp/v8js/v8js_convert.cc:152:48: warning: ‘v8::Local<v8::Context> v8::Isolate::GetEnteredContext()’ is deprecated: Use GetEnteredOrMicrotaskContext(). [-Wdeprecated-declarations]
v8::Date::New(isolate->GetEnteredContext(), ((double)Z_LVAL(dtval) * 1000.0)).ToLocal(&jsValue);
^
In file included from /opt/v8/include/v8-internal.h:14:0,
from /opt/v8/include/v8.h:25,
from /tmp/v8js/php_v8js_macros.h:52,
from /tmp/v8js/v8js_convert.cc:22:
/opt/v8/include/v8.h:8007:32: note: declared here
Local<Context> GetEnteredContext());
^
/opt/v8/include/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
declarator __attribute__((deprecated(message)))
^
/tmp/v8js/v8js_convert.cc: In function ‘int v8js_to_zval(v8::Local<v8::Value>, zval*, int, v8::Isolate*)’:
/tmp/v8js/v8js_convert.cc:215:59: error: no matching function for call to ‘v8::Value::BooleanValue(v8::Local<v8::Context>&)’
v8::Maybe<bool> value = jsValue->BooleanValue(v8_context);
^
In file included from /tmp/v8js/php_v8js_macros.h:52:0,
from /tmp/v8js/v8js_convert.cc:22:
/opt/v8/include/v8.h:2551:8: note: candidate: bool v8::Value::BooleanValue(v8::Isolate*) const
bool BooleanValue(Isolate* isolate) const;
^
/opt/v8/include/v8.h:2551:8: note: no known conversion for argument 1 from ‘v8::Local<v8::Context>’ to ‘v8::Isolate*’
/tmp/v8js/v8js_convert.cc: In function ‘v8::Local<v8::Value> zval_to_v8js(zval*, v8::Isolate*)’:
/tmp/v8js/v8js_convert.cc:152:102: warning: ignoring return value of ‘bool v8::MaybeLocal<T>::ToLocal(v8::Local<S>*) const [with S = v8::Value; T = v8::Value]’, declared with attribute warn_unused_result [-Wunused-result]
v8::Date::New(isolate->GetEnteredContext(), ((double)Z_LVAL(dtval) * 1000.0)).ToLocal(&jsValue);
^
make: *** [v8js_convert.lo] Error 1
Figured it out - wrong libv8 version:
checking for libv8_libplatform... found
checking for V8 version... 5.2.371
configure: WARNING: libv8 prior to 6.4.388.18 is missing speculative execution mitigations
My assumption was that leaving out the optional commands (from README.Linux.md) would build the latest v8 (7.5+ for ex.) - but that's not the case and it ends up building 5.2:
# (optional) If you'd like to build a certain version:
git checkout 6.4.388.18
gclient sync
I've added the following commands and everything worked great (7.5.288.30 was latest stable via https://omahaproxy.appspot.com/ when I checked):
git checkout 7.5.288.30
gclient sync
Since v8js requires 6.9+ now maybe update the README.*.md's to direct users to install a version of v8 compatible with v8js? 6.9.427.18, 7.5.288.30 or otherwise?
Similar issue #421 from a couple days ago when trying to use the 6.4.388.18 version called out in README.Linux.md
FYI. 2.1.1 requires V8 > 6.9
It would help with autoconf detected the libv8 version and failed if it wasn't compatible.
I'm running into a ld link bug with g++: https://github.com/v8/v8/commit/3b8c624bda58d05aea80dd9626cd550537d6ac3f#diff-1dd7b6eaeebb8457fcb57aa637f469dc
To those who got 7.5 built, are you using g++ or clang?
Hi! I get some errors when I build v8js:
os: ubuntu 18.04 php: 7.3 lib v8: latest error:
os: ubuntu 18.04 php: 7.2 lib v8: 6.9.427.18 or 6.9.454 error:
Can you help me fix this problems?