From 443480e5d246baa30e9f7a3e177bcbadc6d8247c Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Wed, 26 Apr 2023 14:53:08 -0400 Subject: [PATCH] Fix bug on gcc13 Signed-off-by: Stephen Gallagher --- ...mplete-type-in-v8-internal-is_subtyp.patch | 41 +++++++++++++++++++ nodejs20.spec | 1 + 2 files changed, 42 insertions(+) create mode 100644 0002-libstdc-fix-incomplete-type-in-v8-internal-is_subtyp.patch diff --git a/0002-libstdc-fix-incomplete-type-in-v8-internal-is_subtyp.patch b/0002-libstdc-fix-incomplete-type-in-v8-internal-is_subtyp.patch new file mode 100644 index 0000000..f8cdc2d --- /dev/null +++ b/0002-libstdc-fix-incomplete-type-in-v8-internal-is_subtyp.patch @@ -0,0 +1,41 @@ +From a6cc04e2e21212cd6dae6d868002549bfd0cba21 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Mon, 3 Apr 2023 12:19:34 +0200 +Subject: [PATCH 2/2] libstdc++: fix incomplete type in + v8::internal::is_subtype + +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 is already true. + +Bug: chromium:957519 +Change-Id: Ia26643dbdf0fb00d5586c71ae6b18e8d0f3cf96e +Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4394663 +Commit-Queue: Stephan Hartmann +Reviewed-by: Clemens Backes +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 + struct is_subtype { + static const bool value = +- std::is_base_of::value || (std::is_same::value && +- std::is_convertible::value); ++ std::disjunction, ++ std::conjunction, ++ std::is_convertible>>::value; + }; + template + struct is_subtype, U> { +-- +2.40.0 + diff --git a/nodejs20.spec b/nodejs20.spec index cd2179f..e922865 100644 --- a/nodejs20.spec +++ b/nodejs20.spec @@ -148,6 +148,7 @@ Source111: undici-5.21.0-stripped.tar.gz Source112: wasi-sdk-14.0-linux.tar.gz Patch: 0001-Remove-unused-OpenSSL-config.patch +Patch: 0002-libstdc-fix-incomplete-type-in-v8-internal-is_subtyp.patch %if 0%{?nodejs_default} %global pkgname nodejs