diff --git a/.github/workflows/build-tarball.yml b/.github/workflows/build-tarball.yml index ff0a9d725d304a..f8405068130d4e 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 10705fc16a749c..bfe9643fef7817 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 495f6679d950d5..2543dc89a53141 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 cebcf5d1152a5b..77b63700bdb7e9 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 ddcda36bd71aa6..3eb00179892103 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 diff --git a/common.gypi b/common.gypi index da9076c0044e21..5c2bee95eada12 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', @@ -284,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/icu-small/source/tools/toolutil/pkg_genc.cpp b/deps/icu-small/source/tools/toolutil/pkg_genc.cpp index 741a8a5228ca68..2b514a39309129 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? diff --git a/deps/v8/src/heap/cppgc/heap-base.h b/deps/v8/src/heap/cppgc/heap-base.h index 39c13127b92735..9a1ef2eea44e44 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(); diff --git a/deps/zlib/crc_folding.c b/deps/zlib/crc_folding.c index 1d54ee8d48cff6..df6eb6b085398d 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) \ diff --git a/deps/zlib/zlib.gyp b/deps/zlib/zlib.gyp index 26ceed9fbe6825..87acce3b4cd244 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/node.gyp b/node.gyp index dc4d77330a811d..b2a3bdf338cc87 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 95133818dff7c7..629107ed39f90e 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)', @@ -152,7 +155,7 @@ 'msvs_settings': { 'VCLinkerTool': { 'AdditionalOptions': [ - '/WHOLEARCHIVE:zlib<(STATIC_LIB_SUFFIX)', + '/WHOLEARCHIVE:<(PRODUCT_DIR)/lib/zlib<(STATIC_LIB_SUFFIX)', ], }, }, @@ -191,7 +194,7 @@ 'msvs_settings': { 'VCLinkerTool': { 'AdditionalOptions': [ - '/WHOLEARCHIVE:libuv<(STATIC_LIB_SUFFIX)', + '/WHOLEARCHIVE:<(PRODUCT_DIR)/lib/libuv<(STATIC_LIB_SUFFIX)', ], }, }, @@ -370,7 +373,7 @@ 'msvs_settings': { 'VCLinkerTool': { 'AdditionalOptions': [ - '/WHOLEARCHIVE:<(openssl_product)', + '/WHOLEARCHIVE:<(PRODUCT_DIR)/lib/<(openssl_product)', ], }, }, diff --git a/tools/gyp/pylib/gyp/MSVSSettings.py b/tools/gyp/pylib/gyp/MSVSSettings.py index 93633dbca133c7..96ac70cd1a39ec 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/generator/msvs.py b/tools/gyp/pylib/gyp/generator/msvs.py index 13b0794b4dccc3..7dd809fd70599a 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 @@ -3036,7 +3036,7 @@ def _GetMSBuildLocalProperties(msbuild_toolset): [ "PropertyGroup", {"Label": "Locals"}, - ["PlatformToolset", msbuild_toolset], + ["PlatformToolset", "ClangCL"], ] ] return properties @@ -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/gyp/pylib/gyp/msvs_emulation.py b/tools/gyp/pylib/gyp/msvs_emulation.py index 38fa21dd666697..a9339052fed309 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( diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index 1e2b3645132aab..c9579d7cc3f84c 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)', @@ -444,11 +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', ], - 'process_outputs_as_sources': 1, '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)'], @@ -487,6 +493,39 @@ '>@(mksnapshot_flags)', ], }, + { + # 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', + ], + 'conditions': [ + # Under Windows, we need to generate snapshot.cc and embedded.cc. + ['OS == "win"', { + 'outputs': [ + '<(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'], + 'action': [], + }], + ], + 'process_outputs_as_sources': 1, + + }, ], }, # v8_snapshot { @@ -1928,25 +1967,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