8000 fix: add patch to node for native module size issue on windows by deepak1556 · Pull Request #20614 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: add patch to node for native module size issue on windows #20614

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions patches/node/.patches
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ fix_microtasks.patch
fsevents-stop-using-fsevents-to-watch-files.patch
fsevents-regression-in-watching.patch
fix_enable_worker_threads.patch
build_bring_back_node_with_ltcg_configuration.patch
42 changes: 42 additions & 0 deletions patches/node/build_bring_back_node_with_ltcg_configuration.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Deepak Mohan <hop2deep@gmail.com>
Date: Wed, 16 Oct 2019 13:41:12 -0700
Subject: build: bring back node_with_ltcg configuration

This was moved to code node.gyp as part of https://github.com/nodejs/node/pull/25931
which caused native modules size increase which were depending on
this configuration transitively https://github.com/nodejs/node/issues/29501.
THe fix for this should land in node-gyp as discussed in above issue,
landing this as temporary patch.

diff --git a/common.gypi b/common.gypi
index f07e65f719a1a5939997dfcae7bc787ee6391f4d..69b5439a5c19230e5568450c3aca9ce27661d77c 100644
--- a/common.gypi
+++ b/common.gypi
@@ -180,6 +180,26 @@
'cflags': [ '-fPIE' ],
'ldflags': [ '-fPIE', '-pie' ]
}],
+ ['node_with_ltcg=="true"', {
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'WholeProgramOptimization': 'true' # /GL, whole program optimization, needed for LTCG
+ },
+ 'VCLibrarianTool': {
+ 'AdditionalOptions': [
+ '/LTCG:INCREMENTAL', # 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': {
0