Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build failure with GCC 13.0.1 #47623

Closed
AdamMajer opened this issue Apr 19, 2023 · 5 comments · Fixed by #47736
Closed

build failure with GCC 13.0.1 #47623

AdamMajer opened this issue Apr 19, 2023 · 5 comments · Fixed by #47736
Labels
build Issues and PRs related to build files or the CI. c++ Issues and PRs that require attention from people who are familiar with C++. linux Issues and PRs related to the Linux platform. v8 engine Issues and PRs related to the V8 dependency.

Comments

@AdamMajer
Copy link
Contributor

Version

No response

Platform

Linux adamm 6.2.9-1-default #1 SMP PREEMPT_DYNAMIC Thu Mar 30 11:30:50 UTC 2023 (7a187a3) x86_64 x86_64 x86_64 GNU/Linux

Subsystem

v8

What steps will reproduce the bug?

No response

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior? Why is that the expected behavior?

No response

What do you see instead?

make -C out BUILDTYPE=Release V=0
  touch b330bfef5d59510adb0bc675f3ceb533fdba5835.intermediate
  LD_LIBRARY_PATH=/home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/lib.host:/home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../.; mkdir -p /home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/obj/gen/src/node/inspector/protocol; /usr/bin/python3.10 tools/inspector_protocol/code_generator.py --jinja_dir tools/inspector_protocol --output_base "/home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/obj/gen/src/" --config src/inspector/node_protocol_config.json
  touch 1dfca612d2d78c7c86ce286a9bf3514b7e6c7042.intermediate
  LD_LIBRARY_PATH=/home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/lib.host:/home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../tools/v8_gypfiles; mkdir -p /home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/obj/gen/torque-generated/src/builtins /home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/obj/gen/torque-generated /home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/obj/gen/torque-generated/third_party/v8/builtins /home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/obj/gen/torque-generated/src/debug /home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/obj/gen/torque-generated/src/ic /home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/obj/gen/torque-generated/src/wasm /home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/obj/gen/torque-generated/src/objects /home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/obj/gen/torque-generated/test/torque; "/home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/torque" -o "/home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/obj/gen/torque-generated" -v8-root ../../deps/v8 src/builtins/aggregate-error.tq src/builtins/array-at.tq src/builtins/array-concat.tq src/builtins/array-copywithin.tq src/builtins/array-every.tq src/builtins/array-filter.tq src/builtins/array-find.tq src/builtins/array-findindex.tq src/builtins/array-findlast.tq src/builtins/array-findlastindex.tq src/builtins/array-foreach.tq src/builtins/array-from.tq src/builtins/array-isarray.tq src/builtins/array-join.tq src/builtins/array-lastindexof.tq src/builtins/array-map.tq src/builtins/array-of.tq src/builtins/array-reduce-right.tq src/builtins/array-reduce.tq src/builtins/array-reverse.tq src/builtins/array-shift.tq src/builtins/array-slice.tq src/builtins/array-some.tq src/builtins/array-splice.tq src/builtins/array-to-reversed.tq src/builtins/array-to-sorted.tq src/builtins/array-to-spliced.tq src/builtins/array-unshift.tq src/builtins/array-with.tq src/builtins/array.tq src/builtins/arraybuffer.tq src/builtins/base.tq src/builtins/boolean.tq src/builtins/builtins-bigint.tq src/builtins/builtins-string.tq src/builtins/cast.tq src/builtins/collections.tq src/builtins/constructor.tq src/builtins/conversion.tq src/builtins/convert.tq src/builtins/console.tq src/builtins/data-view.tq src/builtins/finalization-registry.tq src/builtins/frames.tq src/builtins/frame-arguments.tq src/builtins/function.tq src/builtins/growable-fixed-array.tq src/builtins/ic-callable.tq src/builtins/ic.tq src/builtins/internal-coverage.tq src/builtins/internal.tq src/builtins/iterator.tq src/builtins/iterator-from.tq src/builtins/iterator-helpers.tq src/builtins/math.tq src/builtins/number.tq src/builtins/object-fromentries.tq src/builtins/object.tq src/builtins/promise-abstract-operations.tq src/builtins/promise-all.tq src/builtins/promise-all-element-closure.tq src/builtins/promise-any.tq src/builtins/promise-constructor.tq src/builtins/promise-finally.tq src/builtins/promise-misc.tq src/builtins/promise-race.tq src/builtins/promise-reaction-job.tq src/builtins/promise-resolve.tq src/builtins/promise-then.tq src/builtins/promise-jobs.tq src/builtins/proxy-constructor.tq src/builtins/proxy-delete-property.tq src/builtins/proxy-get-property.tq src/builtins/proxy-get-prototype-of.tq src/builtins/proxy-has-property.tq src/builtins/proxy-is-extensible.tq src/builtins/proxy-prevent-extensions.tq src/builtins/proxy-revocable.tq src/builtins/proxy-revoke.tq src/builtins/proxy-set-property.tq src/builtins/proxy-set-prototype-of.tq src/builtins/proxy.tq src/builtins/reflect.tq src/builtins/regexp-exec.tq src/builtins/regexp-match-all.tq src/builtins/regexp-match.tq src/builtins/regexp-replace.tq src/builtins/regexp-search.tq src/builtins/regexp-source.tq src/builtins/regexp-split.tq src/builtins/regexp-test.tq src/builtins/regexp.tq src/builtins/string-at.tq src/builtins/string-endswith.tq src/builtins/string-html.tq src/builtins/string-includes.tq src/builtins/string-indexof.tq src/builtins/string-iswellformed.tq src/builtins/string-iterator.tq src/builtins/string-match-search.tq src/builtins/string-pad.tq src/builtins/string-repeat.tq src/builtins/string-replaceall.tq src/builtins/string-slice.tq src/builtins/string-startswith.tq src/builtins/string-substr.tq src/builtins/string-substring.tq src/builtins/string-towellformed.tq src/builtins/string-trim.tq src/builtins/symbol.tq src/builtins/torque-internal.tq src/builtins/typed-array-at.tq src/builtins/typed-array-createtypedarray.tq src/builtins/typed-array-every.tq src/builtins/typed-array-entries.tq src/builtins/typed-array-filter.tq src/builtins/typed-array-find.tq src/builtins/typed-array-findindex.tq src/builtins/typed-array-findlast.tq src/builtins/typed-array-findlastindex.tq src/builtins/typed-array-foreach.tq src/builtins/typed-array-from.tq src/builtins/typed-array-keys.tq src/builtins/typed-array-of.tq src/builtins/typed-array-reduce.tq src/builtins/typed-array-reduceright.tq src/builtins/typed-array-set.tq src/builtins/typed-array-slice.tq src/builtins/typed-array-some.tq src/builtins/typed-array-sort.tq src/builtins/typed-array-subarray.tq src/builtins/typed-array-to-reversed.tq src/builtins/typed-array-to-sorted.tq src/builtins/typed-array-values.tq src/builtins/typed-array-with.tq src/builtins/typed-array.tq src/builtins/weak-ref.tq src/ic/handler-configuration.tq src/objects/allocation-site.tq src/objects/api-callbacks.tq src/objects/arguments.tq src/objects/bigint.tq src/objects/call-site-info.tq src/objects/cell.tq src/objects/code.tq src/objects/contexts.tq src/objects/data-handler.tq src/objects/debug-objects.tq src/objects/descriptor-array.tq src/objects/embedder-data-array.tq src/objects/feedback-cell.tq src/objects/feedback-vector.tq src/objects/fixed-array.tq src/objects/foreign.tq src/objects/free-space.tq src/objects/heap-number.tq src/objects/heap-object.tq src/objects/js-array-buffer.tq src/objects/js-array.tq src/objects/js-atomics-synchronization.tq src/objects/js-collection-iterator.tq src/objects/js-collection.tq src/objects/js-function.tq src/objects/js-generator.tq src/objects/js-iterator-helpers.tq src/objects/js-objects.tq src/objects/js-promise.tq src/objects/js-proxy.tq src/objects/js-raw-json.tq src/objects/js-regexp-string-iterator.tq src/objects/js-regexp.tq src/objects/js-shadow-realm.tq src/objects/js-shared-array.tq src/objects/js-struct.tq src/objects/js-temporal-objects.tq src/objects/js-weak-refs.tq src/objects/literal-objects.tq src/objects/map.tq src/objects/megadom-handler.tq src/objects/microtask.tq src/objects/module.tq src/objects/name.tq src/objects/oddball.tq src/objects/ordered-hash-table.tq src/objects/primitive-heap-object.tq src/objects/promise.tq src/objects/property-array.tq src/objects/property-cell.tq src/objects/property-descriptor-object.tq src/objects/prototype-info.tq src/objects/regexp-match-info.tq src/objects/scope-info.tq src/objects/script.tq src/objects/shared-function-info.tq src/objects/source-text-module.tq src/objects/string.tq src/objects/struct.tq src/objects/swiss-hash-table-helpers.tq src/objects/swiss-name-dictionary.tq src/objects/synthetic-module.tq src/objects/template-objects.tq src/objects/templates.tq src/objects/torque-defined-classes.tq src/objects/turbofan-types.tq src/objects/turboshaft-types.tq test/torque/test-torque.tq third_party/v8/builtins/array-sort.tq src/objects/intl-objects.tq src/objects/js-break-iterator.tq src/objects/js-collator.tq src/objects/js-date-time-format.tq src/objects/js-display-names.tq src/objects/js-duration-format.tq src/objects/js-list-format.tq src/objects/js-locale.tq src/objects/js-number-format.tq src/objects/js-plural-rules.tq src/objects/js-relative-time-format.tq src/objects/js-segment-iterator.tq src/objects/js-segmenter.tq src/objects/js-segments.tq src/builtins/wasm.tq src/debug/debug-wasm-objects.tq src/wasm/wasm-objects.tq
  touch ea3b7243f982767150d5443c259af52ecdb36ca7.intermediate
  LD_LIBRARY_PATH=/home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/lib.host:/home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../tools/v8_gypfiles; mkdir -p /home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/obj/gen/inspector-generated-output-root/src/inspector/protocol /home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/obj/gen/inspector-generated-output-root/include/inspector; /usr/bin/python3.10 ../../deps/v8/third_party/inspector_protocol/code_generator.py --jinja_dir ../../deps/v8/third_party --output_base "/home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/obj/gen/inspector-generated-output-root/src/inspector" --config ../../deps/v8/src/inspector/inspector_protocol_config.json --config_value "protocol.path=../../deps/v8/include/js_protocol.pdl" --inspector_protocol_dir ../../deps/v8/third_party/inspector_protocol
  g++ -o /home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/obj.target/v8_initializers/deps/v8/src/builtins/builtins-array-gen.o ../deps/v8/src/builtins/builtins-array-gen.cc '-D_GLIBCXX_USE_CXX11_ABI=1' '-DNODE_OPENSSL_CONF_NAME=nodejs_conf' '-DNODE_OPENSSL_CERT_STORE' '-DICU_NO_USER_DATA_OVERRIDE' '-DV8_GYP_BUILD' '-DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64' '-D__STDC_FORMAT_MACROS' '-DV8_TARGET_ARCH_X64' '-DV8_HAVE_TARGET_OS' '-DV8_TARGET_OS_LINUX' '-DV8_EMBEDDER_STRING="-node.3"' '-DENABLE_DISASSEMBLER' '-DV8_PROMISE_INTERNAL_FIELD_COUNT=1' '-DENABLE_GDB_JIT_INTERFACE' '-DV8_SHORT_BUILTIN_CALLS' '-DOBJECT_PRINT' '-DV8_INTL_SUPPORT' '-DV8_ATOMIC_OBJECT_FIELD_WRITES' '-DV8_ENABLE_LAZY_SOURCE_POSITIONS' '-DV8_USE_SIPHASH' '-DV8_SHARED_RO_HEAP' '-DV8_WIN64_UNWINDING_INFO' '-DV8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH' '-DV8_USE_ZLIB' '-DV8_ENABLE_TURBOFAN' '-DV8_ENABLE_WEBASSEMBLY' '-DV8_ENABLE_JAVASCRIPT_PROMISE_HOOKS' '-DV8_ALLOCATION_FOLDING' '-DV8_ALLOCATION_SITE_TRACKING' '-DV8_SCRIPTORMODULE_LEGACY_LIFETIME' '-DV8_ADVANCED_BIGINT_ALGORITHMS' -I../deps/v8 -I../deps/v8/include -I/home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/obj/gen -I/home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/obj/gen/generate-bytecode-output-root  -pthread -Wno-unused-parameter -m64 -Wno-return-type -fno-strict-aliasing -m64 -O3 -fno-omit-frame-pointer -fdata-sections -ffunction-sections -O3 -fno-rtti -fno-exceptions -std=gnu++17 -MMD -MF /home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/.deps//home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/obj.target/v8_initializers/deps/v8/src/builtins/builtins-array-gen.o.d.raw  -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type  -g -Wno-error=return-type -fno-strict-aliasing -Wno-class-memaccess -g1 -c
