Hi all,
I found a problem when trying to build QEMU with igvm enabled:
When igvm is not installed in a "canonical" path, the build system
cannot find the library.
To reproduce:
build igvm (latest upstream, as there were some problems with pkg-config).
PREFIX=$HOME/igvminst make -f igvm_c/Makefile install
This would result in igvm being installed in $HOME/igvminst
Then build QEMU
PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:$HOME/igvminst/lib64/pkgconfig/"
./configure --target-list=x86_64-softmmu --enable-igvm
ninja -C build
This fails with the following error:
In file included from ../stubs/igvm.c:15:
/root/qemu/include/system/igvm-internal.h:19:10: fatal error:
igvm/igvm.h: No such file or directory
19 | #include <igvm/igvm.h>
| ^~~~~~~~~~~~~
IIUC the problem is that the stubs/igvm.c file uses the igvm header
via the "igvm-internal.h", but the library is not added as a
dependency in the meson config file.
I tried this change to meson, but it doesn't seem to work.
Not sure how to fix this.
Thanks,
Luigi
index 6ae478b..5ac4ae9 100644
--- a/stubs/meson.build
+++ b/stubs/meson.build
@@ -72,7 +72,8 @@ if have_system
stub_ss.add(files('cmos.c'))
stub_ss.add(files('fw_cfg.c'))
if igvm.found()
- stub_ss.add(files('igvm.c'))
+ stub_ss.add(igvm)
+ stub_ss.add(files('igvm.c'), igvm)
endif
stub_ss.add(files('kvm.c'))
stub_ss.add(files('target-get-monitor-def.c'))
diff --git a/target/i386/meson.build b/target/i386/meson.build
index d385eaf..b20e2d6 100644
--- a/target/i386/meson.build
+++ b/target/i386/meson.build
@@ -27,7 +27,8 @@ i386_system_ss.add(files(
i386_system_ss.add(when: 'CONFIG_SEV', if_true: files('sev.c'),
if_false: files('sev-system-stub.c'))
if igvm.found()
- i386_system_ss.add(files('igvm.c'))
+ i386_system_ss.add(igvm)
+ i386_system_ss.add(files('igvm.c'), igvm)
endif
i386_user_ss = ss.source_set()