From 1777ac72a7eb42a99ef1d303c942b113cc9c5126 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Thu, 6 Mar 2025 02:39:24 -0700 Subject: [PATCH] meson: Trim unreferenced functions, data --- meson.build | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meson.build b/meson.build index 17737c536b..b53e5f36fd 100644 --- a/meson.build +++ b/meson.build @@ -353,6 +353,10 @@ qemu_common_flags = [ qemu_cflags = [] qemu_ldflags = [] +# Trim unreferenced functions, data +qemu_common_flags += ['-ffunction-sections', '-fdata-sections'] +qemu_ldflags += '-Wl,--gc-sections' + if host_os == 'darwin' # Disable attempts to use ObjectiveC features in os/object.h since they # won't work when we're compiling with gcc as a C compiler.