Hi

On Sun, Mar 17, 2024 at 11:10 AM Michael Tokarev <m...@tls.msk.ru> wrote:
>
> 17.03.2024 01:19, Olaf Hering:
> > Sat, 16 Mar 2024 22:40:14 +0300 Michael Tokarev <m...@tls.msk.ru>:
> >
> >>       meson: ensure dbus-display generated code is built before other units
> >>       (cherry picked from commit 1222070e772833c6875e0ca63565db12c22df39e)
> >
> > "static_library" is used often. Some use the 'pic' option, which fixes the 
> > issue.
> >
> > I think every usage that ends up in a shared library requires 'pic:true'.
>
> The prob here seems to be that while fixing other issue (header file isn't 
> generated
> early enough), we all forgot about the fact dbus-display1.o can be used 
> inside a
> shared/loadable object when qemu is built with --enable-modules.
>

dbus-display1 is also used with static linking for the unit test.

It looks like the simplest is to let the actual target decide how it
is built, even if it is compiled multiple time then:

-  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)

This makes commit 186acfbaf7 ("tests/qtest: Depend on
dbus_display1_dep") no longer relevant, as dbus-display1.c will be
recompiled.

Alternatively, we could always build with pic: true (or pic:
enable_modules), but that's not ideal either.

-- 
Marc-André Lureau

Reply via email to