diff mbox series

[RFC] meson.build: add -gsplit-dwarf to default cflags

Message ID 20250303221703.1291078-1-alex.bennee@linaro.org
State New
Headers show
Series [RFC] meson.build: add -gsplit-dwarf to default cflags | expand

Commit Message

Alex Bennée March 3, 2025, 10:17 p.m. UTC
This option is supported by both gcc (since 4.7) and clang (since
7.0). Not only does this make the linkers job easier by reducing the
amount of ELF it needs to parse it also reduces the total build size
quite considerably. In my case a default build went from 5.8G to 3.9G.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
RFC:
  - currently and RFC because it should also apply to test binaries
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meson.build b/meson.build
index 4588bfd864..a936d1b422 100644
--- a/meson.build
+++ b/meson.build
@@ -363,7 +363,7 @@  endforeach
 
 qemu_common_flags = [
   '-D_GNU_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE',
-  '-fno-strict-aliasing', '-fno-common', '-fwrapv' ]
+  '-fno-strict-aliasing', '-fno-common', '-fwrapv', '-gsplit-dwarf' ]
 qemu_cflags = []
 qemu_ldflags = []