-
Notifications
You must be signed in to change notification settings - Fork 15k
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
feat: enable whole-program optimization native modules by default #36937
feat: enable whole-program optimization native modules by default #36937
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node's upstream headers do not have this flag, but I'm good adding the flag since it is actually enabled in Electron's build.
3d8e07f
to
7ca6017
Compare
The change breaks linux build as LTCG is only supported on Windows. Fixing it. |
Build is failing. Investigating. |
9f93b45
to
a32e3ab
Compare
Enable whole-program optimization in electron native modules by default.
a32e3ab
to
78cca97
Compare
The build failures were not related to the changes. Changes are ready for merge. |
Release Notes Persisted
|
@kyrylo-hrechykhin @zcbenz why do we need to specify this explicitly when the default for addons is to build with ltcg https://github.com/nodejs/node-gyp/blob/main/addon.gypi#L5 ? Does this flag get overriden during the configure stage ? |
The |
@deepak1556 , @zcbenz , I do not know on which stage this variable changes. But it is clear that config.gypi generated has optimization disabled. |
Given that both |
@deepak1556 , I also believe this change may be beneficial for users who consume electron release branches. Is it possible to backport this change to release branches as well? |
I'm good backporting this 👍 |
/trop run backport |
The backport process for this PR has been manually initiated - here we go! :D |
I have automatically backported this PR to "23-x-y", please check out #37046 |
I have automatically backported this PR to "22-x-y", please check out #37047 |
I have automatically backported this PR to "21-x-y", please check out #37048 |
…ectron#36937) * feat: enable whole-program optimization Enable whole-program optimization in electron native modules by default. * pass --with-ltcg to configure.py instead of setting variable * enable ltcg only on windows Co-authored-by: Kyrylo Hrechykhin <khrechykhin@microsoft.com>
…ectron#36937) * feat: enable whole-program optimization Enable whole-program optimization in electron native modules by default. * pass --with-ltcg to configure.py instead of setting variable * enable ltcg only on windows Co-authored-by: Kyrylo Hrechykhin <khrechykhin@microsoft.com>
Description of Change
Enable whole-program optimization by default in script that generates config.gypi needed for electron native modules.
Related work item: #36936
Checklist
Release Notes
Notes: Whole-program optimization is enabled by default in electron node headers config file.