diff --git a/common.gypi b/common.gypi index da68130484dcf3..079ebb1f0a91b9 100644 --- a/common.gypi +++ b/common.gypi @@ -19,7 +19,6 @@ 'node_use_bundled_v8%': 'true', 'node_module_version%': '', 'node_with_ltcg%': '', - 'node_use_pch%': 'false', 'node_shared_openssl%': 'false', 'node_tag%': '', @@ -38,7 +37,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.11', + 'v8_embedder_string': '-node.13', ##### V8 defaults for Node.js ##### @@ -137,13 +136,17 @@ 'Debug': { 'variables': { 'v8_enable_handle_zapping': 1, + 'conditions': [ + ['node_shared != "true"', { + 'MSVC_runtimeType': 1, # MultiThreadedDebug (/MTd) + }, { + 'MSVC_runtimeType': 3, # MultiThreadedDebugDLL (/MDd) + }], + ], }, 'defines': [ 'DEBUG', '_DEBUG', 'V8_ENABLE_CHECKS' ], 'cflags': [ '-g', '-O0' ], 'conditions': [ - ['target_arch=="x64"', { - 'msvs_configuration_platform': 'x64', - }], ['OS=="aix"', { 'cflags': [ '-gxcoff' ], 'ldflags': [ '-Wl,-bbigtoc' ], @@ -152,31 +155,14 @@ 'cflags': [ '-fPIE' ], 'ldflags': [ '-fPIE', '-pie' ] }], - ['node_shared=="true"', { - 'msvs_settings': { - 'VCCLCompilerTool': { - 'RuntimeLibrary': 3, # MultiThreadedDebugDLL (/MDd) - } - } - }], - ['node_shared=="false"', { - 'msvs_settings': { - 'VCCLCompilerTool': { - 'RuntimeLibrary': 1 # MultiThreadedDebug (/MTd) - } - } - }] ], 'msvs_settings': { 'VCCLCompilerTool': { - 'Optimization': 0, # /Od, no optimization + 'BasicRuntimeChecks': 3, # /RTC1 'MinimalRebuild': 'false', 'OmitFramePointers': 'false', - 'BasicRuntimeChecks': 3, # /RTC1 - 'MultiProcessorCompilation': 'true', - 'AdditionalOptions': [ - '/bigobj', # prevent error C1128 in VS2015 - ], + 'Optimization': 0, # /Od, no optimization + 'RuntimeLibrary': '<(MSVC_runtimeType)', }, 'VCLinkerTool': { 'LinkIncremental': 2, # enable incremental linking @@ -189,12 +175,19 @@ 'Release': { 'variables': { 'v8_enable_handle_zapping': 0, + 'pgo_generate': ' -fprofile-generate ', + 'pgo_use': ' -fprofile-use -fprofile-correction ', + 'lto': ' -flto=4 -fuse-linker-plugin -ffat-lto-objects ', + 'conditions': [ + ['node_shared != "true"', { + 'MSVC_runtimeType': 0 # MultiThreaded (/MT) + }, { + 'MSVC_runtimeType': 2 # MultiThreadedDLL (/MD) + }], + ], }, 'cflags': [ '-O3' ], 'conditions': [ - ['target_arch=="x64"', { - 'msvs_configuration_platform': 'x64', - }], ['OS=="solaris"', { # pull in V8's postmortem metadata 'ldflags': [ '-Wl,-z,allextract' ] @@ -203,11 +196,6 @@ 'cflags': [ '-fno-omit-frame-pointer' ], }], ['OS=="linux"', { - 'variables': { - 'pgo_generate': ' -fprofile-generate ', - 'pgo_use': ' -fprofile-use -fprofile-correction ', - 'lto': ' -flto=4 -fuse-linker-plugin -ffat-lto-objects ', - }, 'conditions': [ ['enable_pgo_generate=="true"', { 'cflags': ['<(pgo_generate)'], @@ -227,62 +215,17 @@ 'cflags': [ '-fPIE' ], 'ldflags': [ '-fPIE', '-pie' ] }], - ['node_shared=="true"', { - 'msvs_settings': { - 'VCCLCompilerTool': { - 'RuntimeLibrary': 2 # MultiThreadedDLL (/MD) - } - } - }], - ['node_shared=="false"', { - 'msvs_settings': { - 'VCCLCompilerTool': { - 'RuntimeLibrary': 0 # MultiThreaded (/MT) - } - } - }], - ['node_with_ltcg=="true"', { - 'msvs_settings': { - 'VCCLCompilerTool': { - 'WholeProgramOptimization': 'true' # /GL, whole program optimization, needed for LTCG - }, - 'VCLibrarianTool': { - 'AdditionalOptions': [ - '/LTCG:INCREMENTAL', # link time code generation - ] - }, - 'VCLinkerTool': { - 'OptimizeReferences': 2, # /OPT:REF - 'EnableCOMDATFolding': 2, # /OPT:ICF - 'LinkIncremental': 1, # disable incremental linking - 'AdditionalOptions': [ - '/LTCG:INCREMENTAL', # incremental link-time code generation - ] - } - } - }, { - 'msvs_settings': { - 'VCCLCompilerTool': { - 'WholeProgramOptimization': 'false' - }, - 'VCLinkerTool': { - 'LinkIncremental': 2 # enable incremental linking - } - } - }] ], 'msvs_settings': { 'VCCLCompilerTool': { - 'Optimization': 3, # /Ox, full optimization - 'FavorSizeOrSpeed': 1, # /Ot, favor speed over size - 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible - 'OmitFramePointers': 'true', 'EnableFunctionLevelLinking': 'true', 'EnableIntrinsicFunctions': 'true', + 'FavorSizeOrSpeed': 1, # /Ot, favor speed over size + 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible + 'OmitFramePointers': 'true', + 'Optimization': 3, # /Ox, full optimization + 'RuntimeLibrary': '<(MSVC_runtimeType)', 'RuntimeTypeInfo': 'false', - 'MultiProcessorCompilation': 'true', - 'AdditionalOptions': [ - ], } } } @@ -301,13 +244,14 @@ 'cflags!': ['-Werror'], 'msvs_settings': { 'VCCLCompilerTool': { - 'StringPooling': 'true', # pool string literals - 'DebugInformationFormat': 1, # /Z7 embed info in .obj files - 'WarningLevel': 3, 'BufferSecurityCheck': 'true', + 'DebugInformationFormat': 1, # /Z7 embed info in .obj files 'ExceptionHandling': 0, # /EHsc + 'MultiProcessorCompilation': 'true', + 'StringPooling': 'true', # pool string literals 'SuppressStartupBanner': 'true', 'WarnAsError': 'false', + 'WarningLevel': 3, # /W3 }, 'VCLinkerTool': { 'conditions': [ @@ -329,11 +273,6 @@ }], ], 'GenerateDebugInformation': 'true', - 'GenerateMapFile': 'true', # /MAP - 'MapExports': 'true', # /MAPINFO:EXPORTS - 'RandomizedBaseAddress': 2, # enable ASLR - 'DataExecutionPrevention': 2, # enable DEP - 'AllowIsolation': 'true', 'SuppressStartupBanner': 'true', }, }, @@ -351,7 +290,12 @@ # - "C4244: conversion from 'type1' to 'type2', possible loss of data" # Ususaly safe. Disable for `dep`, enable for `src` 'msvs_disabled_warnings': [4351, 4355, 4800, 4251, 4275, 4244, 4267], + 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin + 'conditions': [ + [ 'target_arch=="x64"', { + 'msvs_configuration_platform': 'x64', + }], ['asan == 1 and OS != "mac"', { 'cflags+': [ '-fno-omit-frame-pointer', @@ -380,7 +324,6 @@ ], }], ['OS == "win"', { - 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin 'defines': [ 'WIN32', # we don't really want VC++ warning us about diff --git a/configure.py b/configure.py index 5a7cade60cb657..74fffa9b2e9918 100755 --- a/configure.py +++ b/configure.py @@ -448,11 +448,6 @@ dest='with_ltcg', help='Use Link Time Code Generation. This feature is only available on Windows.') -parser.add_option('--with-pch', - action='store_true', - dest='with_pch', - help='Use Precompiled Headers (only available on Windows).') - intl_optgroup.add_option('--download', action='store', dest='download_list', @@ -1070,11 +1065,6 @@ def configure_node(o): if flavor != 'win' and options.with_ltcg: raise Exception('Link Time Code Generation is only supported on Windows.') - if flavor == 'win': - o['variables']['node_use_pch'] = b(options.with_pch) - else: - o['variables']['node_use_pch'] = 'false' - if options.tag: o['variables']['node_tag'] = '-' + options.tag else: diff --git a/deps/v8/gypfiles/v8.gyp b/deps/v8/gypfiles/v8.gyp index dd0f6799d5ae90..857ff0ecece3a8 100644 --- a/deps/v8/gypfiles/v8.gyp +++ b/deps/v8/gypfiles/v8.gyp @@ -222,7 +222,7 @@ 'dependencies': [ 'v8_base', ], - 'variables': { + 'variables': { 'optimize': 'max', }, 'include_dirs': [ @@ -359,16 +359,20 @@ }], # Platforms that don't have Compare-And-Swap support need to link atomic # library to implement atomic memory access - [ 'v8_current_cpu == "mips" or v8_current_cpu == "mipsel" or ' - 'v8_current_cpu == "mips64" or v8_current_cpu == "mips64el" or ' - 'v8_current_cpu == "ppc" or v8_current_cpu == "ppc64" or ' - 'v8_current_cpu == "s390" or v8_current_cpu == "s390x"', - { + [ 'v8_current_cpu in ["mips", "mipsel", "mips64", "mips64el", "ppc", "ppc64", "s390", "s390x"]', { 'link_settings': { 'libraries': [ '-latomic', ], }, }, ], + ['OS=="win"', { + 'msvs_precompiled_header': '../../../tools/msvs/pch/v8_pch.h', + 'msvs_precompiled_source': '../../../tools/msvs/pch/v8_pch.cc', + 'sources': [ + '<(_msvs_precompiled_header)', + '<(_msvs_precompiled_source)', + ], + }], ], }, # v8_initializers { @@ -1931,23 +1935,12 @@ ], }], ['OS=="win"', { - 'variables': { - 'gyp_generators': ' +#include +#include +#include diff --git a/tools/msvs/pch/pch_v8_base.cc b/tools/msvs/pch/pch_v8_base.cc deleted file mode 100644 index 828977c03692d6..00000000000000 --- a/tools/msvs/pch/pch_v8_base.cc +++ /dev/null @@ -1 +0,0 @@ -#include "tools/msvs/pch/pch_v8_base.h" diff --git a/tools/msvs/pch/pch_v8_base.h b/tools/msvs/pch/pch_v8_base.h deleted file mode 100644 index ebac7914823ac5..00000000000000 --- a/tools/msvs/pch/pch_v8_base.h +++ /dev/null @@ -1 +0,0 @@ -#include "src/objects-inl.h" diff --git a/tools/msvs/pch/v8_pch.cc b/tools/msvs/pch/v8_pch.cc new file mode 100644 index 00000000000000..03a5d999d36d9d --- /dev/null +++ b/tools/msvs/pch/v8_pch.cc @@ -0,0 +1 @@ +#include "v8_pch.h" diff --git a/tools/msvs/pch/v8_pch.h b/tools/msvs/pch/v8_pch.h new file mode 100644 index 00000000000000..2c543beac2111b --- /dev/null +++ b/tools/msvs/pch/v8_pch.h @@ -0,0 +1,3 @@ +#include "src/api-inl.h" +#include "src/objects-inl.h" +#include "src/utils.h" diff --git a/vcbuild.bat b/vcbuild.bat index aa96555e88d28a..9877fb110b3195 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -16,7 +16,6 @@ set config=Release set target=Build set target_arch=x64 set ltcg= -set pch=1 set target_env= set noprojgen= set projgen= @@ -63,7 +62,7 @@ set doc= :next-arg if "%1"=="" goto args-done if /i "%1"=="debug" set config=Debug&goto arg-ok -if /i "%1"=="release" set config=Release&set ltcg=1&set "pch="&set cctest=1&goto arg-ok +if /i "%1"=="release" set config=Release&set ltcg=1&set cctest=1&goto arg-ok if /i "%1"=="clean" set target=Clean&goto arg-ok if /i "%1"=="ia32" set target_arch=x86&goto arg-ok if /i "%1"=="x86" set target_arch=x86&goto arg-ok @@ -77,7 +76,6 @@ if /i "%1"=="sign" set sign=1&goto arg-ok if /i "%1"=="nosnapshot" set nosnapshot=1&goto arg-ok if /i "%1"=="noetw" set noetw=1&goto arg-ok if /i "%1"=="ltcg" set ltcg=1&goto arg-ok -if /i "%1"=="nopch" set "pch="&goto arg-ok if /i "%1"=="licensertf" set licensertf=1&goto arg-ok if /i "%1"=="test" set test_args=%test_args% -J %common_test_suites%&set lint_cpp=1&set lint_js=1&set lint_md=1&goto arg-ok if /i "%1"=="test-ci" set test_args=%test_args% %test_ci_args% -p tap --logfile test.tap %common_test_suites%&set cctest_args=%cctest_args% --gtest_output=tap:cctest.tap&goto arg-ok @@ -158,7 +156,6 @@ if defined build_release ( set projgen=1 set cctest=1 set ltcg=1 - set "pch=" ) if defined msi set stage_package=1 @@ -174,7 +171,6 @@ if "%config%"=="Debug" set configure_flags=%configure_flags% --debug if defined nosnapshot set configure_flags=%configure_flags% --without-snapshot if defined noetw set configure_flags=%configure_flags% --without-etw& set noetw_msi_arg=/p:NoETW=1 if defined ltcg set configure_flags=%configure_flags% --with-ltcg -if defined pch set configure_flags=%configure_flags% --with-pch if defined release_urlbase set configure_flags=%configure_flags% --release-urlbase=%release_urlbase% if defined download_arg set configure_flags=%configure_flags% %download_arg% if defined enable_vtune_arg set configure_flags=%configure_flags% --enable-vtune-profiling @@ -313,7 +309,7 @@ if "%target%"=="Build" ( if defined cctest set target="Build" ) if "%target%"=="rename_node_bin_win" if exist "%config%\cctest.exe" del "%config%\cctest.exe" -msbuild node.sln %msbcpu% /t:%target% /p:Configuration=%config% /p:Platform=%msbplatform% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo +msbuild node.sln %msbcpu% /t:%target% /p:Configuration=%config% /p:Platform=%msbplatform% /clp:NoItemAndPropertyList;Verbosity=minimal /nologo if errorlevel 1 ( if not defined project_generated echo Building Node with reused solution failed. To regenerate project files use "vcbuild projgen" goto exit @@ -670,7 +666,7 @@ del .used_configure_flags goto exit :help -echo vcbuild.bat [debug/release] [msi] [doc] [test/test-ci/test-all/test-addons/test-js-native-api/test-node-api/test-benchmark/test-internet/test-pummel/test-simple/test-message/test-tick-processor/test-known-issues/test-node-inspect/test-check-deopts/test-npm/test-async-hooks/test-v8/test-v8-intl/test-v8-benchmarks/test-v8-all] [ignore-flaky] [static/dll] [noprojgen] [projgen] [small-icu/full-icu/without-intl] [nobuild] [nosnapshot] [noetw] [ltcg] [nopch] [licensetf] [sign] [ia32/x86/x64] [vs2017] [download-all] [enable-vtune] [lint/lint-ci/lint-js/lint-js-ci/lint-md] [lint-md-build] [package] [build-release] [upload] [no-NODE-OPTIONS] [link-module path-to-module] [debug-http2] [debug-nghttp2] [clean] [cctest] [no-cctest] [openssl-no-asm] +echo vcbuild.bat [debug/release] [msi] [doc] [test/test-ci/test-all/test-addons/test-js-native-api/test-node-api/test-benchmark/test-internet/test-pummel/test-simple/test-message/test-tick-processor/test-known-issues/test-node-inspect/test-check-deopts/test-npm/test-async-hooks/test-v8/test-v8-intl/test-v8-benchmarks/test-v8-all] [ignore-flaky] [static/dll] [noprojgen] [projgen] [small-icu/full-icu/without-intl] [nobuild] [nosnapshot] [noetw] [ltcg] [licensetf] [sign] [ia32/x86/x64] [vs2017] [download-all] [enable-vtune] [lint/lint-ci/lint-js/lint-js-ci/lint-md] [lint-md-build] [package] [build-release] [upload] [no-NODE-OPTIONS] [link-module path-to-module] [debug-http2] [debug-nghttp2] [clean] [cctest] [no-cctest] [openssl-no-asm] echo Examples: echo vcbuild.bat : builds release build echo vcbuild.bat debug : builds debug build