From: Paolo Bonzini <[email protected]>

These cause a werror=true build to fail with Meson 1.12.0, as it now
makes linker warnings fatal as well.

Cc: [email protected]
Reviewed-by: Marc-AndrĂ© Lureau <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
(cherry picked from commit 501187d0bc62a46628acc25e0ea0187094f04246)
Signed-off-by: Michael Tokarev <[email protected]>

diff --git a/meson.build b/meson.build
index f94d84e2d31..9cadd636f74 100644
--- a/meson.build
+++ b/meson.build
@@ -612,6 +612,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
-- 
2.47.3


Reply via email to