Enable framepointers for arm64 macOS builds on all channels
Categories
(Firefox Build System :: General, task)
Tracking
(firefox98 fixed)
| Tracking | Status | |
|---|---|---|
| firefox98 | --- | fixed |
People
(Reporter: mstange, Assigned: mstange)
References
Details
Attachments
(1 external file)
At the moment, our Firefox macOS arm64 builds have framepointers on Nightly but not on the Beta / Release channels. We should have framepointers on all channels.
Using framepointers on macOS arm64 has the following advantages:
- It is in line with Apple's arm64 guidelines.
- It matches the default clang configuration and all Apple binaries.
- It makes the profiler work without requiring changes to its stackwalking implementation. (At the moment the profiler on macOS can only get C++ stacks on Nightly.)
- It reduces the XUL binary size by about 8 MB (202.8 MB -> 194.9 MB), because it allows for more compact unwind tables.
It comes at the cost of one instruction per non-leaf function: The instruction which sets fp to the right value. This increases the XUL __text size by 0.7 MB (84.6 MB -> 85.3 MB).
Leaf functions still won't have framepointers, i.e. functions which don't call other functions and which thus never overwrite the lr register. That's fine. We could explicitly opt in to having framepointers for leaf functions too (with -mno-omit-leaf-frame-pointer), but this doesn't seem necessary and would be an uncommon configuration.
| Assignee | ||
Comment 1•4 years ago
|
||
I've gathered section sizes for the different framepointer configurations:
No framepointers: -fomit-frame-pointer -funwind-tables
0 __text 050b70e8 0000000000004000 TEXT (84.6 MB)
7 __gcc_except_tab 0001e670 0000000006847e44 DATA (125 KB)
12 __unwind_info 001b656c 0000000006876a2c DATA (1795 KB)
13 __eh_frame 00720894 0000000006a2cf98 DATA (7473 KB)
Explicitly non-leaf framepointers: -fno-omit-frame-pointer -momit-leaf-frame-pointer -funwind-tables
0 __text 051582fc 0000000000004000 TEXT (85.3 MB)
7 __gcc_except_tab 0001e6c0 00000000068e7e64 DATA (125 KB)
12 __unwind_info 000b2134 0000000006916ac4 DATA (729 KB)
13 __eh_frame 0000232c 00000000069c8bf8 DATA (9 KB)
Regular framepointers: -fno-omit-frame-pointer -funwind-tables
0 __text 0515ea70 0000000000004000 TEXT (85.3 MB)
7 __gcc_except_tab 0000ef8c 00000000068f0024 DATA (61 KB)
12 __unwind_info 0009d720 000000000690f508 DATA (645 KB)
13 __eh_frame 00002184 00000000069acc28 DATA (9 KB)
Full framepointers: -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -funwind-tables
0 __text 0524ab68 0000000000004000 TEXT (86.2 MB)
7 __gcc_except_tab 0000ef8c 00000000069dc19c DATA (61 KB)
12 __unwind_info 00091030 00000000069fb6c8 DATA (594 KB)
13 __eh_frame 00000344 0000000006a8c6f8 DATA (1 KB)
This was done on a local build with the default optimization flags. The "Regular framepointers" configuration is the smallest overall. It matches what we're currently doing on Nightly.
| Assignee | ||
Comment 2•4 years ago
|
||
Comment 4•4 years ago
|
||
| bugherder | ||
Description
•