Page MenuHomeFreeBSD

Use -Oz/-Os for all loader/stand builds.
ClosedPublic

Authored by imp on Aug 15 2018, 3:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 25, 3:08 PM
Unknown Object (File)
Sun, Nov 24, 8:58 AM
Unknown Object (File)
Nov 21 2024, 12:54 PM
Unknown Object (File)
Nov 20 2024, 12:10 AM
Unknown Object (File)
Nov 18 2024, 8:50 AM
Unknown Object (File)
Nov 18 2024, 7:09 AM
Unknown Object (File)
Nov 7 2024, 12:26 AM
Unknown Object (File)
Oct 25 2024, 3:31 AM
Subscribers

Details

Summary
While we're not super size constrained, the x86 BIOS /boot/loader has
to be less than about 520k-530k to be reliable. The LUA loader is at
this size today. -Os saves about 15% on the size, keeping us safely
small enough. This will also help with sjg's work on bringing in
bearssl, though we may again be looking for space in the LUA loader.

Size table for clang 6.0.0:
            default -Os     -Oz     -O1

loader_4th 442368 389120 376832 417792
loader_lua 524288 446464 430080 479232

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 18811
Build 18475: arc lint + arc unit

Event Timeline

-Oz is even better, but clang specific

imp retitled this revision from Use -Os for all loader builds. to Use -Oz/-Os for all loader/stand builds..Aug 15 2018, 4:33 PM
imp edited the summary of this revision. (Show Details)

Tested on my "build machine" (BIOS & MBR); no observed difference in behavior (from before the patch), so "does no harm" as far as I can tell so far.

I plan to test on my laptop (which actually had a boot failure this morning at r337834) later today.

I was remiss in failing to note that the change in question reduced the size of the loader from 516096 to 421888 bytes.

This revision is now accepted and ready to land.Aug 15 2018, 6:03 PM
This revision was automatically updated to reflect the committed changes.

OK; I tested on my laptop (while failed to boot using the Lua loader at r337834), and after applying the patch, issuing "make clean" in src/stand, and rebuilding/installing, the laptop booted OK. Prior to applying the patch, /boot/loader was 516096 bytes; the loader built after applying the patch is 421888 bytes.

Thanks!