Skip to content

Commit

Permalink
ui: compile dbus-display1.c with -fPIC as necessary
Browse files Browse the repository at this point in the history
Building dbus-display1.c explicitly as a static library drops -fPIC by
default, which may not be correct if it ends up linked to a shared
library.

Let the target decide how to build the unit, with or without -fPIC. This
makes commit 186acfb ("tests/qtest: Depend on dbus_display1_dep") no
longer relevant, as dbus-display1.c will be recompiled.

Fixes: c172136 ("meson: ensure dbus-display generated code is built
before other units")

Reported-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
(cherry picked from commit d4069a8)
  • Loading branch information
elmarco authored and Michael Tokarev committed Mar 21, 2024
1 parent de742b1 commit f8fb592
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ui/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ if dbus_display
'--interface-prefix', 'org.qemu.',
'--c-namespace', 'QemuDBus',
'--generate-c-code', '@BASENAME@'])
dbus_display1_lib = static_library('dbus-display1', dbus_display1, dependencies: gio)
dbus_display1_dep = declare_dependency(link_with: dbus_display1_lib, sources: dbus_display1[0])
dbus_display1_dep = declare_dependency(sources: dbus_display1, dependencies: gio)
dbus_ss.add(when: [gio, dbus_display1_dep],
if_true: [files(
'dbus-chardev.c',
Expand Down

0 comments on commit f8fb592

Please sign in to comment.