Skip to content

Commit

Permalink
deps: fix V8 compilation on GCC 12.1 and 12.2
Browse files Browse the repository at this point in the history
  • Loading branch information
joyeecheung committed Jul 5, 2024
1 parent 66b76e2 commit 373864b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.15',
'v8_embedder_string': '-node.16',

##### V8 defaults for Node.js #####

Expand Down
7 changes: 6 additions & 1 deletion deps/v8/src/base/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,19 @@ namespace base {
// base::is_trivially_copyable will differ for these cases.
template <typename T>
struct is_trivially_copyable {
#if V8_CC_MSVC
#if V8_CC_MSVC || (__GNUC__ == 12 && __GNUC_MINOR__ < 2)
// Unfortunately, MSVC 2015 is broken in that std::is_trivially_copyable can
// be false even though it should be true according to the standard.
// (status at 2018-02-26, observed on the msvc waterfall bot).
// Interestingly, the lower-level primitives used below are working as
// intended, so we reimplement this according to the standard.
// See also https://developercommunity.visualstudio.com/content/problem/
// 170883/msvc-type-traits-stdis-trivial-is-bugged.html.
//
// GCC 12.1 and 12.2 are broken too, they are shipped by some stable Linux
// distributions, so the same polyfill is also used.
// See
// https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=aeba3e009b0abfccaf01797556445dbf891cc8dc
static constexpr bool value =
// Copy constructor is trivial or deleted.
(std::is_trivially_copy_constructible<T>::value ||
Expand Down

0 comments on commit 373864b

Please sign in to comment.