harfbuzz: build with -Os
Upstream explicitly say in their CONFIG.md file to build with -Os:
Make sure you build with your compiler's "optimize for size" option.
On `gcc` this is `-Os` [ ... ] HarfBuzz heavily uses inline functions
and the optimize-size flag can make the library smaller by 20% or
more. Moreover, sometimes, based on the target CPU, the optimize-size
builds perform *faster* as well, thanks to lower code footprint and
caching effects
Drop the patch to build just hb-subset-plan-layout.cc with -Os (which
was a workaround for a GCC bug), and pass -Os globally.
This manages to reduce the duration to harfbuzz:do_compile on my machine
from 75s to 47s, and has a big impact on the library sizes:
harfbuzz: PKGSIZE changed from
1769358 to
1237070 (-30%)
harfbuzz-dbg: PKGSIZE changed from
84920168 to
71203208 (-16%)
harfbuzz-subset: PKGSIZE changed from
1579247 to 940191 (-40%)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>