summaryrefslogtreecommitdiff
path: root/node.gyp
diff options
context:
space:
mode:
authorRefael Ackermann <refack@gmail.com>2019-02-03 15:51:20 -0500
committerRefael Ackermann <refack@gmail.com>2019-02-14 15:14:40 -0500
commit20a917c571a410c3e5abed67dc55ec495cd221cd (patch)
treef2b429f8e2b1975078534897a96793846d9e5774 /node.gyp
parent582c0d5a092b04616fef4b11b0fd893c181356f1 (diff)
downloadandroid-node-v8-20a917c571a410c3e5abed67dc55ec495cd221cd.tar.gz
android-node-v8-20a917c571a410c3e5abed67dc55ec495cd221cd.tar.bz2
android-node-v8-20a917c571a410c3e5abed67dc55ec495cd221cd.zip
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>
Diffstat (limited to 'node.gyp')
-rw-r--r--node.gyp42
1 files changed, 40 insertions, 2 deletions
diff --git a/node.gyp b/node.gyp
index da3e5ee845..d0a715b91e 100644
--- a/node.gyp
+++ b/node.gyp
@@ -266,6 +266,16 @@
],
'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"
# Ususaly safe. Disable for `dep`, enable for `src`
'msvs_disabled_warnings!': [4244],
@@ -281,8 +291,7 @@
}, {
'dependencies': [ '<(node_lib_target_name)' ],
}],
- [ 'node_intermediate_lib_type=="static_library" and '
- 'node_shared=="false"', {
+ [ 'node_intermediate_lib_type=="static_library" and node_shared=="false"', {
'xcode_settings': {
'OTHER_LDFLAGS': [
'-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
{