Skip to content

build: re-enable ThinLTO on macOS#51669

Draft
ckerr wants to merge 1 commit into
mainfrom
fix/reland-thin-lto-mac
Draft

build: re-enable ThinLTO on macOS#51669
ckerr wants to merge 1 commit into
mainfrom
fix/reland-thin-lto-mac

Conversation

@ckerr
Copy link
Copy Markdown
Member

@ckerr ckerr commented May 16, 2026

Description of Change

Fixes #44632.

Re-enable ThinLTO on macOS. Add a new patch to ensure N-API entry points aren't stripped by ThinLTO by copying the __attribute__((used)) approach from nodejs/node#49037 .

All reviews welcomed; CC @VerteDinde as a stakeholder for opening 44632

Checklist

Release Notes

Notes: Enabled ThinLTO on macOS builds.

@ckerr ckerr requested a review from a team as a code owner May 16, 2026 23:02
@ckerr ckerr marked this pull request as draft May 16, 2026 23:02
@ckerr ckerr force-pushed the fix/reland-thin-lto-mac branch from 3bc4823 to 9a99741 Compare May 16, 2026 23:07
@ckerr ckerr added target/42-x-y PR should also be added to the "42-x-y" branch. target/43-x-y PR should also be added to the "43-x-y" branch. target/41-x-y PR should also be added to the "41-x-y" branch. labels May 17, 2026
@ckerr ckerr marked this pull request as ready for review May 17, 2026 17:44
@deepak1556
Copy link
Copy Markdown
Member

Could you trigger a release build from this branch before merging for verification, thanks!

@ckerr ckerr marked this pull request as draft May 19, 2026 00:23
@ckerr
Copy link
Copy Markdown
Member Author

ckerr commented May 19, 2026

Re-enabling ThinLTO on macOS is surfacing a new issue for header-only classes with vtables. I need to fix this & then I'll mark this as ready for review again.

Re-enable ThinLTO on macOS. Add a patch to the bundled Node.js source
that anchors weak vtables and N-API entry points so they survive
clang's -fwhole-program-vtables under ThinLTO. See the patch's commit
message for details.
@ckerr ckerr force-pushed the fix/reland-thin-lto-mac branch from 9a99741 to e66dbe9 Compare May 19, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver/none target/41-x-y PR should also be added to the "41-x-y" branch. target/42-x-y PR should also be added to the "42-x-y" branch. target/43-x-y PR should also be added to the "43-x-y" branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Upgrades Follow Up]: re-enable thin LTO on Mac release builds

2 participants