Repository navigation
Commit a47ebc7
authored
Use minimal PAL and nano libraries in Cortex-M size tests (#24216)
### Summary
The Cortex-M size tests should measure ExecuTorch's contribution to
binary size. The POSIX platform layer and, for GNU, the full C/C++
libraries with exception support and demangling obscure that
contribution. Select minimal PAL for both existing configurations and
`nano.specs` for the GNU build to reduce this overhead and make the
tests more sensitive to changes in ExecuTorch.
Initialize C and C++ flags with `nano.specs` so it applies during
compilation and linking while preserving the build script's existing
flags. Set the runtime size limits to 34,000 bytes for GNU and 57,000
bytes for Zephyr. The GNU configuration uses nano's
abort-on-allocation-failure behavior.
### Test plan
Built both size targets on base `0549e1ee61` using Cortex-M55, C++17,
Release with size optimization and logging disabled; GNU Arm 15.2.Rel1
and Zephyr SDK 1.0.1 (GCC 14.3.0). Stripped ELF file sizes in bytes:
| Configuration | Binary | Before | After | Saved |
|---|---|---:|---:|---:|
| GNU bare-metal | `size_test` | 117,348 | 33,372 | 83,976 |
| GNU bare-metal | `size_test_all_ops` | 1,245,820 | 1,156,180 | 89,640
|
| Zephyr | `size_test` | 56,332 | 55,800 | 532 |
| Zephyr | `size_test_all_ops` | 1,155,048 | 1,154,512 | 536 |
All 263 C/C++ compile commands and both size-test compile/link commands
select nano.specs while retaining the existing compiler flags. Both GNU
binaries retain FileDataLoader and contain no exception-unwinder or
demangler symbols. Workflow YAML parsing, shell syntax, and both size
limits pass.
Authored with AI assistance using Codex.1 parent 62367c0 commit a47ebc7
1 file changed
Lines changed: 11 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
729 | 729 | | |
730 | 730 | | |
731 | 731 | | |
732 | | - | |
| 732 | + | |
733 | 733 | | |
734 | 734 | | |
735 | 735 | | |
736 | 736 | | |
737 | | - | |
| 737 | + | |
738 | 738 | | |
739 | 739 | | |
740 | 740 | | |
| |||
752 | 752 | | |
753 | 753 | | |
754 | 754 | | |
755 | | - | |
| 755 | + | |
756 | 756 | | |
757 | | - | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
758 | 764 | | |
759 | | - | |
| 765 | + | |
760 | 766 | | |
761 | 767 | | |
762 | 768 | | |
| |||
0 commit comments