On 15 July 2016 at 12:37, Laszlo Ersek <[email protected]> wrote: > On 07/15/16 12:15, Ard Biesheuvel wrote: >> On 15 July 2016 at 11:51, Laszlo Ersek <[email protected]> wrote: > >>> What I'd be most interested in is >>> enabling optimization (saving space) for -b DEBUG -- I don't do source >>> level debugging, but I want the debug messages and the ASSERT()s. Saving >>> space with those compiled in would be superb -- I guess that's where the >>> savings would really shine. >>> >> >> Doing the same build for DEBUG gives me >> >> -O0 >> >> SECFV [20%Full] 212992 total, 44464 used, 168528 free >> FVMAIN_COMPACT [75%Full] 1753088 total, 1326592 used, 426496 free >> DXEFV [67%Full] 10485760 total, 7077696 used, 3408064 free >> PEIFV [28%Full] 917504 total, 257200 used, 660304 free >> >> -O1 >> >> SECFV [16%Full] 212992 total, 35248 used, 177744 free >> FVMAIN_COMPACT [76%Full] 1753088 total, 1339592 used, 413496 free >> DXEFV [56%Full] 10485760 total, 5933120 used, 4552640 free >> PEIFV [23%Full] 917504 total, 216240 used, 701264 free >> >> -O2 >> >> SECFV [17%Full] 212992 total, 36688 used, 176304 free >> FVMAIN_COMPACT [83%Full] 1753088 total, 1469904 used, 283184 free >> DXEFV [58%Full] 10485760 total, 6157440 used, 4328320 free >> PEIFV [24%Full] 917504 total, 227408 used, 690096 free >> >> which paints roughly the same picture: much smaller binaries, but O2 >> is worse than O0/O1 after compression. > > Thank you for checking this -- in absolute terms, -O1 shaves about 1.1MB > off DXEFV. Not bad! > >> Another thing to take into account is that DXE code size translates >> directly into RuntimeServicesCode memory footprint of >> DXE_RUNTIME_DRIVER modules, > > Good point! > >> although I am not sure if that has ever >> been a source of concern. > > I've never thought of it -- my gut feeling is that the AcpiNVS stuff is > larger. (I could easily be biased though: the AcpiNVS allocations are > all manual and require thought, while RuntimeServicesCode allocs are all > automatic. I might be projecting "mental effort required" to "allocation > size" :)) >
Actually, it appears -Os does work, as long as you also pass the -maccumulate-outgoing-args switch. I am not sure what I did wrong before, but all the builds below boot fine. I get the following results: RELEASE_GCC44 SECFV [6%Full] 212992 total, 14320 used, 198672 free FVMAIN_COMPACT [56%Full] 1753088 total, 997184 used, 755904 free DXEFV [33%Full] 10485760 total, 3508336 used, 6977424 free PEIFV [11%Full] 917504 total, 109896 used, 807608 free RELEASE_GCC46 SECFV [6%Full] 212992 total, 13936 used, 199056 free FVMAIN_COMPACT [56%Full] 1753088 total, 987632 used, 765456 free DXEFV [33%Full] 10485760 total, 3468304 used, 7017456 free PEIFV [11%Full] 917504 total, 107784 used, 809720 free RELEASE_GCC47 SECFV [6%Full] 212992 total, 13808 used, 199184 free FVMAIN_COMPACT [56%Full] 1753088 total, 988072 used, 765016 free DXEFV [32%Full] 10485760 total, 3449936 used, 7035824 free PEIFV [11%Full] 917504 total, 106984 used, 810520 free RELEASE_GCC48 SECFV [6%Full] 212992 total, 13744 used, 199248 free FVMAIN_COMPACT [56%Full] 1753088 total, 992800 used, 760288 free DXEFV [32%Full] 10485760 total, 3453456 used, 7032304 free PEIFV [11%Full] 917504 total, 107464 used, 810040 free DEBUG_GCC44 SECFV [14%Full] 212992 total, 31632 used, 181360 free FVMAIN_COMPACT [74%Full] 1753088 total, 1300904 used, 452184 free DXEFV [50%Full] 10485760 total, 5272464 used, 5213296 free PEIFV [25%Full] 917504 total, 231496 used, 686008 free DEBUG_GCC46 SECFV [14%Full] 212992 total, 31728 used, 181264 free FVMAIN_COMPACT [73%Full] 1753088 total, 1291672 used, 461416 free DXEFV [50%Full] 10485760 total, 5263888 used, 5221872 free PEIFV [25%Full] 917504 total, 231656 used, 685848 free DEBUG_GCC47 SECFV [14%Full] 212992 total, 31440 used, 181552 free FVMAIN_COMPACT [73%Full] 1753088 total, 1290584 used, 462504 free DXEFV [49%Full] 10485760 total, 5234224 used, 5251536 free PEIFV [25%Full] 917504 total, 230152 used, 687352 free DEBUG_GCC48 SECFV [14%Full] 212992 total, 31280 used, 181712 free FVMAIN_COMPACT [73%Full] 1753088 total, 1296208 used, 456880 free DXEFV [49%Full] 10485760 total, 5229424 used, 5256336 free PEIFV [25%Full] 917504 total, 229512 used, 687992 free I am going to respin the series to use Os rather than O2. Thanks, Ard. _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

