build: move optimizing link directives to node.exe target · nodejs/node@20a917c (original) (raw)

`@@ -137,13 +137,17 @@

`

137

137

`'Debug': {

`

138

138

`'variables': {

`

139

139

`'v8_enable_handle_zapping': 1,

`

``

140

`+

'conditions': [

`

``

141

`+

['node_shared != "true"', {

`

``

142

`+

'MSVC_runtimeType': 1, # MultiThreadedDebug (/MTd)

`

``

143

`+

}, {

`

``

144

`+

'MSVC_runtimeType': 3, # MultiThreadedDebugDLL (/MDd)

`

``

145

`+

}],

`

``

146

`+

],

`

140

147

` },

`

141

148

`'defines': [ 'DEBUG', '_DEBUG', 'V8_ENABLE_CHECKS' ],

`

142

149

`'cflags': [ '-g', '-O0' ],

`

143

150

`'conditions': [

`

144

``

`-

['target_arch=="x64"', {

`

145

``

`-

'msvs_configuration_platform': 'x64',

`

146

``

`-

}],

`

147

151

` ['OS=="aix"', {

`

148

152

`'cflags': [ '-gxcoff' ],

`

149

153

`'ldflags': [ '-Wl,-bbigtoc' ],

`

`@@ -152,31 +156,14 @@

`

152

156

`'cflags': [ '-fPIE' ],

`

153

157

`'ldflags': [ '-fPIE', '-pie' ]

`

154

158

` }],

`

155

``

`-

['node_shared=="true"', {

`

156

``

`-

'msvs_settings': {

`

157

``

`-

'VCCLCompilerTool': {

`

158

``

`-

'RuntimeLibrary': 3, # MultiThreadedDebugDLL (/MDd)

`

159

``

`-

}

`

160

``

`-

}

`

161

``

`-

}],

`

162

``

`-

['node_shared=="false"', {

`

163

``

`-

'msvs_settings': {

`

164

``

`-

'VCCLCompilerTool': {

`

165

``

`-

'RuntimeLibrary': 1 # MultiThreadedDebug (/MTd)

`

166

``

`-

}

`

167

``

`-

}

`

168

``

`-

}]

`

169

159

` ],

`

170

160

`'msvs_settings': {

`

171

161

`'VCCLCompilerTool': {

`

172

``

`-

'Optimization': 0, # /Od, no optimization

`

``

162

`+

'BasicRuntimeChecks': 3, # /RTC1

`

173

163

`'MinimalRebuild': 'false',

`

174

164

`'OmitFramePointers': 'false',

`

175

``

`-

'BasicRuntimeChecks': 3, # /RTC1

`

176

``

`-

'MultiProcessorCompilation': 'true',

`

177

``

`-

'AdditionalOptions': [

`

178

``

`-

'/bigobj', # prevent error C1128 in VS2015

`

179

``

`-

],

`

``

165

`+

'Optimization': 0, # /Od, no optimization

`

``

166

`+

'RuntimeLibrary': '<(MSVC_runtimeType)',

`

180

167

` },

`

181

168

`'VCLinkerTool': {

`

182

169

`'LinkIncremental': 2, # enable incremental linking

`

`@@ -189,12 +176,19 @@

`

189

176

`'Release': {

`

190

177

`'variables': {

`

191

178

`'v8_enable_handle_zapping': 0,

`

``

179

`+

'pgo_generate': ' -fprofile-generate ',

`

``

180

`+

'pgo_use': ' -fprofile-use -fprofile-correction ',

`

``

181

`+

'lto': ' -flto=4 -fuse-linker-plugin -ffat-lto-objects ',

`

``

182

`+

'conditions': [

`

``

183

`+

['node_shared != "true"', {

`

``

184

`+

'MSVC_runtimeType': 0 # MultiThreaded (/MT)

`

``

185

`+

}, {

`

``

186

`+

'MSVC_runtimeType': 2 # MultiThreadedDLL (/MD)

`

``

187

`+

}],

`

``

188

`+

],

`

192

189

` },

`

193

190

`'cflags': [ '-O3' ],

`

194

191

`'conditions': [

`

195

``

`-

['target_arch=="x64"', {

`

196

``

`-

'msvs_configuration_platform': 'x64',

`

197

``

`-

}],

`

198

192

` ['OS=="solaris"', {

`

199

193

`# pull in V8's postmortem metadata

`

200

194

`'ldflags': [ '-Wl,-z,allextract' ]

`

`@@ -203,11 +197,6 @@

`

203

197

`'cflags': [ '-fno-omit-frame-pointer' ],

`

204

198

` }],

`

205

199

` ['OS=="linux"', {

`

206

``

`-

'variables': {

`

207

``

`-

'pgo_generate': ' -fprofile-generate ',

`

208

``

`-

'pgo_use': ' -fprofile-use -fprofile-correction ',

`

209

``

`-

'lto': ' -flto=4 -fuse-linker-plugin -ffat-lto-objects ',

`

210

``

`-

},

`

211

200

`'conditions': [

`

212

201

` ['enable_pgo_generate=="true"', {

`

213

202

`'cflags': ['<(pgo_generate)'],

`

`@@ -227,62 +216,17 @@

`

227

216

`'cflags': [ '-fPIE' ],

`

228

217

`'ldflags': [ '-fPIE', '-pie' ]

`

229

218

` }],

`

230

``

`-

['node_shared=="true"', {

`

231

``

`-

'msvs_settings': {

`

232

``

`-

'VCCLCompilerTool': {

`

233

``

`-

'RuntimeLibrary': 2 # MultiThreadedDLL (/MD)

`

234

``

`-

}

`

235

``

`-

}

`

236

``

`-

}],

`

