Skip to content

Error Building V8 against 7.5 Baseline #414

Closed
@virgofx

Description

@virgofx

Compiling on Fedora:30 using Remi's PHP 7.3 repo against V8 7.5.288.23.

Snippet for v8 section

# Install Packages
RUN apt-get update \
  && apt-get -yqq upgrade \
  && apt-get -yqq install \
    bison \
    cdbs \
    curl \
    flex \
    g++ \
    git \
    python \
    pkg-config \
    libglib2.0-dev \
    build-essential \
    libicu-dev

# Clone DepotTools
RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
ENV PATH="/tmp/depot_tools:${PATH}"

# Fetch V8
RUN fetch v8 \
  && cd v8 \
  && git checkout 7.5.288.23 \
  && gclient sync

# Build V8
RUN cd /tmp/v8 \
  && ./tools/dev/v8gen.py x64.release -- \
    is_debug=false \
    is_official_build=true \
    is_cfi=false \
    is_clang=false \
    is_component_build=true \
    use_custom_libcxx=false \
    v8_use_snapshot=true \
    v8_use_external_startup_data=false \
    v8_enable_i18n_support=true \
    symbol_level=0 \
    treat_warnings_as_errors=false \
  && ninja d8 -C out.gn/x64.release/ -j $(getconf _NPROCESSORS_ONLN)

... move files into /opt

snippet for v8js portion (after php installed)

RUN \
  cd /tmp \
  && git clone https://github.com/phpv8/v8js.git \
  && cd v8js \
  && phpize \
  && ./configure LDFLAGS="-lstdc++" --with-v8js=/opt/libv8 \
  && make \
  && make install

Error output:

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 -I/usr/include/php/main -I/usr/include/php/TSRM -I/
usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/opt/libv8/include -I/opt/libv8 -DHAVE_CONFIG_H -g -O2 -c /tmp/v8js/v8js_class.cc  -fPIC -DPIC -o .libs/v8js_class.o
In file included from /usr/include/dirent.h:245,
                 from /usr/include/php/Zend/zend_virtual_cwd.h:76,
                 from /usr/include/php/main/php.h:466,
                 from /tmp/v8js/php_v8js_macros.h:42,
                 from /tmp/v8js/v8js_class.cc:22:
/tmp/v8js/v8js_class.h: In function 'v8js_ctx* v8js_ctx_fetch_object(zend_object*)':
/tmp/v8js/v8js_class.h:83:54: warning: offsetof within non-standard-layout type 'v8js_ctx' is conditionally-supported [-Winvalid-offsetof]
   83 |  return (struct v8js_ctx *)((char *)obj - XtOffsetOf(struct v8js_ctx, std));
/tmp/v8js/v8js_class.h:83:43: note: in expansion of macro 'XtOffsetOf'
   83 |  return (struct v8js_ctx *)((char *)obj - XtOffsetOf(struct v8js_ctx, std));
      |                                           ^~~~~~~~~~
/tmp/v8js/v8js_class.cc: In function 'void v8js_free_storage(zend_object*)':
/tmp/v8js/v8js_class.cc:105:61: warning: ignoring return value of 'v8::Maybe<bool> v8::Object::Delete(v8::Local<v8::Context>, v8::Local<v8::Value>)', declared with attribute warn_unused_result [-Wunu
sed-result]
  105 |   V8JS_GLOBAL(c->isolate)->Delete(v8_context, object_name_js);
In file included from /tmp/v8js/php_v8js_macros.h:52,
                 from /tmp/v8js/v8js_class.cc:22:
