Commit 501187d0bc for qemu.org
commit 501187d0bc62a46628acc25e0ea0187094f04246
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: Mon Aug 17 15:14:07 2026 +0200
meson: make linker warnings non-fatal on Linux
These cause a werror=true build to fail with Meson 1.12.0, as it now
makes linker warnings fatal as well.
Cc: qemu-stable@nongnu.org
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
diff --git a/meson.build b/meson.build
index 49a5baf5b5..40e3f4ec44 100644
--- a/meson.build
+++ b/meson.build
@@ -602,6 +602,11 @@ if host_os == 'windows'
qemu_ldflags += cc.get_supported_link_arguments('-Wl,--no-seh', '-Wl,--nxcompat')
qemu_ldflags += cc.get_supported_link_arguments('-Wl,--dynamicbase', '-Wl,--high-entropy-va')
endif
+if host_os == 'linux' and get_option('werror') and get_option('prefer_static')
+ # On glibc systems, glib causes warnings about getpwuid, getpwuid_r
+ # and getpwnam_r not being supported with static linking
+ qemu_ldflags += cc.get_supported_link_arguments('-Wl,--no-fatal-warnings')
+endif
if get_option('fuzzing')
# Specify a filter to only instrument code that is directly related to