237

``

`-

['node_shared=="false"', {

`

238

``

`-

'msvs_settings': {

`

239

``

`-

'VCCLCompilerTool': {

`

240

``

`-

'RuntimeLibrary': 0 # MultiThreaded (/MT)

`

241

``

`-

}

`

242

``

`-

}

`

243

``

`-

}],

`

244

``

`-

['node_with_ltcg=="true"', {

`

245

``

`-

'msvs_settings': {

`

246

``

`-

'VCCLCompilerTool': {

`

247

``

`-

'WholeProgramOptimization': 'true' # /GL, whole program optimization, needed for LTCG

`

248

``

`-

},

`

249

``

`-

'VCLibrarianTool': {

`

250

``

`-

'AdditionalOptions': [

`

251

``

`-

'/LTCG:INCREMENTAL', # link time code generation

`

252

``

`-

]

`

253

``

`-

},

`

254

``

`-

'VCLinkerTool': {

`

255

``

`-

'OptimizeReferences': 2, # /OPT:REF

`

256

``

`-

'EnableCOMDATFolding': 2, # /OPT:ICF

`

257

``

`-

'LinkIncremental': 1, # disable incremental linking

`

258

``

`-

'AdditionalOptions': [

`

259

``

`-

'/LTCG:INCREMENTAL', # incremental link-time code generation

`

260

``

`-

]

`

261

``

`-

}

`

262

``

`-

}

`

263

``

`-

}, {

`

264

``

`-

'msvs_settings': {

`

265

``

`-

'VCCLCompilerTool': {

`

266

``

`-

'WholeProgramOptimization': 'false'

`

267

``

`-

},

`

268

``

`-

'VCLinkerTool': {

`

269

``

`-

'LinkIncremental': 2 # enable incremental linking

`

270

``

`-

}

`

271

``

`-

}

`

272

``

`-

}]

`

273

219

` ],

`

274

220

`'msvs_settings': {

`

275

221

`'VCCLCompilerTool': {

`

276

``

`-

'Optimization': 3, # /Ox, full optimization

`

277

``

`-

'FavorSizeOrSpeed': 1, # /Ot, favor speed over size

`

278

``

`-

'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible

`

279

``

`-

'OmitFramePointers': 'true',

`

280

222

`'EnableFunctionLevelLinking': 'true',

`

281

223

`'EnableIntrinsicFunctions': 'true',

`

``

224

`+

'FavorSizeOrSpeed': 1, # /Ot, favor speed over size

`

``

225

`+

'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible

`

``

226

`+

'OmitFramePointers': 'true',

`

``

227

`+

'Optimization': 3, # /Ox, full optimization

`

``

228

`+

'RuntimeLibrary': '<(MSVC_runtimeType)',

`

282

229

`'RuntimeTypeInfo': 'false',

`

283

``

`-

'MultiProcessorCompilation': 'true',

`

284

``

`-

'AdditionalOptions': [

`

285

``

`-

],

`

286

230

` }

`

287

231

` }

`

288

232

` }

`

`@@ -301,13 +245,14 @@

`

301

245

`'cflags!': ['-Werror'],

`

302

246

`'msvs_settings': {

`

303

247

`'VCCLCompilerTool': {

`

304

``

`-

'StringPooling': 'true', # pool string literals

`

305

``

`-

'DebugInformationFormat': 1, # /Z7 embed info in .obj files

`

306

``

`-

'WarningLevel': 3,

`

307

248

`'BufferSecurityCheck': 'true',

`

``

249

`+

'DebugInformationFormat': 1, # /Z7 embed info in .obj files

`

308

250

`'ExceptionHandling': 0, # /EHsc

`

``

251

`+

'MultiProcessorCompilation': 'true',

`

``

252

`+

'StringPooling': 'true', # pool string literals

`

309

253

`'SuppressStartupBanner': 'true',

`

310

254

`'WarnAsError': 'false',

`

``

255

`+

'WarningLevel': 3, # /W3

`

311

256

` },

`

312

257

`'VCLinkerTool': {

`

313

258

`'conditions': [

`

`@@ -329,11 +274,6 @@

`

329

274

` }],

`

330

275

` ],

`

331

276

`'GenerateDebugInformation': 'true',

`

332

``

`-

'GenerateMapFile': 'true', # /MAP

`

333

``

`-

'MapExports': 'true', # /MAPINFO:EXPORTS

`

334

``

`-

'RandomizedBaseAddress': 2, # enable ASLR

`

335

``

`-

'DataExecutionPrevention': 2, # enable DEP

`

336

``

`-

'AllowIsolation': 'true',

`

337

277

`'SuppressStartupBanner': 'true',

`

338

278

` },

`

339

279

` },

`

`@@ -351,7 +291,12 @@

`

351

291

`# - "C4244: conversion from 'type1' to 'type2', possible loss of data"

`

352

292

`` # Ususaly safe. Disable for dep, enable for src

``

353

293

`'msvs_disabled_warnings': [4351, 4355, 4800, 4251, 4275, 4244, 4267],

`

``

294

`+

'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin

`

``

295

+

354

296

`'conditions': [

`

``

297

`+

[ 'target_arch=="x64"', {

`

``

298

`+

'msvs_configuration_platform': 'x64',

`

``

299

`+

}],

`

355

300

` ['asan == 1 and OS != "mac"', {

`

356

301

`'cflags+': [

`

357

302

`'-fno-omit-frame-pointer',

`

380

325

` ],

`

381

326

` }],

`

382

327

` ['OS == "win"', {

`

383

``

`-

'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin

`

384

328

`'defines': [

`

385

329

`'WIN32',

`

386

330

`# we don't really want VC++ warning us about

`