/opt/libv8/include/v8.h:3452:37: note: declared here
 3452 |   V8_WARN_UNUSED_RESULT Maybe<bool> Delete(Local<Context> context,
      |                                     ^~~~~~
In file included from /usr/include/dirent.h:245,
                 from /usr/include/php/Zend/zend_virtual_cwd.h:76,
                 from /usr/include/php/main/php.h:466,
                 from /tmp/v8js/php_v8js_macros.h:42,
                 from /tmp/v8js/v8js_class.cc:22:
/tmp/v8js/v8js_class.cc: In function 'zend_object* v8js_new(zend_class_entry*)':
/tmp/v8js/v8js_class.cc:242:43: warning: offsetof within non-standard-layout type 'v8js_ctx' is conditionally-supported [-Winvalid-offsetof]
  242 |  v8js_object_handlers.offset = XtOffsetOf(struct v8js_ctx, std);
/tmp/v8js/v8js_class.cc:242:32: note: in expansion of macro 'XtOffsetOf'
  242 |  v8js_object_handlers.offset = XtOffsetOf(struct v8js_ctx, std);
      |                                ^~~~~~~~~~
/tmp/v8js/v8js_class.cc: In function 'void zim_V8Js___construct(zend_execute_data*, zval*)':
/tmp/v8js/v8js_class.cc:462:71: warning: ignoring return value of 'v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)', declared with attribute warn_u
nused_result [-Wunused-result]
  462 |  context->Global()->Set(context, V8JS_SYM("global"), context->Global());
      |                                                                       ^
In file included from /tmp/v8js/php_v8js_macros.h:52,
                 from /tmp/v8js/v8js_class.cc:22:
/opt/libv8/include/v8.h:3364:37: note: declared here
 3364 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
      |                                     ^~~
/tmp/v8js/v8js_class.cc:508:88: warning: ignoring return value of 'v8::Maybe<bool> v8::Object::DefineOwnProperty(v8::Local<v8::Context>, v8::Local<v8::Name>, v8::Local<v8::Value>, v8::PropertyAttribu
  508 |  V8JS_GLOBAL(isolate)->DefineOwnProperty(context, object_name_js, php_obj, v8::ReadOnly);
      |                                                                                        ^
In file included from /tmp/v8js/php_v8js_macros.h:52,
                 from /tmp/v8js/v8js_class.cc:22:
/opt/libv8/include/v8.h:3392:37: note: declared here
 3392 |   V8_WARN_UNUSED_RESULT Maybe<bool> DefineOwnProperty(
      |                                     ^~~~~~~~~~~~~~~~~
/tmp/v8js/v8js_class.cc:530:87: warning: ignoring return value of 'v8::Maybe<bool> v8::Object::DefineOwnProperty(v8::Local<v8::Context>, v8::Local<v8::Name>, v8::Local<v8::Value>, v8::PropertyAttribu
te)', declared with attribute warn_unused_result [-Wunused-result]
  530 |    php_obj->DefineOwnProperty(context, key, zval_to_v8js(value, isolate), v8::ReadOnly);
      |                                                                                       ^
In file included from /tmp/v8js/php_v8js_macros.h:52,
                 from /tmp/v8js/v8js_class.cc:22:
/opt/libv8/include/v8.h:3392:37: note: declared here
 3392 |   V8_WARN_UNUSED_RESULT Maybe<bool> DefineOwnProperty(
      |                                     ^~~~~~~~~~~~~~~~~
/tmp/v8js/v8js_class.cc:597:94: warning: ignoring return value of 'v8::Maybe<bool> v8::Object::CreateDataProperty(v8::Local<v8::Context>, v8::Local<v8::Name>, v8::Local<v8::Value>)', declared with at
tribute warn_unused_result [-Wunused-result]
  597 |   php_obj->CreateDataProperty(context, method_name, ft->GetFunction(context).ToLocalChecked());
      |                                                                                              ^
In file included from /tmp/v8js/php_v8js_macros.h:52,
                 from /tmp/v8js/v8js_class.cc:22:
/opt/libv8/include/v8.h:3379:37: note: declared here
 3379 |   V8_WARN_UNUSED_RESULT Maybe<bool> CreateDataProperty(Local<Context> context,
      |                                     ^~~~~~~~~~~~~~~~~~
/tmp/v8js/v8js_class.cc: In function 'int v8js_register_extension(zend_string*, zend_string*, zval*, zend_bool)':
/tmp/v8js/v8js_class.cc:1072:31: error: could not convert 'jsext->v8js_jsext::extension' from 'v8::Extension*' to 'std::unique_ptr<v8::Extension>'
 1072 |  v8::RegisterExtension(jsext->extension);
      |                        ~~~~~~~^~~~~~~~~
      |                               |
      |                               v8::Extension*
/tmp/v8js/v8js_class.cc: In function 'void v8js_write_property(zval*, zval*, zval*, void**)':
/tmp/v8js/v8js_class.cc:1333:87: warning: ignoring return value of 'v8::Maybe<bool> v8::Object::DefineOwnProperty(v8::Local<v8::Context>, v8::Local<v8::Name>, v8::Local<v8::Value>, v8::PropertyAttrib
ute)', declared with attribute warn_unused_result [-Wunused-result]
 1333 |   jsobj->DefineOwnProperty(v8_context, key, zval_to_v8js(value, isolate), v8::ReadOnly);
      |                                                                                       ^
In file included from /tmp/v8js/php_v8js_macros.h:52,
                 from /tmp/v8js/v8js_class.cc:22:
/opt/libv8/include/v8.h:3392:37: note: declared here
 3392 |   V8_WARN_UNUSED_RESULT Maybe<bool> DefineOwnProperty(
      |                                     ^~~~~~~~~~~~~~~~~
/tmp/v8js/v8js_class.cc: In function 'void v8js_unset_property(zval*, zval*, void**)':
/tmp/v8js/v8js_class.cc:1357:31: warning: ignoring return value of 'v8::Maybe<bool> v8::Object::Delete(v8::Local<v8::Context>, v8::Local<v8::Value>)', declared with attribute warn_unused_result [-Wun
used-result]
 1357 |  jsobj->Delete(v8_context, key);
      |                               ^
In file included from /tmp/v8js/php_v8js_macros.h:52,
                 from /tmp/v8js/v8js_class.cc:22:
/opt/libv8/include/v8.h:3452:37: note: declared here
 3452 |   V8_WARN_UNUSED_RESULT Maybe<bool> Delete(Local<Context> context,
      |                                     ^~~~~~
make: *** [Makefile:210: v8js_class.lo] Error 1

@stesie Any quick ideas to point me in right direction (without having to downgrade V8 versions?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions