Hi On Tue, Mar 6, 2018 at 2:27 PM, Gerd Hoffmann <kra...@redhat.com> wrote: >> >> /home/elmarco/src/qemu/build/x86_64-softmmu/../audio-pa.so: undefined >> >> symbol: audio_pt_unlock_and_signal > >> Fresh directory, cleaned ccache. That didn't help. fwiw, I am >> compiling on f27, gcc (GCC) 7.3.1 20180130. I'll investigate further >> if you can't reproduce. > > Hmm, working fine here (both rhel-7 and fedora-27 testbuild container, default > build flags). > > The symbol in question should be provided by qemu: > > kraxel@fedora-64bit ~/projects/qemu/build/fedora# objdump -x audio-pa.so | > grep audio_pt_unlock_and_signal > 0000000000000000 *UND* 0000000000000000 > audio_pt_unlock_and_signal > kraxel@fedora-64bit ~/projects/qemu/build/fedora# objdump -x > x86_64-softmmu/qemu-system-x86_64 | grep audio_pt_unlock_and_signal > 00000000004735f0 g F .text 0000000000000067 > audio_pt_unlock_and_signal > > Possibly your linker throws it away, thinking there is no user because of the > modular drivers?
It's not that, but it works if I build qemu with -rdynamic. dlopen(3): External references in the shared object are resolved using the shared objects in that object's dependency list and any other objects previously opened with the RTLD_GLOBAL flag. If the executable was linked with the flag "-rdynamic" (or, synonymously, "--export-dynamic"), then the global symbols in the executable will also be used to resolve references in a dynamically loaded shared object. (If I understand right, there is some magic rules.mk process-archive-undefs to make sure the used symbols from modules are always linked in) Could it be that -rdynamic / --export-dynamic is assumed in our build system since modules have been added? yes, it's pulled from /usr/lib64/pkgconfig/gmodule-2.0.pc, but glib upstream built with meson doesn't have the flag anymore. That's probably worth fixing in glib: https://bugzilla.gnome.org/show_bug.cgi?id=794123 We should switch to using gmodule-export-2.0.pc (since 2.6), which is also broken in meson build. I'll send a patch for that. -- Marc-André Lureau