gout

A static git page generator
git clone https://git.bracken.jp/gout.git
Log | Files | Refs | README | LICENSE

commit 6a904de046578134db8e8e11e17485604d6f6b8a
parent 428dea65818f79974043f757930879bddfcadca3
Author: Chris Bracken <chris@bracken.jp>
Date:   Wed, 11 Feb 2026 21:42:14 +0900

Improve optimize_size config

Diffstat:
Mbuild/BUILD.gn | 18++++++++++++++++++
1 file changed, 18 insertions(+), 0 deletions(-)

diff --git a/build/BUILD.gn b/build/BUILD.gn @@ -46,6 +46,24 @@ config("optimize") { # Optimise for size. config("optimize_size") { cflags = [ "-Os" ] + + if (current_os == "mac" || current_os == "ios") { + ldflags = [ + "-Wl,-dead_strip", # Mac equivalent of --gc-sections + "-Wl,-S", # Strip debug symbols + "-Wl,-x", # Strip local symbols + ] + } else { + # OpenBSD / Linux / etc. + cflags += [ + "-ffunction-sections", + "-fdata-sections", + ] + ldflags = [ + "-Wl,--gc-sections", + "-s", + ] + } } # Enable link-time-optimisation.