In file included from ../deps/v8/src/codegen/machine-type.h:13,
                 from ../deps/v8/src/codegen/interface-descriptors.h:11,
                 from ../deps/v8/src/codegen/callable.h:8,
                 from ../deps/v8/src/codegen/code-factory.h:8,
                 from ../deps/v8/src/codegen/code-stub-assembler.h:12,
                 from ../deps/v8/src/builtins/builtins-array-gen.h:8,
                 from ../deps/v8/src/builtins/builtins-array-gen.cc:5:
../deps/v8/src/common/globals.h:184:9: warning: multi-line comment [-Wcomment]
  184 | #endif  // defined(USE_SIMULATOR) && \
      |         ^
In file included from ../deps/v8/src/codegen/code-stub-assembler.h:16:
../deps/v8/src/compiler/code-assembler.h: In member function 'v8::internal::TNode<v8::internal::IntPtrT> v8::internal::compiler::CodeAssembler::BitcastTaggedToWord(v8::internal::TNode<v8::internal::Smi>)':
../deps/v8/src/compiler/code-assembler.h:1119:3: warning: no return statement in function returning non-void [-Wreturn-type]
 1119 |   }
      |   ^
In file included from /usr/include/c++/13/bits/move.h:57,
                 from /usr/include/c++/13/bits/stl_function.h:60,
                 from /usr/include/c++/13/functional:49,
                 from ../deps/v8/src/codegen/code-stub-assembler.h:8:
