]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
harfbuzz: build with -Os
authorRoss Burton <ross.burton@arm.com>
Fri, 18 Jul 2025 13:58:40 +0000 (14:58 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 21 Jul 2025 21:59:31 +0000 (22:59 +0100)
commitd795b3e16ed01d7273d4f3779684eb41cc16f809
treecbaaa1b4832a33ec5d62b0fda8dbf89cb187a260
parent5db0a59d09bbab63d48c03d5fa4bfb7c89d6a3b1
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>
meta/recipes-graphics/harfbuzz/harfbuzz/0001-Use-Os-to-compile-hb-subset-plan-layout.cc.patch [deleted file]
meta/recipes-graphics/harfbuzz/harfbuzz_11.2.1.bb