denoland/rusty_v8

Build From V8 Source Failed with GN_ARGS=“use_custom_libcxx=false”

zeeeeeeeeeeeen opened this issue · 1 comments

This is my configurations:

debug_assertions
panic="unwind"
target_arch="x86_64"
target_endian="little"
target_env="gnu"
target_family="unix"
target_feature="fxsr"
target_feature="sse"
target_feature="sse2"
target_has_atomic="16"
target_has_atomic="32"
target_has_atomic="64"
target_has_atomic="8"
target_has_atomic="ptr"
target_os="linux"
target_pointer_width="64"
target_vendor="unknown"
unix

And when i run GN_ARGS="use_custom_libcxx=false" V8_FROM_SOURCE=1 cargo build -vv
i got five errors when compiling obj/rusty_v8/binding.o:

  [86/1147] CXX obj/v8/mksnapshot/embedded-file-writer.o
  [87/1147] CXX obj/v8/v8_compiler/register-allocator-verifier.o
  [88/1147] CXX obj/v8/v8_compiler/bytecode-liveness-map.o
  [89/1147] CXX obj/rusty_v8/binding.o
  FAILED: obj/rusty_v8/binding.o 
  ../clang/bin/clang++ -MMD -MF obj/rusty_v8/binding.o.d -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_OZONE=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DDEBUG -DV8_ENABLE_CHECKS -DV8_DEPRECATION_WARNINGS -DV8_IMMINENT_DEPRECATION_WARNINGS -DCPPGC_CAGED_HEAP -DCPPGC_YOUNG_GENERATION -DCPPGC_POINTER_COMPRESSION -DCPPGC_SLIM_WRITE_BARRIER -DV8_TARGET_ARCH_X64 -DV8_HAVE_TARGET_OS -DV8_TARGET_OS_LINUX -DCPPGC_VERIFY_HEAP -DENABLE_DISASSEMBLER -DV8_PROMISE_INTERNAL_FIELD_COUNT=1 -DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=0 -DENABLE_GDB_JIT_INTERFACE -DOBJECT_PRINT -DVERIFY_HEAP -DV8_TRACE_MAPS -DV8_ENABLE_ALLOCATION_TIMEOUT -DV8_ENABLE_FORCE_SLOW_PATH -DV8_ENABLE_DOUBLE_CONST_STORE_CHECK -DV8_INTL_SUPPORT -DV8_CODE_COMMENTS -DV8_ENABLE_DEBUG_CODE -DV8_ENABLE_HEAP_SNAPSHOT_VERIFY -DV8_SNAPSHOT_NATIVE_CODE_COUNTERS -DV8_ATOMIC_OBJECT_FIELD_WRITES -DV8_ENABLE_LAZY_SOURCE_POSITIONS -DV8_WIN64_UNWINDING_INFO -DV8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH -DV8_SHORT_BUILTIN_CALLS -DV8_ENABLE_TURBOFAN -DV8_ENABLE_WEBASSEMBLY -DV8_ENABLE_JAVASCRIPT_PROMISE_HOOKS -DV8_ALLOCATION_FOLDING -DV8_ALLOCATION_SITE_TRACKING -DV8_ADVANCED_BIGINT_ALGORITHMS -DV8_USE_ZLIB -DV8_USE_LIBM_TRIG_FUNCTIONS -DV8_ENABLE_WASM_SIMD256_REVEC -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DUSE_CHROMIUM_ICU=1 -DU_ENABLE_TRACING=1 -DU_ENABLE_RESOURCE_TRACING=0 -DU_STATIC_IMPLEMENTATION -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -I../../.. -Igen -I../../../v8 -Igen/v8 -I../../../v8/include -Igen/v8/include -I../../../third_party/icu/source/common -I../../../third_party/icu/source/i18n -Wall -Werror -Wextra -Wimplicit-fallthrough -Wextra-semi -Wunreachable-code-aggressive -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-psabi -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-ignored-pragma-optimize -Wno-deprecated-builtins -Wno-bitfield-constant-conversion -Wno-deprecated-this-capture -Wshadow -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 -ffp-contract=off -m64 -msse3 -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -ffile-compilation-dir=. -no-canonical-prefixes -O0 -fno-omit-frame-pointer -gno-inline-line-tables -gdwarf-4 -gline-tables-only -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -fcolor-diagnostics -fansi-escape-codes -Wmissing-field-initializers -Wunreachable-code -Wctad-maybe-unsupported -Wno-shadow -Wshorten-64-to-32 -Wno-invalid-offsetof -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -std=c++20 -Wno-trigraphs -gsimple-template-names -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -c ../../../src/binding.cc -o obj/rusty_v8/binding.o
  In file included from ../../../src/binding.cc:7:
  ../../../src/support.h:80:24: error: 'is_pod<v8::Data *>' is deprecated: use is_standard_layout && is_trivial instead [-Werror,-Wdeprecated-declarations]
      static_assert(std::is_pod<P>::value, "type P must a pod type");
                         ^
  ../../../src/support.h:68:37: note: in instantiation of template class 'support::make_pod<v8::Data *>::helper<v8::Global<v8::Data>>' requested here
    inline make_pod(V&& value) : pod_(helper<V>(std::move(value))) {}
                                      ^
  ../../../src/binding.cc:355:10: note: in instantiation of function template specialization 'support::make_pod<v8::Data *>::make_pod<v8::Global<v8::Data>>' requested here
    return make_pod<v8::Data*>(std::move(global));
           ^
  /usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/type_traits:732:5: note: 'is_pod<v8::Data *>' has been explicitly marked deprecated here
      _GLIBCXX20_DEPRECATED("use is_standard_layout && is_trivial instead")
      ^
  /usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/x86_64-linux-gnu/c++/11/bits/c++config.h:117:39: note: expanded from macro '_GLIBCXX20_DEPRECATED'
  # define _GLIBCXX20_DEPRECATED(MSG) [[deprecated(MSG)]]
                                        ^
  In file included from ../../../src/binding.cc:7:
  ../../../src/support.h:80:24: error: 'is_pod<support::two_pointers_t>' is deprecated: use is_standard_layout && is_trivial instead [-Werror,-Wdeprecated-declarations]
      static_assert(std::is_pod<P>::value, "type P must a pod type");
                         ^
  ../../../src/support.h:68:37: note: in instantiation of template class 'support::make_pod<support::two_pointers_t>::helper<std::shared_ptr<v8::BackingStore>>' requested here
    inline make_pod(V&& value) : pod_(helper<V>(std::move(value))) {}
                                      ^
  ../../../src/binding.cc:850:10: note: in instantiation of function template specialization 'support::make_pod<support::two_pointers_t>::make_pod<std::shared_ptr<v8::BackingStore>>' requested here
    return make_pod<two_pointers_t>(ptr_to_local(&self)->GetBackingStore());
           ^
  /usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/type_traits:732:5: note: 'is_pod<support::two_pointers_t>' has been explicitly marked deprecated here
      _GLIBCXX20_DEPRECATED("use is_standard_layout && is_trivial instead")
      ^
  /usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/x86_64-linux-gnu/c++/11/bits/c++config.h:117:39: note: expanded from macro '_GLIBCXX20_DEPRECATED'
  # define _GLIBCXX20_DEPRECATED(MSG) [[deprecated(MSG)]]
                                        ^
  In file included from ../../../src/binding.cc:7:
  ../../../src/support.h:80:24: error: 'is_pod<support::two_pointers_t>' is deprecated: use is_standard_layout && is_trivial instead [-Werror,-Wdeprecated-declarations]
      static_assert(std::is_pod<P>::value, "type P must a pod type");
                         ^
  ../../../src/support.h:70:42: note: in instantiation of template class 'support::make_pod<support::two_pointers_t>::helper<std::shared_ptr<v8::ArrayBuffer::Allocator>>' requested here
    inline make_pod(const V& value) : pod_(helper<V>(value)) {}
                                           ^
  ../../../src/binding.cc:921:10: note: in instantiation of function template specialization 'support::make_pod<support::two_pointers_t>::make_pod<std::shared_ptr<v8::ArrayBuffer::Allocator>>' requested here
    return make_pod<two_pointers_t>(ptr);
           ^
  /usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/type_traits:732:5: note: 'is_pod<support::two_pointers_t>' has been explicitly marked deprecated here
      _GLIBCXX20_DEPRECATED("use is_standard_layout && is_trivial instead")
      ^
  /usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/x86_64-linux-gnu/c++/11/bits/c++config.h:117:39: note: expanded from macro '_GLIBCXX20_DEPRECATED'
  # define _GLIBCXX20_DEPRECATED(MSG) [[deprecated(MSG)]]
                                        ^
  In file included from ../../../src/binding.cc:7:
  ../../../src/support.h:80:24: error: 'is_pod<support::two_pointers_t>' is deprecated: use is_standard_layout && is_trivial instead [-Werror,-Wdeprecated-declarations]
      static_assert(std::is_pod<P>::value, "type P must a pod type");
                         ^
  ../../../src/support.h:68:37: note: in instantiation of template class 'support::make_pod<support::two_pointers_t>::helper<std::shared_ptr<v8::Platform>>' requested here
    inline make_pod(V&& value) : pod_(helper<V>(std::move(value))) {}
                                      ^
  ../../../src/binding.cc:2531:10: note: in instantiation of function template specialization 'support::make_pod<support::two_pointers_t>::make_pod<std::shared_ptr<v8::Platform>>' requested here
    return make_pod<two_pointers_t>(std::shared_ptr<v8::Platform>(unique_ptr));
           ^
  /usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/type_traits:732:5: note: 'is_pod<support::two_pointers_t>' has been explicitly marked deprecated here
      _GLIBCXX20_DEPRECATED("use is_standard_layout && is_trivial instead")
      ^
  /usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/x86_64-linux-gnu/c++/11/bits/c++config.h:117:39: note: expanded from macro '_GLIBCXX20_DEPRECATED'
  # define _GLIBCXX20_DEPRECATED(MSG) [[deprecated(MSG)]]
                                        ^
  In file included from ../../../src/binding.cc:7:
  ../../../src/support.h:80:24: **error**: 'is_pod<support::three_pointers_t>' is deprecated: use is_standard_layout && is_trivial instead [-Werror,-Wdeprecated-declarations]
      static_assert(std::is_pod<P>::value, "type P must a pod type");
                         ^
  ../../../src/support.h:68:37: note: in instantiation of template class 'support::make_pod<support::three_pointers_t>::helper<v8_inspector::StringView>' requested here
    inline make_pod(V&& value) : pod_(helper<V>(std::move(value))) {}
                                      ^
  ../../../src/binding.cc:2773:10: note: in instantiation of function template specialization 'support::make_pod<support::three_pointers_t>::make_pod<v8_inspector::StringView>' requested here
    return make_pod<three_pointers_t>(self.string());
           ^
  /usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/type_traits:732:5: note: 'is_pod<support::three_pointers_t>' has been explicitly marked deprecated here
      _GLIBCXX20_DEPRECATED("use is_standard_layout && is_trivial instead")
      ^
  /usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/x86_64-linux-gnu/c++/11/bits/c++config.h:117:39: note: expanded from macro '_GLIBCXX20_DEPRECATED'
  # define _GLIBCXX20_DEPRECATED(MSG) [[deprecated(MSG)]]
                                        ^
  5 errors generated.
  [90/1147] CXX obj/v8/torque_generated_definitions/name-tq.o
  [91/1147] CXX obj/v8/v8_compiler/branch-condition-duplicator.o
  [92/1147] CXX obj/v8/v8_compiler/checkpoint-elimination.o
  [93/1147] CXX obj/v8/v8_compiler/common-node-cache.o
  [94/1147] CXX obj/v8/torque_generated_definitions/factory.o
  [95/1147] CXX obj/v8/v8_compiler/branch-elimination.o
  [96/1147] CXX obj/v8/v8_compiler/common-operator.o
  [97/1147] CXX obj/v8/v8_compiler/common-operator-reducer.o
  [98/1147] CXX obj/v8/torque_generated_definitions/class-verifiers.o
  [99/1147] CXX obj/v8/torque_generated_definitions/objects-printer.o
  [100/1147] CXX obj/v8/v8_compiler/c-linkage.o
  [101/1147] CXX obj/v8/v8_compiler/basic-block-instrumentor.o
  [102/1147] CXX obj/v8/v8_compiler/register-allocator.o
  [103/1147] CXX obj/v8/torque_generated_initializers/array-reverse-tq-csa.o
  [104/1147] CXX obj/v8/v8_compiler/code-assembler.o
  [105/1147] CXX obj/v8/v8_compiler/bytecode-graph-builder.o
  [106/1147] CXX obj/v8/v8_compiler/bytecode-analysis.o
  ninja: build stopped: subcommand failed.

  --- stderr
  thread 'main' panicked at 'assertion failed: ninja(&gn_out_dir, maybe_env).arg(target).status().unwrap().success()', build.rs:742:3
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

How can i solve this problem?

add treat_warnings_as_errors=false to gn args
e.g
GN_ARGS="treat_warnings_as_errors=false use_custom_libcxx=false" V8_FROM_SOURCE=1 cargo build -vv

also you can enable use_custom_libcxx feature, insted of passing this parameter as env var:

[dependencies]
v8 = { version = "0.74.1", features = ["use_custom_libcxx"] }

and then run build like this:

GN_ARGS="treat_warnings_as_errors=false" V8_FROM_SOURCE=1 cargo build -vv