/usr/include/c++/13/type_traits: In instantiation of 'struct std::is_convertible<v8::internal::WasmArray, v8::internal::Object>':
../deps/v8/src/codegen/tnode.h:273:72:   required from 'const bool v8::internal::is_subtype<v8::internal::WasmArray, v8::internal::WasmArray>::value'
../deps/v8/src/codegen/tnode.h:361:75:   required by substitution of 'template<class U, typename std::enable_if<v8::internal::is_subtype<U, v8::internal::WasmArray>::value, int>::type <anonymous> > v8::internal::TNode<v8::internal::WasmArray>::TNode(const v8::internal::TNode<T>&) [with U = v8::internal::WasmArray; typename std::enable_if<v8::internal::is_subtype<U, v8::internal::WasmArray>::value, int>::type <anonymous> = <missing>]'
/usr/include/c++/13/tuple:188:12:   required from 'struct std::_Head_base<0, v8::internal::TNode<v8::internal::WasmArray>, false>'
/usr/include/c++/13/tuple:259:12:   required from 'struct std::_Tuple_impl<0, v8::internal::TNode<v8::internal::WasmArray>, v8::internal::TNode<v8::internal::IntPtrT>, v8::internal::TNode<v8::internal::IntPtrT> >'
/usr/include/c++/13/tuple:746:11:   required from 'class std::tuple<v8::internal::TNode<v8::internal::WasmArray>, v8::internal::TNode<v8::internal::IntPtrT>, v8::internal::TNode<v8::internal::IntPtrT> >'
/home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/obj/gen/torque-generated/csa-types.h:488:80:   required from here
/usr/include/c++/13/type_traits:1417:30: error: invalid use of incomplete type 'class v8::internal::WasmArray'
 1417 |     : public __bool_constant<__is_convertible(_From, _To)>
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../deps/v8/src/heap/factory-base.h:16,
                 from ../deps/v8/src/heap/factory.h:18,
                 from ../deps/v8/src/execution/isolate.h:36,
                 from ../deps/v8/src/codegen/interface-descriptors.h:15:
