From ff3a4ec60d5e4802b63fea66d318b88d7cfe19d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sat, 4 Jul 2020 16:50:02 +0200 Subject: [PATCH 01/12] tools: hack gyp to generate clang-cl solutions --- tools/gyp/pylib/gyp/generator/msvs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/gyp/pylib/gyp/generator/msvs.py b/tools/gyp/pylib/gyp/generator/msvs.py index 13b0794b4dcc..e5b35910b0f0 100644 --- a/tools/gyp/pylib/gyp/generator/msvs.py +++ b/tools/gyp/pylib/gyp/generator/msvs.py @@ -3036,7 +3036,7 @@ def _GetMSBuildLocalProperties(msbuild_toolset): [ "PropertyGroup", {"Label": "Locals"}, - ["PlatformToolset", msbuild_toolset], + ["PlatformToolset", "ClangCL"], ] ] return properties From 26e51ff43d545edc7dbd6170557abace18d1edf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sat, 4 Jul 2020 16:53:27 +0200 Subject: [PATCH 02/12] deps: add missing zlib includes TODO: upstream change to Chromium --- deps/zlib/crc_folding.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deps/zlib/crc_folding.c b/deps/zlib/crc_folding.c index 1d54ee8d48cf..df6eb6b08539 100644 --- a/deps/zlib/crc_folding.c +++ b/deps/zlib/crc_folding.c @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include #define CRC_LOAD(s) \ From 711a822f831f8c46f5935280257d3b7c8769a56a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Wed, 30 Sep 2020 17:35:36 +0200 Subject: [PATCH 03/12] hack ICU --- deps/icu-small/source/tools/toolutil/pkg_genc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deps/icu-small/source/tools/toolutil/pkg_genc.cpp b/deps/icu-small/source/tools/toolutil/pkg_genc.cpp index 741a8a5228ca..2b514a393091 100644 --- a/deps/icu-small/source/tools/toolutil/pkg_genc.cpp +++ b/deps/icu-small/source/tools/toolutil/pkg_genc.cpp @@ -846,8 +846,9 @@ getArchitecture(uint16_t *pCPU, uint16_t *pBits, UBool *pIsBigEndian, const char // for all architectures though. # if defined(_M_IX86) *pCPU = IMAGE_FILE_MACHINE_I386; +// TODO: detect ARM64 # else - *pCPU = IMAGE_FILE_MACHINE_UNKNOWN; + *pCPU = IMAGE_FILE_MACHINE_AMD64; # endif # if defined(_M_IA64) || defined(_M_AMD64) || defined (_M_ARM64) *pBits = 64; // Doesn't seem to be used for anything interesting though? From bbf0efc393be07d117148474b532514a4deb5b49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sat, 22 Oct 2022 13:21:07 +0200 Subject: [PATCH 04/12] disable some workflows --- .github/workflows/build-tarball.yml | 18 +++++++++--------- .github/workflows/coverage-linux.yml | 22 +++++++++++----------- .github/workflows/test-asan.yml | 18 +++++++++--------- .github/workflows/test-linux.yml | 12 ++++++------ .github/workflows/test-macos.yml | 18 +++++++++--------- 5 files changed, 44 insertions(+), 44 deletions(-) diff --git a/.github/workflows/build-tarball.yml b/.github/workflows/build-tarball.yml index ff0a9d725d30..f8405068130d 100644 --- a/.github/workflows/build-tarball.yml +++ b/.github/workflows/build-tarball.yml @@ -1,15 +1,15 @@ name: Build from tarball on: - pull_request: - types: [opened, synchronize, reopened, ready_for_review] - paths-ignore: - - .mailmap - - '**.md' - - AUTHORS - - doc/** - - .github/** - - '!.github/workflows/build-tarball.yml' + # pull_request: + # types: [opened, synchronize, reopened, ready_for_review] + # paths-ignore: + # - .mailmap + # - '**.md' + # - AUTHORS + # - doc/** + # - .github/** + # - '!.github/workflows/build-tarball.yml' push: branches: - main diff --git a/.github/workflows/coverage-linux.yml b/.github/workflows/coverage-linux.yml index 10705fc16a74..bfe9643fef78 100644 --- a/.github/workflows/coverage-linux.yml +++ b/.github/workflows/coverage-linux.yml @@ -1,17 +1,17 @@ name: Coverage Linux on: - pull_request: - types: [opened, synchronize, reopened, ready_for_review] - paths: - - lib/**/*.js - - Makefile - - src/**/*.cc - - src/**/*.h - - test/** - - tools/gyp/** - - tools/test.py - - .github/workflows/coverage-linux.yml + # pull_request: + # types: [opened, synchronize, reopened, ready_for_review] + # paths: + # - lib/**/*.js + # - Makefile + # - src/**/*.cc + # - src/**/*.h + # - test/** + # - tools/gyp/** + # - tools/test.py + # - .github/workflows/coverage-linux.yml push: branches: - main diff --git a/.github/workflows/test-asan.yml b/.github/workflows/test-asan.yml index 495f6679d950..2543dc89a531 100644 --- a/.github/workflows/test-asan.yml +++ b/.github/workflows/test-asan.yml @@ -1,15 +1,15 @@ name: Test ASan on: - pull_request: - types: [opened, synchronize, reopened, ready_for_review] - paths-ignore: - - .mailmap - - '**.md' - - AUTHORS - - doc/** - - .github/** - - '!.github/workflows/test-asan.yml' + # pull_request: + # types: [opened, synchronize, reopened, ready_for_review] + # paths-ignore: + # - .mailmap + # - '**.md' + # - AUTHORS + # - doc/** + # - .github/** + # - '!.github/workflows/test-asan.yml' push: branches: - main diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index cebcf5d1152a..77b63700bdb7 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -1,12 +1,12 @@ name: Test Linux on: - pull_request: - paths-ignore: - - README.md - - .github/** - - '!.github/workflows/test-linux.yml' - types: [opened, synchronize, reopened, ready_for_review] + # pull_request: + # paths-ignore: + # - README.md + # - .github/** + # - '!.github/workflows/test-linux.yml' + # types: [opened, synchronize, reopened, ready_for_review] push: branches: - main diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index ddcda36bd71a..3eb001798921 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -1,15 +1,15 @@ name: Test macOS on: - pull_request: - types: [opened, synchronize, reopened, ready_for_review] - paths-ignore: - - .mailmap - - '**.md' - - AUTHORS - - doc/** - - .github/** - - '!.github/workflows/test-macos.yml' + # pull_request: + # types: [opened, synchronize, reopened, ready_for_review] + # paths-ignore: + # - .mailmap + # - '**.md' + # - AUTHORS + # - doc/** + # - .github/** + # - '!.github/workflows/test-macos.yml' push: branches: - main From 3ccb17d834350c49bd2cba7fa64249d2b5a58059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sat, 22 Oct 2022 15:39:24 +0200 Subject: [PATCH 05/12] remove macros --- deps/v8/src/heap/cppgc/heap-base.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/v8/src/heap/cppgc/heap-base.h b/deps/v8/src/heap/cppgc/heap-base.h index 39c13127b927..9a1ef2eea44e 100644 --- a/deps/v8/src/heap/cppgc/heap-base.h +++ b/deps/v8/src/heap/cppgc/heap-base.h @@ -335,7 +335,7 @@ class V8_EXPORT_PRIVATE HeapBase : public cppgc::HeapHandle { friend class cppgc::testing::Heap; }; -class V8_NODISCARD V8_EXPORT_PRIVATE ClassNameAsHeapObjectNameScope final { +class ClassNameAsHeapObjectNameScope final { public: explicit ClassNameAsHeapObjectNameScope(HeapBase& heap); ~ClassNameAsHeapObjectNameScope(); From 273cb2b444f5ee0c83fc60e45a26e355ecc2b3c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sun, 20 Nov 2022 15:00:49 +0100 Subject: [PATCH 06/12] set clang to 1 --- common.gypi | 1 + 1 file changed, 1 insertion(+) diff --git a/common.gypi b/common.gypi index da9076c0044e..f07c30e86c89 100644 --- a/common.gypi +++ b/common.gypi @@ -91,6 +91,7 @@ 'conditions': [ ['OS == "win"', { + 'clang%': 1, 'os_posix': 0, 'v8_postmortem_support%': 0, 'obj_dir': '<(PRODUCT_DIR)/obj', From 6ec755402b9021790b59c11d90f1f0574f1fc9b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sun, 20 Nov 2022 17:43:00 +0100 Subject: [PATCH 07/12] fix pch --- node.gypi | 3 +++ tools/gyp/pylib/gyp/generator/msvs.py | 4 ++-- tools/v8_gypfiles/v8.gyp | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/node.gypi b/node.gypi index 95133818dff7..1212bd148772 100644 --- a/node.gypi +++ b/node.gypi @@ -71,6 +71,9 @@ ], 'msvs_precompiled_header': 'tools/msvs/pch/node_pch.h', 'msvs_precompiled_source': 'tools/msvs/pch/node_pch.cc', + 'include_dirs': [ + 'tools/msvs/pch', + ], 'sources': [ '<(_msvs_precompiled_header)', '<(_msvs_precompiled_source)', diff --git a/tools/gyp/pylib/gyp/generator/msvs.py b/tools/gyp/pylib/gyp/generator/msvs.py index e5b35910b0f0..7dd809fd7059 100644 --- a/tools/gyp/pylib/gyp/generator/msvs.py +++ b/tools/gyp/pylib/gyp/generator/msvs.py @@ -1232,7 +1232,7 @@ def _AddConfigurationToMSVSProject(p, spec, config_type, config_name, config): _ToolAppend(tools, "VCPostBuildEventTool", "CommandLine", postbuild) # Turn on precompiled headers if appropriate. if precompiled_header: - precompiled_header = os.path.split(precompiled_header)[1] + # precompiled_header = os.path.split(precompiled_header)[1] _ToolAppend(tools, "VCCLCompilerTool", "UsePrecompiledHeader", "2") _ToolAppend( tools, "VCCLCompilerTool", "PrecompiledHeaderThrough", precompiled_header @@ -3416,7 +3416,7 @@ def _FinalizeMSBuildSettings(spec, configuration): ) # Turn on precompiled headers if appropriate. if precompiled_header: - precompiled_header = os.path.split(precompiled_header)[1] + # precompiled_header = os.path.split(precompiled_header)[1] _ToolAppend(msbuild_settings, "ClCompile", "PrecompiledHeader", "Use") _ToolAppend( msbuild_settings, "ClCompile", "PrecompiledHeaderFile", precompiled_header diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index 1e2b3645132a..598d087343d0 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -52,6 +52,9 @@ 'direct_dependent_settings': { 'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h', 'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc', + 'include_dirs': [ + 'tools/msvs/pch', + ], 'sources': [ '<(_msvs_precompiled_header)', '<(_msvs_precompiled_source)', From 1f149caef27a5f6c0d2301a04b82fba42c04ca25 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Fri, 15 Dec 2023 06:00:08 -0500 Subject: [PATCH 08/12] fix build on clangcl, except for v8 assembly (#9) 1. To avoid many warnings, this PR declares the C and C++ standards separately. 2. This PR extends gyp so that we can build with AVX-512. Nevertheless, getting runtime dispatching with ClangCl through Visual Studio is challenging, so we disable it. It only affects one component of zip, so the effect on runtime performance should be negligible. Note that other dependencies such as simdutf do not need to this build support for runtime dispatching (so you still get AVX2, AVX-512 support in these dependencies). --- common.gypi | 7 +++++-- deps/zlib/zlib.gyp | 6 ++---- tools/gyp/pylib/gyp/MSVSSettings.py | 3 +++ tools/gyp/pylib/gyp/msvs_emulation.py | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/common.gypi b/common.gypi index f07c30e86c89..5c2bee95eada 100644 --- a/common.gypi +++ b/common.gypi @@ -285,10 +285,13 @@ ], 'msvs_settings': { 'VCCLCompilerTool': { + # Node has C and C++ dependencies: we want to specify the standards + # independently. Recent versions of Visual Studio support C11 and C17 + # https://learn.microsoft.com/en-us/cpp/overview/install-c17-support?view=msvc-170 + 'LanguageStandard': 'stdcpp20', + 'LanguageStandard_C': 'stdc11', 'AdditionalOptions': [ '/Zc:__cplusplus', - # The following option enables c++20 on Windows. This is needed for V8 v12.4+ - '-std:c++20', # The following option reduces the "error C1060: compiler is out of heap space" '/Zm2000', ], diff --git a/deps/zlib/zlib.gyp b/deps/zlib/zlib.gyp index 26ceed9fbe68..87acce3b4cd2 100644 --- a/deps/zlib/zlib.gyp +++ b/deps/zlib/zlib.gyp @@ -17,12 +17,11 @@ 'type': 'static_library', 'conditions': [ ['target_arch in "ia32 x64" and OS!="ios"', { - 'defines': [ 'ADLER32_SIMD_SSSE3' ], 'conditions': [ ['OS=="win"', { 'defines': [ 'X86_WINDOWS' ], },{ - 'defines': [ 'X86_NOT_WINDOWS' ], + 'defines': [ 'X86_NOT_WINDOWS', 'ADLER32_SIMD_SSSE3' ], }], ['OS!="win" or llvm_version!="0.0"', { 'cflags': [ '-mssse3' ], @@ -40,12 +39,11 @@ 'direct_dependent_settings': { 'conditions': [ ['target_arch in "ia32 x64" and OS!="ios"', { - 'defines': [ 'ADLER32_SIMD_SSSE3' ], 'conditions': [ ['OS=="win"', { 'defines': [ 'X86_WINDOWS' ], },{ - 'defines': [ 'X86_NOT_WINDOWS' ], + 'defines': [ 'X86_NOT_WINDOWS', 'ADLER32_SIMD_SSSE3' ], }], ], }], diff --git a/tools/gyp/pylib/gyp/MSVSSettings.py b/tools/gyp/pylib/gyp/MSVSSettings.py index 93633dbca133..96ac70cd1a39 100644 --- a/tools/gyp/pylib/gyp/MSVSSettings.py +++ b/tools/gyp/pylib/gyp/MSVSSettings.py @@ -579,6 +579,8 @@ def _ValidateSettings(validators, settings, stderr): # Options that have the same name in MSVS and MSBuild _Same(_compile, "AdditionalIncludeDirectories", _folder_list) # /I _Same(_compile, "AdditionalOptions", _string_list) +_Same(_compile, "LanguageStandard", _string) +_Same(_compile, "LanguageStandard_C", _string) _Same(_compile, "AdditionalUsingDirectories", _folder_list) # /AI _Same(_compile, "AssemblerListingLocation", _file_name) # /Fa _Same(_compile, "BrowseInformationFile", _file_name) @@ -675,6 +677,7 @@ def _ValidateSettings(validators, settings, stderr): "NoExtensions", # /arch:IA32 (vs2012+) # This one only exists in the new msbuild format. "AdvancedVectorExtensions2", # /arch:AVX2 (vs2013r2+) + "AdvancedVectorExtensions512", # (vs2019+) ] ), ) diff --git a/tools/gyp/pylib/gyp/msvs_emulation.py b/tools/gyp/pylib/gyp/msvs_emulation.py index 38fa21dd6666..a9339052fed3 100644 --- a/tools/gyp/pylib/gyp/msvs_emulation.py +++ b/tools/gyp/pylib/gyp/msvs_emulation.py @@ -531,7 +531,7 @@ def GetCflags(self, config): cl("AdditionalOptions", prefix="") cl( "EnableEnhancedInstructionSet", - map={"1": "SSE", "2": "SSE2", "3": "AVX", "4": "IA32", "5": "AVX2"}, + map={"1": "SSE", "2": "SSE2", "3": "AVX", "4": "IA32", "5": "AVX2", "6": "AVX512"}, prefix="/arch:", ) cflags.extend( From d4fe780b5f09666d262c36472b32e2d5275e4607 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Wed, 3 Jan 2024 10:31:11 -0500 Subject: [PATCH 09/12] fix: embed snapshot asm into a source file like v8 does --- tools/v8_gypfiles/v8.gyp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index 598d087343d0..bf1bb2dc7363 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -450,7 +450,6 @@ '<(INTERMEDIATE_DIR)/snapshot.cc', '<(INTERMEDIATE_DIR)/embedded.S', ], - 'process_outputs_as_sources': 1, 'conditions': [ ['v8_random_seed', { 'variables': { @@ -490,6 +489,24 @@ '>@(mksnapshot_flags)', ], }, + { + 'action_name': 'asm_to_inline_asm', + 'message': 'generating: >@(_outputs)', + 'inputs': [ + '<(INTERMEDIATE_DIR)/embedded.S', + ], + 'outputs': [ + '<(INTERMEDIATE_DIR)/snapshot.cc', + '<(INTERMEDIATE_DIR)/embedded.cc', + ], + 'process_outputs_as_sources': 1, + 'action': [ + '<(python)', + '<(V8_ROOT)/tools/snapshot/asm_to_inline_asm.py', + '<@(_inputs)', + '<(INTERMEDIATE_DIR)/embedded.cc', + ], + }, ], }, # v8_snapshot { From 9d7c1367c287b7f8010d64b6966378535164c349 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Wed, 3 Jan 2024 11:48:14 -0500 Subject: [PATCH 10/12] fix: lib paths and remove unneeded masm --- node.gyp | 4 ++-- node.gypi | 6 +++--- tools/v8_gypfiles/v8.gyp | 19 ------------------- 3 files changed, 5 insertions(+), 24 deletions(-) diff --git a/node.gyp b/node.gyp index dc4d77330a81..b2a3bdf338cc 100644 --- a/node.gyp +++ b/node.gyp @@ -608,8 +608,8 @@ 'msvs_settings': { 'VCLinkerTool': { 'AdditionalOptions': [ - '/WHOLEARCHIVE:<(node_lib_target_name)<(STATIC_LIB_SUFFIX)', - '/WHOLEARCHIVE:<(STATIC_LIB_PREFIX)v8_base_without_compiler<(STATIC_LIB_SUFFIX)', + '/WHOLEARCHIVE:<(PRODUCT_DIR)/lib/<(node_lib_target_name)<(STATIC_LIB_SUFFIX)', + '/WHOLEARCHIVE:<(PRODUCT_DIR)/lib/<(STATIC_LIB_PREFIX)v8_base_without_compiler<(STATIC_LIB_SUFFIX)', ], }, }, diff --git a/node.gypi b/node.gypi index 1212bd148772..629107ed39f9 100644 --- a/node.gypi +++ b/node.gypi @@ -155,7 +155,7 @@ 'msvs_settings': { 'VCLinkerTool': { 'AdditionalOptions': [ - '/WHOLEARCHIVE:zlib<(STATIC_LIB_SUFFIX)', + '/WHOLEARCHIVE:<(PRODUCT_DIR)/lib/zlib<(STATIC_LIB_SUFFIX)', ], }, }, @@ -194,7 +194,7 @@ 'msvs_settings': { 'VCLinkerTool': { 'AdditionalOptions': [ - '/WHOLEARCHIVE:libuv<(STATIC_LIB_SUFFIX)', + '/WHOLEARCHIVE:<(PRODUCT_DIR)/lib/libuv<(STATIC_LIB_SUFFIX)', ], }, }, @@ -373,7 +373,7 @@ 'msvs_settings': { 'VCLinkerTool': { 'AdditionalOptions': [ - '/WHOLEARCHIVE:<(openssl_product)', + '/WHOLEARCHIVE:<(PRODUCT_DIR)/lib/<(openssl_product)', ], }, }, diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index bf1bb2dc7363..0d8ff4c543c4 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -1948,25 +1948,6 @@ }], ] }], - ['OS=="win"', { - 'conditions': [ - ['_toolset == "host" and host_arch == "x64" or _toolset == "target" and target_arch=="x64"', { - 'sources': [ - '<(V8_ROOT)/src/heap/base/asm/x64/push_registers_masm.asm', - ], - }], - ['_toolset == "host" and host_arch == "ia32" or _toolset == "target" and target_arch=="ia32"', { - 'sources': [ - '<(V8_ROOT)/src/heap/base/asm/ia32/push_registers_masm.asm', - ], - }], - ['_toolset == "host" and host_arch == "arm64" or _toolset == "target" and target_arch=="arm64"', { - 'sources': [ - '<(V8_ROOT)/src/heap/base/asm/arm64/push_registers_masm.S', - ], - }], - ], - }], ], }, }, # v8_heap_base From 1a5726a32fa090de8f3b2e5f7daf6c7c108f003f Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Fri, 5 Jan 2024 00:21:00 -0500 Subject: [PATCH 11/12] fix: only build embedded.cc when under Windows. (#11) --- tools/v8_gypfiles/v8.gyp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index 0d8ff4c543c4..977e9fd76f0e 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -447,10 +447,14 @@ '<(mksnapshot_exec)', ], 'outputs': [ - '<(INTERMEDIATE_DIR)/snapshot.cc', + # snapshot.cc is always built in the 'asm_to_inline_asm' step. '<(INTERMEDIATE_DIR)/embedded.S', ], 'conditions': [ + # When not under Windows, embedded.S will be compiled directly. + ['OS != "win"', { + 'process_outputs_as_sources': 1, + }], ['v8_random_seed', { 'variables': { 'mksnapshot_flags': ['--random-seed', '<(v8_random_seed)'], @@ -490,14 +494,27 @@ ], }, { + # This action is only useful on Windows. + # Under non-Windows systems, we effectively ignore + # the output of this action. 'action_name': 'asm_to_inline_asm', 'message': 'generating: >@(_outputs)', 'inputs': [ '<(INTERMEDIATE_DIR)/embedded.S', ], - 'outputs': [ + 'conditions': [ + # Under Windows, we need to generate snapshot.cc and embedded.cc. + ['OS == "win"', { + 'outputs': [ '<(INTERMEDIATE_DIR)/snapshot.cc', '<(INTERMEDIATE_DIR)/embedded.cc', + ], + }], + # Under non-Windows systems, we effectively ignore the output of this + # action. We do need to build snapshot.cc, however. + ['OS != "win"', { + 'outputs': ['<(INTERMEDIATE_DIR)/snapshot.cc'] + }], ], 'process_outputs_as_sources': 1, 'action': [ From d5302f5af3ea44c24035d0245f800f3f18e6402c Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Fri, 5 Jan 2024 10:28:40 -0500 Subject: [PATCH 12/12] fix: only generate embedded.cc under Windows. (#12) --- tools/v8_gypfiles/v8.gyp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index 977e9fd76f0e..c9579d7cc3f8 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -509,20 +509,22 @@ '<(INTERMEDIATE_DIR)/snapshot.cc', '<(INTERMEDIATE_DIR)/embedded.cc', ], + 'action': [ + '<(python)', + '<(V8_ROOT)/tools/snapshot/asm_to_inline_asm.py', + '<@(_inputs)', + '<(INTERMEDIATE_DIR)/embedded.cc', # important: embedded.cc is only ever generated if OS == "win" + ], }], # Under non-Windows systems, we effectively ignore the output of this # action. We do need to build snapshot.cc, however. ['OS != "win"', { - 'outputs': ['<(INTERMEDIATE_DIR)/snapshot.cc'] + 'outputs': ['<(INTERMEDIATE_DIR)/snapshot.cc'], + 'action': [], }], ], 'process_outputs_as_sources': 1, - 'action': [ - '<(python)', - '<(V8_ROOT)/tools/snapshot/asm_to_inline_asm.py', - '<@(_inputs)', - '<(INTERMEDIATE_DIR)/embedded.cc', - ], + }, ], }, # v8_snapshot