Skip to content
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

build: use more aggressive LTO on gcc #56138

Closed
wants to merge 3 commits into from
Closed
Changes from 2 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
3 changes: 2 additions & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
'enable_pgo_generate%': '0',
'enable_pgo_use%': '0',
'python%': 'python',
'enable_lto': 'true',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this bypasses / overrides the --enable-lto configure flag?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, yeah this should just flip the flag in configure.py, at least flip it to true on known safe platforms.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I think this gets overridden by the config.gypi generated by ./configure, so it's not actually enabling LTO

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried enabling it with --enable-lto and it in fact took longer than the current build, but it didn't take forever to link mkdsnapshot. It took longer but it finished. Am I missing something?

Copy link
Member

@joyeecheung joyeecheung Dec 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be that you Mac is beefier than mine/your lld is newer than mine/you just have more patience than I do ;) (I think I waited for ~20 minutes before I gave up)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably. I have the new mac mini with the highest spec.


'node_shared%': 'false',
'force_dynamic_crt%': 0,
Expand Down Expand Up @@ -187,7 +188,7 @@
['clang==1', {
'lto': ' -flto ', # Clang
}, {
'lto': ' -flto=4 -fuse-linker-plugin -ffat-lto-objects ', # GCC
'lto': ' -flto=4 -fuse-linker-plugin -fno-fat-lto-objects -flto-partition=one -ffunction-sections -fdata-sections ', # GCC
}],
],
},
Expand Down
Loading