/home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/obj/gen/torque-generated/class-forward-declarations.h:300:7: note: forward declaration of 'class v8::internal::WasmArray'
  300 | class WasmArray;
      |       ^~~~~~~~~
In file included from ../deps/v8/src/codegen/interface-descriptors.h:13:
../deps/v8/src/codegen/tnode.h: In instantiation of 'const bool v8::internal::is_subtype<v8::internal::WasmArray, v8::internal::WasmArray>::value':
../deps/v8/src/codegen/tnode.h:361:75:   required by substitution of 'template<class U, typename std::enable_if<v8::internal::is_subtype<U, v8::internal::WasmArray>::value, int>::type <anonymous> > v8::internal::TNode<v8::internal::WasmArray>::TNode(const v8::internal::TNode<T>&) [with U = v8::internal::WasmArray; typename std::enable_if<v8::internal::is_subtype<U, v8::internal::WasmArray>::value, int>::type <anonymous> = <missing>]'
/usr/include/c++/13/tuple:188:12:   required from 'struct std::_Head_base<0, v8::internal::TNode<v8::internal::WasmArray>, false>'
/usr/include/c++/13/tuple:259:12:   required from 'struct std::_Tuple_impl<0, v8::internal::TNode<v8::internal::WasmArray>, v8::internal::TNode<v8::internal::IntPtrT>, v8::internal::TNode<v8::internal::IntPtrT> >'
/usr/include/c++/13/tuple:746:11:   required from 'class std::tuple<v8::internal::TNode<v8::internal::WasmArray>, v8::internal::TNode<v8::internal::IntPtrT>, v8::internal::TNode<v8::internal::IntPtrT> >'
/home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/obj/gen/torque-generated/csa-types.h:488:80:   required from here
../deps/v8/src/codegen/tnode.h:273:72: error: 'value' is not a member of 'std::is_convertible<v8::internal::WasmArray, v8::internal::Object>'
  273 |                                        std::is_convertible<T, Object>::value);
      |                                                                        ^~~~~
