summary refs log tree commit diff stats
path: root/results/classifier/zero-shot/118/none/516
blob: 7ff6fa387f83db9008f4a18b76197561e807c4d8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
device: 0.747
PID: 0.736
performance: 0.736
TCG: 0.717
permissions: 0.714
virtual: 0.710
debug: 0.665
register: 0.651
architecture: 0.634
user-level: 0.627
peripherals: 0.617
semantic: 0.614
x86: 0.592
risc-v: 0.580
socket: 0.577
arm: 0.573
boot: 0.564
mistranslation: 0.563
graphic: 0.560
hypervisor: 0.560
vnc: 0.548
files: 0.547
network: 0.545
ppc: 0.525
KVM: 0.469
kernel: 0.452
assembly: 0.425
VMM: 0.396
i386: 0.303

Configure option `--enable-plugins` makes modules in shared library not loadable on macOS
Description of problem:
The title mentions `--enable-plugins` option, however as it's enabled by default, not providing `--disable-plugins` would also cause this to happen.

If TCG plugin support is enabled, symbols in `qemu-system-*` binaries will be missing, and module libraries would fail to load as they expect those symbols to exist in the main binary.

Configure options used: `STRIP="strip -x" ./configure --enable-user --enable-tools --enable-parallels --enable-libxml2 --enable-spice --enable-hvf --enable-cocoa --enable-guest-agent --enable-curses --enable-plugins --enable-modules --objcc=gcc --enable-libusb --enable-usb-redir`

After inspecting the compiler command line, I've found the linker option `-Wl,-exported_symbols_list,qemu-plugins-ld64.symbols` is causing this to happen: only symbols listed in `qemu-plugins-ld64.symbols` would be kept in `qemu-system-*` binaries and all other symbols will be hidden.

Note that this is not caused by stripping (although I had to use custom strip command line on macOS to successfully compile qemu); the option `-exported_symbols_list` works by only exposing the provided symbols and treating all other symbols as `visibility=hidden`.

Replacing `--enable-plugins` to `--disable-plugins` in the above configure command line would "fix" it, although it means TCG plugins will not be supported.
Steps to reproduce:
1. Build QEMU on macOS with plugin support enabled
2. Try to use modules in shared library like qxl
Additional information:
Some examples:

```
$ qemu-system-x86_64 -device qxl
Failed to open module: dlopen(/usr/local/bin/../lib/qemu/ui-spice-core.dylib, 10): Symbol not found: __TRACE_QEMU_SPICE_ADD_MEMSLOT_DSTATE
  Referenced from: /usr/local/bin/../lib/qemu/ui-spice-core.dylib
  Expected in: flat namespace
 in /usr/local/bin/../lib/qemu/ui-spice-core.dylib
Failed to open module: dlopen(/usr/local/bin/../lib/qemu/hw-display-qxl.dylib, 2): Symbol not found: __TRACE_QXL_CLIENT_MONITORS_CONFIG_CAPPED_DSTATE
  Referenced from: /usr/local/bin/../lib/qemu/hw-display-qxl.dylib
  Expected in: flat namespace
 in /usr/local/bin/../lib/qemu/hw-display-qxl.dylib
qemu-system-x86_64: -device qxl: 'qxl' is not a valid device model name
```

```
$ qemu-system-x86_64 -spice port=5901
Failed to open module: dlopen(/usr/local/bin/../lib/qemu/ui-spice-core.dylib, 10): Symbol not found: __TRACE_QEMU_SPICE_ADD_MEMSLOT_DSTATE
  Referenced from: /usr/local/bin/../lib/qemu/ui-spice-core.dylib
  Expected in: flat namespace
 in /usr/local/bin/../lib/qemu/ui-spice-core.dylib
qemu-system-x86_64: -spice port=5901: spice support is disabled
```

After disabling plugin support I could run virtual machines locally through libvirt with full spice and qxl video support.