build: move optimizing link directives to node.exe target
* ASCIIbetize directives * Merge duplicate directives from 'conditions' PR-URL: https://github.com/nodejs/node/pull/25931 Reviewed-By: João Reis <reis@janeasystems.com>
This commit is contained in:
parent
582c0d5a09
commit
20a917c571
124
common.gypi
124
common.gypi
@ -137,13 +137,17 @@
|
|||||||
'Debug': {
|
'Debug': {
|
||||||
'variables': {
|
'variables': {
|
||||||
'v8_enable_handle_zapping': 1,
|
'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' ],
|
'defines': [ 'DEBUG', '_DEBUG', 'V8_ENABLE_CHECKS' ],
|
||||||
'cflags': [ '-g', '-O0' ],
|
'cflags': [ '-g', '-O0' ],
|
||||||
'conditions': [
|
'conditions': [
|
||||||
['target_arch=="x64"', {
|
|
||||||
'msvs_configuration_platform': 'x64',
|
|
||||||
}],
|
|
||||||
['OS=="aix"', {
|
['OS=="aix"', {
|
||||||
'cflags': [ '-gxcoff' ],
|
'cflags': [ '-gxcoff' ],
|
||||||
'ldflags': [ '-Wl,-bbigtoc' ],
|
'ldflags': [ '-Wl,-bbigtoc' ],
|
||||||
@ -152,31 +156,14 @@
|
|||||||
'cflags': [ '-fPIE' ],
|
'cflags': [ '-fPIE' ],
|
||||||
'ldflags': [ '-fPIE', '-pie' ]
|
'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': {
|
'msvs_settings': {
|
||||||
'VCCLCompilerTool': {
|
'VCCLCompilerTool': {
|
||||||
'Optimization': 0, # /Od, no optimization
|
'BasicRuntimeChecks': 3, # /RTC1
|
||||||
'MinimalRebuild': 'false',
|
'MinimalRebuild': 'false',
|
||||||
'OmitFramePointers': 'false',
|
'OmitFramePointers': 'false',
|
||||||
'BasicRuntimeChecks': 3, # /RTC1
|
'Optimization': 0, # /Od, no optimization
|
||||||
'MultiProcessorCompilation': 'true',
|
'RuntimeLibrary': '<(MSVC_runtimeType)',
|
||||||
'AdditionalOptions': [
|
|
||||||
'/bigobj', # prevent error C1128 in VS2015
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
'VCLinkerTool': {
|
'VCLinkerTool': {
|
||||||
'LinkIncremental': 2, # enable incremental linking
|
'LinkIncremental': 2, # enable incremental linking
|
||||||
@ -189,12 +176,19 @@
|
|||||||
'Release': {
|
'Release': {
|
||||||
'variables': {
|
'variables': {
|
||||||
'v8_enable_handle_zapping': 0,
|
'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' ],
|
'cflags': [ '-O3' ],
|
||||||
'conditions': [
|
'conditions': [
|
||||||
['target_arch=="x64"', {
|
|
||||||
'msvs_configuration_platform': 'x64',
|
|
||||||
}],
|
|
||||||
['OS=="solaris"', {
|
['OS=="solaris"', {
|
||||||
# pull in V8's postmortem metadata
|
# pull in V8's postmortem metadata
|
||||||
'ldflags': [ '-Wl,-z,allextract' ]
|
'ldflags': [ '-Wl,-z,allextract' ]
|
||||||
@ -203,11 +197,6 @@
|
|||||||
'cflags': [ '-fno-omit-frame-pointer' ],
|
'cflags': [ '-fno-omit-frame-pointer' ],
|
||||||
}],
|
}],
|
||||||
['OS=="linux"', {
|
['OS=="linux"', {
|
||||||
'variables': {
|
|
||||||
'pgo_generate': ' -fprofile-generate ',
|
|
||||||
'pgo_use': ' -fprofile-use -fprofile-correction ',
|
|
||||||
'lto': ' -flto=4 -fuse-linker-plugin -ffat-lto-objects ',
|
|
||||||
},
|
|
||||||
'conditions': [
|
'conditions': [
|
||||||
['enable_pgo_generate=="true"', {
|
['enable_pgo_generate=="true"', {
|
||||||
'cflags': ['<(pgo_generate)'],
|
'cflags': ['<(pgo_generate)'],
|
||||||
@ -227,62 +216,17 @@
|
|||||||
'cflags': [ '-fPIE' ],
|
'cflags': [ '-fPIE' ],
|
||||||
'ldflags': [ '-fPIE', '-pie' ]
|
'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': {
|
'msvs_settings': {
|
||||||
'VCCLCompilerTool': {
|
'VCCLCompilerTool': {
|
||||||
'Optimization': 3, # /Ox, full optimization
|
|
||||||
'FavorSizeOrSpeed': 1, # /Ot, favor speed over size
|
|
||||||
'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
|
|
||||||
'OmitFramePointers': 'true',
|
|
||||||
'EnableFunctionLevelLinking': 'true',
|
'EnableFunctionLevelLinking': 'true',
|
||||||
'EnableIntrinsicFunctions': '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',
|
'RuntimeTypeInfo': 'false',
|
||||||
'MultiProcessorCompilation': 'true',
|
|
||||||
'AdditionalOptions': [
|
|
||||||
],
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -301,13 +245,14 @@
|
|||||||
'cflags!': ['-Werror'],
|
'cflags!': ['-Werror'],
|
||||||
'msvs_settings': {
|
'msvs_settings': {
|
||||||
'VCCLCompilerTool': {
|
'VCCLCompilerTool': {
|
||||||
'StringPooling': 'true', # pool string literals
|
|
||||||
'DebugInformationFormat': 1, # /Z7 embed info in .obj files
|
|
||||||
'WarningLevel': 3,
|
|
||||||
'BufferSecurityCheck': 'true',
|
'BufferSecurityCheck': 'true',
|
||||||
|
'DebugInformationFormat': 1, # /Z7 embed info in .obj files
|
||||||
'ExceptionHandling': 0, # /EHsc
|
'ExceptionHandling': 0, # /EHsc
|
||||||
|
'MultiProcessorCompilation': 'true',
|
||||||
|
'StringPooling': 'true', # pool string literals
|
||||||
'SuppressStartupBanner': 'true',
|
'SuppressStartupBanner': 'true',
|
||||||
'WarnAsError': 'false',
|
'WarnAsError': 'false',
|
||||||
|
'WarningLevel': 3, # /W3
|
||||||
},
|
},
|
||||||
'VCLinkerTool': {
|
'VCLinkerTool': {
|
||||||
'conditions': [
|
'conditions': [
|
||||||
@ -329,11 +274,6 @@
|
|||||||
}],
|
}],
|
||||||
],
|
],
|
||||||
'GenerateDebugInformation': 'true',
|
'GenerateDebugInformation': 'true',
|
||||||
'GenerateMapFile': 'true', # /MAP
|
|
||||||
'MapExports': 'true', # /MAPINFO:EXPORTS
|
|
||||||
'RandomizedBaseAddress': 2, # enable ASLR
|
|
||||||
'DataExecutionPrevention': 2, # enable DEP
|
|
||||||
'AllowIsolation': 'true',
|
|
||||||
'SuppressStartupBanner': 'true',
|
'SuppressStartupBanner': 'true',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -351,7 +291,12 @@
|
|||||||
# - "C4244: conversion from 'type1' to 'type2', possible loss of data"
|
# - "C4244: conversion from 'type1' to 'type2', possible loss of data"
|
||||||
# Ususaly safe. Disable for `dep`, enable for `src`
|
# Ususaly safe. Disable for `dep`, enable for `src`
|
||||||
'msvs_disabled_warnings': [4351, 4355, 4800, 4251, 4275, 4244, 4267],
|
'msvs_disabled_warnings': [4351, 4355, 4800, 4251, 4275, 4244, 4267],
|
||||||
|
'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
|
||||||
|
|
||||||
'conditions': [
|
'conditions': [
|
||||||
|
[ 'target_arch=="x64"', {
|
||||||
|
'msvs_configuration_platform': 'x64',
|
||||||
|
}],
|
||||||
['asan == 1 and OS != "mac"', {
|
['asan == 1 and OS != "mac"', {
|
||||||
'cflags+': [
|
'cflags+': [
|
||||||
'-fno-omit-frame-pointer',
|
'-fno-omit-frame-pointer',
|
||||||
@ -380,7 +325,6 @@
|
|||||||
],
|
],
|
||||||
}],
|
}],
|
||||||
['OS == "win"', {
|
['OS == "win"', {
|
||||||
'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
|
|
||||||
'defines': [
|
'defines': [
|
||||||
'WIN32',
|
'WIN32',
|
||||||
# we don't really want VC++ warning us about
|
# we don't really want VC++ warning us about
|
||||||
|
42
node.gyp
42
node.gyp
@ -266,6 +266,16 @@
|
|||||||
],
|
],
|
||||||
'dependencies': [ 'deps/histogram/histogram.gyp:histogram' ],
|
'dependencies': [ 'deps/histogram/histogram.gyp:histogram' ],
|
||||||
|
|
||||||
|
'msvs_settings': {
|
||||||
|
'VCLinkerTool': {
|
||||||
|
'GenerateMapFile': 'true', # /MAP
|
||||||
|
'MapExports': 'true', # /MAPINFO:EXPORTS
|
||||||
|
'RandomizedBaseAddress': 2, # enable ASLR
|
||||||
|
'DataExecutionPrevention': 2, # enable DEP
|
||||||
|
'AllowIsolation': 'true',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
# - "C4244: conversion from 'type1' to 'type2', possible loss of data"
|
# - "C4244: conversion from 'type1' to 'type2', possible loss of data"
|
||||||
# Ususaly safe. Disable for `dep`, enable for `src`
|
# Ususaly safe. Disable for `dep`, enable for `src`
|
||||||
'msvs_disabled_warnings!': [4244],
|
'msvs_disabled_warnings!': [4244],
|
||||||
@ -281,8 +291,7 @@
|
|||||||
}, {
|
}, {
|
||||||
'dependencies': [ '<(node_lib_target_name)' ],
|
'dependencies': [ '<(node_lib_target_name)' ],
|
||||||
}],
|
}],
|
||||||
[ 'node_intermediate_lib_type=="static_library" and '
|
[ 'node_intermediate_lib_type=="static_library" and node_shared=="false"', {
|
||||||
'node_shared=="false"', {
|
|
||||||
'xcode_settings': {
|
'xcode_settings': {
|
||||||
'OTHER_LDFLAGS': [
|
'OTHER_LDFLAGS': [
|
||||||
'-Wl,-force_load,<(PRODUCT_DIR)/<(STATIC_LIB_PREFIX)'
|
'-Wl,-force_load,<(PRODUCT_DIR)/<(STATIC_LIB_PREFIX)'
|
||||||
@ -348,6 +357,35 @@
|
|||||||
}],
|
}],
|
||||||
],
|
],
|
||||||
}],
|
}],
|
||||||
|
['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
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}]
|
||||||
],
|
],
|
||||||
}, # node_core_target_name
|
}, # node_core_target_name
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user