../deps/v8/src/compiler/code-assembler.h: In function 'bool v8::internal::NeedsBoundsCheck(CheckBounds)':
../deps/v8/src/compiler/code-assembler.h:88:1: warning: control reaches end of non-void function [-Wreturn-type]
   88 | }
      | ^
make[1]: *** [tools/v8_gypfiles/v8_initializers.target.mk:423: /home/abuild/rpmbuild/BUILD/node-v20.0.0/out/Release/obj.target/v8_initializers/deps/v8/src/builtins/builtins-array-gen.o] Error 1
rm 1dfca612d2d78c7c86ce286a9bf3514b7e6c7042.intermediate ea3b7243f982767150d5443c259af52ecdb36ca7.intermediate b330bfef5d59510adb0bc675f3ceb533fdba5835.intermediate
make: *** [Makefile:134: node20] Error 2

Additional information

No response

@tniessen tniessen added c++ Issues and PRs that require attention from people who are familiar with C++. build Issues and PRs related to build files or the CI. linux Issues and PRs related to the Linux platform. labels Apr 19, 2023
@targos
Copy link
Member

targos commented Apr 20, 2023

This should probably be reported at https://bugs.chromium.org/p/v8/issues/list

@targos targos added the v8 engine Issues and PRs related to the V8 dependency. label Apr 20, 2023
@sgallagher
Copy link
Contributor

