From be51d157e6f3bbfb49228cad22d888658371c70d Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Tue, 25 May 2021 06:31:32 -0400 Subject: [PATCH 1/3] build: compile with --gnu++17 Enables C++17 features. --- common.gypi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common.gypi b/common.gypi index 9da5c37fb67324..3ad21b22551206 100644 --- a/common.gypi +++ b/common.gypi @@ -377,7 +377,7 @@ }], [ 'OS in "linux freebsd openbsd solaris android aix cloudabi"', { 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ], - 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++14' ], + 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++17' ], 'defines': [ '__STDC_FORMAT_MACROS' ], 'ldflags': [ '-rdynamic' ], 'target_conditions': [ @@ -521,7 +521,7 @@ ['clang==1', { 'xcode_settings': { 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0', - 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++14', # -std=gnu++14 + 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++17', # -std=gnu++17 'CLANG_CXX_LIBRARY': 'libc++', }, }], From d73e3515d9b61e27ac88c978145e65e4a21210cf Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Thu, 30 Sep 2021 11:45:53 -0400 Subject: [PATCH 2/3] deps: workaround debug link error on Windows --- common.gypi | 2 +- deps/v8/src/objects/fixed-array.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/common.gypi b/common.gypi index 3ad21b22551206..c0427c25a02be6 100644 --- a/common.gypi +++ b/common.gypi @@ -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.10', + 'v8_embedder_string': '-node.11', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/objects/fixed-array.h b/deps/v8/src/objects/fixed-array.h index 6b0ac5d9acaca1..8488371744fa16 100644 --- a/deps/v8/src/objects/fixed-array.h +++ b/deps/v8/src/objects/fixed-array.h @@ -138,7 +138,9 @@ class FixedArray inline void set(int index, Smi value); #else inline void set(int index, Smi value) { +#if !defined(_WIN32) DCHECK_NE(map(), GetReadOnlyRoots().fixed_cow_array_map()); +#endif DCHECK_LT(static_cast(index), static_cast(length())); DCHECK(Object(value).IsSmi()); int offset = OffsetOfElementAt(index); From 941c87f964e6dad51b5e5b7e0ad65925344c7401 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Fri, 3 Sep 2021 12:54:28 -0400 Subject: [PATCH 3/3] build: compile with C++17 (MSVC) --- common.gypi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common.gypi b/common.gypi index c0427c25a02be6..505cacb938e664 100644 --- a/common.gypi +++ b/common.gypi @@ -259,7 +259,10 @@ ], 'msvs_settings': { 'VCCLCompilerTool': { - 'AdditionalOptions': ['/Zc:__cplusplus'], + 'AdditionalOptions': [ + '/Zc:__cplusplus', + '-std:c++17' + ], 'BufferSecurityCheck': 'true', 'DebugInformationFormat': 1, # /Z7 embed info in .obj files 'ExceptionHandling': 0, # /EHsc