Suppress .eh_frame generation when EXECUTORCH_OPTIMIZE_SIZE is ON#17906
Suppress .eh_frame generation when EXECUTORCH_OPTIMIZE_SIZE is ON#17906
Conversation
|
Stack from ghstack (oldest at bottom): |
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/17906
Note: Links to docs will display an error until the docs builds have been completed.
|
This PR needs a
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| set(CMAKE_CXX_FLAGS_RELEASE | ||
| "${CMAKE_CXX_FLAGS_RELEASE} -fno-exceptions -fno-rtti -fno-asynchronous-unwind-tables -fno-unwind-tables" | ||
| ) |
There was a problem hiding this comment.
PR description says the change only adds -fno-asynchronous-unwind-tables/-fno-unwind-tables, but this hunk also adds -fno-exceptions and -fno-rtti to CMAKE_CXX_FLAGS_RELEASE. Please update the PR description (or drop the extra flags) so reviewers/users understand the full behavior change.
Add -fno-asynchronous-unwind-tables and -fno-unwind-tables to both
CXX and C release flags when EXECUTORCH_OPTIMIZE_SIZE is enabled.
This eliminates .eh_frame/.eh_frame_hdr sections from the runtime
libraries, which is safe because ExecuTorch already builds with
-fno-exceptions.
For each function, .eh_frame stores a compact description of how to restore the previous stack frame
Caveats, when OPTIMIZE_SIZE is on
Reduces stripped size_test by 8,192 bytes (14.6%) and stripped
size_test_all_ops by 143,360 bytes (8.6%).