Reported to v8 upstream as https://bugs.chromium.org/p/v8/issues/detail?id=13954

@sgallagher
Copy link
Contributor

Looks like there's a fix available upstream in v8: https://chromium-review.googlesource.com/c/v8/v8/+/4394663

Could we get that backported to Node.js 20?

@sgallagher
Copy link
Contributor

@AdamMajer Since I see you were attempting an RPM build, here's the patch I am now carrying in Fedora:

From a6cc04e2e21212cd6dae6d868002549bfd0cba21 Mon Sep 17 00:00:00 2001
From: Stephan Hartmann <stha09@googlemail.com>
Date: Mon, 3 Apr 2023 12:19:34 +0200
Subject: [PATCH 2/2] libstdc++: fix incomplete type in
 v8::internal::is_subtype<T, U>

Using std::convertible with incomplete types is UB. However, till
GCC 12 it was accepted and std::convertible returned false.
This fails now for e.g. v8::internal::WasmArray. Use
std::disjunction and std::conjunction instead which are short-
circuiting, because std::is_base_of<T, T> is already true.

Bug: chromium:957519
Change-Id: Ia26643dbdf0fb00d5586c71ae6b18e8d0f3cf96e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4394663
Commit-Queue: Stephan Hartmann <stha09@googlemail.com>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#86904}
---
 deps/v8/src/codegen/tnode.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/deps/v8/src/codegen/tnode.h b/deps/v8/src/codegen/tnode.h
index 1f2a3dcfd9c5e3007d2de5bbe730eaac1aec3066..9360425c2edfc5e2369152a0f75aae21f3120645 100644
--- a/deps/v8/src/codegen/tnode.h
+++ b/deps/v8/src/codegen/tnode.h
@@ -266,8 +266,9 @@ using BuiltinPtr = Smi;
 template <class T, class U>
 struct is_subtype {
   static const bool value =
-      std::is_base_of<U, T>::value || (std::is_same<U, MaybeObject>::value &&
-                                       std::is_convertible<T, Object>::value);
+      std::disjunction<std::is_base_of<U, T>,
+                       std::conjunction<std::is_same<U, MaybeObject>,
+                                        std::is_convertible<T, Object>>>::value;
 };
 template <class T1, class T2, class U>
 struct is_subtype<UnionT<T1, T2>, U> {
-- 
2.40.0

@richardlau
Copy link
Member

Looks like there's a fix available upstream in v8: https://chromium-review.googlesource.com/c/v8/v8/+/4394663

Could we get that backported to Node.js 20?

Backport PR: #47736

nodejs-github-bot pushed a commit that referenced this issue Apr 28, 2023
Original commit message:

    libstdc++: fix incomplete type in v8::internal::is_subtype<T, U>

    Using std::convertible with incomplete types is UB. However, till
    GCC 12 it was accepted and std::convertible returned false.
    This fails now for e.g. v8::internal::WasmArray. Use
    std::disjunction and std::conjunction instead which are short-
    circuiting, because std::is_base_of<T, T> is already true.

    Bug: chromium:957519
    Change-Id: Ia26643dbdf0fb00d5586c71ae6b18e8d0f3cf96e
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4394663
    Commit-Queue: Stephan Hartmann <stha09@googlemail.com>
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#86904}

Refs: v8/v8@c5ab3e4
PR-URL: #47736
Fixes: #47623
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
yjl9903 pushed a commit to yjl9903/node that referenced this issue Apr 29, 2023
Original commit message:

    libstdc++: fix incomplete type in v8::internal::is_subtype<T, U>

    Using std::convertible with incomplete types is UB. However, till
    GCC 12 it was accepted and std::convertible returned false.
    This fails now for e.g. v8::internal::WasmArray. Use
    std::disjunction and std::conjunction instead which are short-
    circuiting, because std::is_base_of<T, T> is already true.

    Bug: chromium:957519
    Change-Id: Ia26643dbdf0fb00d5586c71ae6b18e8d0f3cf96e
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4394663
    Commit-Queue: Stephan Hartmann <stha09@googlemail.com>
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#86904}

Refs: v8/v8@c5ab3e4
PR-URL: nodejs#47736
Fixes: nodejs#47623
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
targos pushed a commit that referenced this issue May 2, 2023
Original commit message:

    libstdc++: fix incomplete type in v8::internal::is_subtype<T, U>

    Using std::convertible with incomplete types is UB. However, till
    GCC 12 it was accepted and std::convertible returned false.
    This fails now for e.g. v8::internal::WasmArray. Use
    std::disjunction and std::conjunction instead which are short-
    circuiting, because std::is_base_of<T, T> is already true.

    Bug: chromium:957519
    Change-Id: Ia26643dbdf0fb00d5586c71ae6b18e8d0f3cf96e
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4394663
    Commit-Queue: Stephan Hartmann <stha09@googlemail.com>
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#86904}

Refs: v8/v8@c5ab3e4
PR-URL: #47736
Fixes: #47623
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
targos pushed a commit that referenced this issue May 3, 2023
Original commit message:

    libstdc++: fix incomplete type in v8::internal::is_subtype<T, U>

    Using std::convertible with incomplete types is UB. However, till
    GCC 12 it was accepted and std::convertible returned false.
    This fails now for e.g. v8::internal::WasmArray. Use
    std::disjunction and std::conjunction instead which are short-
    circuiting, because std::is_base_of<T, T> is already true.

    Bug: chromium:957519
    Change-Id: Ia26643dbdf0fb00d5586c71ae6b18e8d0f3cf96e
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4394663
    Commit-Queue: Stephan Hartmann <stha09@googlemail.com>
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#86904}

Refs: v8/v8@c5ab3e4
PR-URL: #47736
Fixes: #47623
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
danielleadams pushed a commit that referenced this issue Jul 6, 2023
Original commit message:

    libstdc++: fix incomplete type in v8::internal::is_subtype<T, U>

    Using std::convertible with incomplete types is UB. However, till
    GCC 12 it was accepted and std::convertible returned false.
    This fails now for e.g. v8::internal::WasmArray. Use
    std::disjunction and std::conjunction instead which are short-
    circuiting, because std::is_base_of<T, T> is already true.

    Bug: chromium:957519
    Change-Id: Ia26643dbdf0fb00d5586c71ae6b18e8d0f3cf96e
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4394663
    Commit-Queue: Stephan Hartmann <stha09@googlemail.com>
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#86904}

Refs: v8/v8@c5ab3e4
PR-URL: #47736
Fixes: #47623
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
MoLow pushed a commit to MoLow/node that referenced this issue Jul 6, 2023
Original commit message:

    libstdc++: fix incomplete type in v8::internal::is_subtype<T, U>

    Using std::convertible with incomplete types is UB. However, till
    GCC 12 it was accepted and std::convertible returned false.
    This fails now for e.g. v8::internal::WasmArray. Use
    std::disjunction and std::conjunction instead which are short-
    circuiting, because std::is_base_of<T, T> is already true.

    Bug: chromium:957519
    Change-Id: Ia26643dbdf0fb00d5586c71ae6b18e8d0f3cf96e
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4394663
    Commit-Queue: Stephan Hartmann <stha09@googlemail.com>
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#86904}

Refs: v8/v8@c5ab3e4
PR-URL: nodejs#47736
Fixes: nodejs#47623
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. c++ Issues and PRs that require attention from people who are familiar with C++. linux Issues and PRs related to the Linux platform. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants