intel / gvt-linux

Other
503 stars 94 forks source link

Qemu build error #206

Open Edyhard opened 2 years ago

Edyhard commented 2 years ago

Hello, I trying build qemu based on this guide: https://github.com/intel/gvt-linux/wiki/GVTd_Setup_Guide. I followed the steps but I got stuck at 3.3.1 "make -j8" command. This command returns this error:

changing dir to build for make ""... make[1]: Entering directory '/qemu-git/qemu/build' GIT ui/keycodemapdb meson tests/fp/berkeley-testfloat-3 tests/fp/berkeley-softfloat-3 dtc capstone slirp [1/1037] Generating ar with a custom command [2/1037] Generating bepo with a custom command [3/1037] Generating cz with a custom command [4/1037] Generating da with a custom command [5/1037] Generating de with a custom command [6/1037] Generating de-ch with a custom command [7/1037] Generating en-gb with a custom command [8/1037] Generating en-us with a custom command [9/1037] Generating es with a custom command [10/1037] Generating et with a custom command [11/1037] Generating fi with a custom command [12/1037] Generating fo with a custom command [13/1037] Generating fr-be with a custom command [14/1037] Generating fr with a custom command [15/1037] Generating fr-ca with a custom command [16/1037] Generating fr-ch with a custom command [17/1037] Generating hr with a custom command [18/1037] Generating hu with a custom command [19/1037] Generating is with a custom command [20/1037] Generating it with a custom command [21/1037] Generating ja with a custom command [22/1037] Generating lt with a custom command [23/1037] Generating mk with a custom command [24/1037] Generating lv with a custom command [25/1037] Generating nl with a custom command [26/1037] Generating no with a custom command [27/1037] Generating pt with a custom command [28/1037] Generating pl with a custom command [29/1037] Generating ru with a custom command [30/1037] Generating pt-br with a custom command [31/1037] Generating th with a custom command [32/1037] Generating tr with a custom command [33/1037] Compiling C object tests/fp/libtestfloat.a.p/berkeley-testfloat-3_source_genCases_i64.c.o [34/1037] Compiling C object tests/fp/libtestfloat.a.p/berkeley-testfloat-3_source_genCases_common.c.o [35/1037] Compiling C object tests/fp/libtestfloat.a.p/berkeley-testfloat-3_source_genCases_ui32.c.o [36/1037] Compiling C object tests/fp/libtestfloat.a.p/berkeley-testfloat-3_source_random.c.o [37/1037] Generating Test QAPI files with a custom command [38/1037] Generating QAPI test (include) with a custom command [39/1037] Compiling C object tests/fp/libtestfloat.a.p/berkeley-testfloat-3_source_uint128.c.o [40/1037] Compiling C object tests/fp/libtestfloat.a.p/berkeley-testfloat-3_source_functions_common.c.o [41/1037] Compiling C object tests/fp/libtestfloat.a.p/berkeley-testfloat-3_source_genCases_extF80.c.o [42/1037] Compiling C object tests/fp/libtestfloat.a.p/berkeley-testfloat-3_source_functionInfos.c.o [43/1037] Compiling C object tests/fp/libtestfloat.a.p/berkeley-testfloat-3_source_genCases_ui64.c.o [44/1037] Compiling C object tests/fp/libtestfloat.a.p/berkeley-testfloat-3_source_genCases_f16.c.o [45/1037] Compiling C object tests/fp/libtestfloat.a.p/berkeley-testfloat-3_source_genCases_i32.c.o [46/1037] Generating edk2-i386-vars.fd with a custom command (wrapped by meson to capture output) [47/1037] Compiling C object tests/fp/libtestfloat.a.p/berkeley-testfloat-3_source_uint128_inline.c.o [48/1037] Compiling C object tests/fp/libtestfloat.a.p/berkeley-testfloat-3_source_standardFunctionInfos.c.o [49/1037] Compiling C object tests/fp/libtestfloat.a.p/berkeley-testfloat-3_source_fail.c.o [50/1037] Generating qemu-version.h with a custom command (wrapped by meson to capture output) [51/1034] Compiling C object tests/fp/libtestfloat.a.p/berkeley-testfloat-3_source_genCases_f32.c.o [52/1034] Compiling C object tests/fp/libsoftfloat.a.p/berkeley-softfloat-3_source_s_eq128.c.o [53/1034] Compiling C object tests/fp/libtestfloat.a.p/berkeley-testfloat-3_source_genCases_writeTestsTotal.c.o [54/1034] Compiling C object tests/fp/libtestfloat.a.p/berkeley-testfloat-3_source_genCases_f64.c.o [55/1034] Generating edk2-x86_64-code.fd with a custom command (wrapped by meson to capture output) [56/1034] Compiling C object tests/fp/libtestfloat.a.p/berkeley-testfloat-3_source_genCases_f128.c.o [57/1034] Generating edk2-x86_64-secure-code.fd with a custom command (wrapped by meson to capture output) [58/1034] Compiling C object libqemu-x86_64-softmmu.fa.p/hw_virtio_vhost-iova-tree.c.o [59/1034] Compiling C object libqemu-x86_64-softmmu.fa.p/hw_virtio_vhost-shadow-virtqueue.c.o [60/1034] Compiling C object libqemu-x86_64-softmmu.fa.p/hw_vfio_pci-quirks.c.o FAILED: libqemu-x86_64-softmmu.fa.p/hw_vfio_pci-quirks.c.o cc -m64 -mcx16 -Ilibqemu-x86_64-softmmu.fa.p -I. -I.. -Itarget/i386 -I../target/i386 -I../capstone/include/capstone -Iqapi -Itrace -Iui -Iui/shader -I/usr/include/pixman-1 -I/usr/include/spice-server -I/usr/include/spice-1 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -fdiagnostics-color=auto -Wall -Winvalid-pch -Werror -std=gnu11 -O2 -g -isystem /qemu-git/qemu/linux-headers -isystem linux-headers -iquote . -iquote /qemu-git/qemu -iquote /qemu-git/qemu/include -iquote /qemu-git/qemu/disas/libvixl -iquote /qemu-git/qemu/tcg/i386 -pthread -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-declaration -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wimplicit-fallthrough=2 -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-psabi -fstack-protector-strong -fPIE -isystem../linux-headers -isystemlinux-headers -DNEED_CPU_H '-DCONFIG_TARGET="x86_64-softmmu-config-target.h"' '-DCONFIG_DEVICES="x86_64-softmmu-config-devices.h"' -MD -MQ libqemu-x86_64-softmmu.fa.p/hw_vfio_pci-quirks.c.o -MF libqemu-x86_64-softmmu.fa.p/hw_vfio_pci-quirks.c.o.d -o libqemu-x86_64-softmmu.fa.p/hw_vfio_pci-quirks.c.o -c ../hw/vfio/pci-quirks.c ../hw/vfio/pci-quirks.c: In function ‘vfio_igd_gtt_max’: ../hw/vfio/pci-quirks.c:1356:55: error: ‘IGD_GMCH’ undeclared (first use in this function) 1356 | uint32_t gmch = vfio_pci_read_config(&vdev->pdev, IGD_GMCH, sizeof(gmch)); | ^~~~ ../hw/vfio/pci-quirks.c:1356:55: note: each undeclared identifier is reported only once for each function it appears in ../hw/vfio/pci-quirks.c:1357:21: error: implicit declaration of function ‘igd_gen’ [-Werror=implicit-function-declaration] 1357 | int ggms, gen = igd_gen(vdev); | ^~~ ../hw/vfio/pci-quirks.c:1357:21: error: nested extern declaration of ‘igd_gen’ [-Werror=nested-externs] ../hw/vfio/pci-quirks.c: In function ‘vfio_igd_quirk_data_read’: ../hw/vfio/pci-quirks.c:1384:5: error: unknown type name ‘VFIOIGDQuirk’; did you mean ‘VFIOQuirk’? 1384 | VFIOIGDQuirk igd = opaque; | ^~~~ | VFIOQuirk ../hw/vfio/pci-quirks.c:1385:30: error: request for member ‘vdev’ in something not a structure or union 1385 | VFIOPCIDevice vdev = igd->vdev; | ^~ ../hw/vfio/pci-quirks.c:1387:8: error: request for member ‘index’ in something not a structure or union 1387 | igd->index = ~0; | ^~ ../hw/vfio/pci-quirks.c: In function ‘vfio_igd_quirk_data_write’: ../hw/vfio/pci-quirks.c:1395:5: error: unknown type name ‘VFIOIGDQuirk’; did you mean ‘VFIOQuirk’? 1395 | VFIOIGDQuirk igd = opaque; | ^~~~ | VFIOQuirk ../hw/vfio/pci-quirks.c:1396:30: error: request for member ‘vdev’ in something not a structure or union 1396 | VFIOPCIDevice vdev = igd->vdev; | ^~ ../hw/vfio/pci-quirks.c:1414:13: error: request for member ‘index’ in something not a structure or union 1414 | if ((igd->index % 4 == 1) && igd->index < vfio_igd_gtt_max(vdev)) { | ^~ ../hw/vfio/pci-quirks.c:1414:37: error: request for member ‘index’ in something not a structure or union 1414 | if ((igd->index % 4 == 1) && igd->index < vfio_igd_gtt_max(vdev)) { | ^~ ../hw/vfio/pci-quirks.c:1415:28: error: request for member ‘index’ in something not a structure or union 1415 | if (gen < 8 || (igd->index % 8 == 1)) { | ^~ ../hw/vfio/pci-quirks.c:1418:53: error: ‘IGD_BDSM’ undeclared (first use in this function) 1418 | base = pci_get_long(vdev->pdev.config + IGD_BDSM); | ^~~~ ../hw/vfio/pci-quirks.c:1420:17: error: implicit declaration of function ‘hw_error’; did you mean ‘herror’? [-Werror=implicit-function-declaration] 1420 | hw_error("vfio-igd: Guest attempted to program IGD GTT before " | ^~~~ | herror ../hw/vfio/pci-quirks.c:1420:17: error: nested extern declaration of ‘hw_error’ [-Werror=nested-externs] ../hw/vfio/pci-quirks.c:1424:29: error: request for member ‘bdsm’ in something not a structure or union 1424 | val = data - igd->bdsm + base; | ^~ ../hw/vfio/pci-quirks.c:1430:42: error: request for member ‘index’ in something not a structure or union 1430 | igd->index, data, val); | ^~ ../hw/vfio/pci-quirks.c:1435:8: error: request for member ‘index’ in something not a structure or union 1435 | igd->index = ~0; | ^~ ../hw/vfio/pci-quirks.c: In function ‘vfio_igd_quirk_index_read’: ../hw/vfio/pci-quirks.c:1447:5: error: unknown type name ‘VFIOIGDQuirk’; did you mean ‘VFIOQuirk’? 1447 | VFIOIGDQuirk igd = opaque; | ^~~~ | VFIOQuirk ../hw/vfio/pci-quirks.c:1448:30: error: request for member ‘vdev’ in something not a structure or union 1448 | VFIOPCIDevice vdev = igd->vdev; | ^~ ../hw/vfio/pci-quirks.c:1450:8: error: request for member ‘index’ in something not a structure or union 1450 | igd->index = ~0; | ^~ ../hw/vfio/pci-quirks.c: In function ‘vfio_igd_quirk_index_write’: ../hw/vfio/pci-quirks.c:1458:5: error: unknown type name ‘VFIOIGDQuirk’; did you mean ‘VFIOQuirk’? 1458 | VFIOIGDQuirk igd = opaque; | ^~~~ | VFIOQuirk ../hw/vfio/pci-quirks.c:1459:30: error: request for member ‘vdev’ in something not a structure or union 1459 | VFIOPCIDevice vdev = igd->vdev; | ^~ ../hw/vfio/pci-quirks.c:1461:8: error: request for member ‘index’ in something not a structure or union 1461 | igd->index = data; | ^~ ../hw/vfio/pci-quirks.c: At top level: ../hw/vfio/pci-quirks.c:1472:13: error: static declaration of ‘vfio_probe_igd_bar4_quirk’ follows non-static declaration 1472 | static void vfio_probe_igd_bar4_quirk(VFIOPCIDevice vdev, int nr) | ^~~~~~~~~ In file included from ../hw/vfio/pci-quirks.c:27: ../hw/vfio/pci.h:211:6: note: previous declaration of ‘vfio_probe_igd_bar4_quirk’ was here 211 | void vfio_probe_igd_bar4_quirk(VFIOPCIDevice vdev, int nr); | ^~~~~~~~~ ../hw/vfio/pci-quirks.c: In function ‘vfio_probe_igd_bar4_quirk’: ../hw/vfio/pci-quirks.c:1477:5: error: unknown type name ‘VFIOIGDQuirk’; did you mean ‘VFIOQuirk’? 1477 | VFIOIGDQuirk igd; | ^~~~ | VFIOQuirk ../hw/vfio/pci-quirks.c:1511:46: error: ‘IGD_GMCH’ undeclared (first use in this function) 1511 | gmch = vfio_pci_read_config(&vdev->pdev, IGD_GMCH, 4); | ^~~~ ../hw/vfio/pci-quirks.c:1603:32: error: ‘ERR_PREFIX’ undeclared (first use in this function) 1603 | error_reportf_err(err, ERR_PREFIX, vdev->vbasedev.name); | ^~~~~~ ../hw/vfio/pci-quirks.c:1638:8: error: request for member ‘vdev’ in something not a structure or union 1638 | igd->vdev = vdev; | ^~ ../hw/vfio/pci-quirks.c:1639:8: error: request for member ‘index’ in something not a structure or union 1639 | igd->index = ~0; | ^~ ../hw/vfio/pci-quirks.c:1640:8: error: request for member ‘bdsm’ in something not a structure or union 1640 | igd->bdsm = vfio_pci_read_config(&vdev->pdev, IGD_BDSM, 4); | ^~ ../hw/vfio/pci-quirks.c:1640:51: error: ‘IGD_BDSM’ undeclared (first use in this function) 1640 | igd->bdsm = vfio_pci_read_config(&vdev->pdev, IGD_BDSM, 4); | ^~~~ ../hw/vfio/pci-quirks.c:1641:8: error: request for member ‘bdsm’ in something not a structure or union 1641 | igd->bdsm &= ~((1 << 20) - 1); / 1MB aligned */ | ^~ cc1: all warnings being treated as errors [61/1034] Compiling C object libqemu-x86_64-softmmu.fa.p/hw_virtio_virtio-crypto-pci.c.o [62/1034] Compiling C object libqemu-x86_64-softmmu.fa.p/hw_virtio_virtio-crypto.c.o [63/1034] Compiling C object libqemu-x86_64-softmmu.fa.p/hw_virtio_vhost-user-fs.c.o [64/1034] Compiling C object libqemu-x86_64-softmmu.fa.p/hw_virtio_vhost-user-fs-pci.c.o [65/1034] Compiling C object libqemu-x86_64-softmmu.fa.p/hw_virtio_vhost-vdpa.c.o [66/1034] Compiling C object libqemu-x86_64-softmmu.fa.p/hw_virtio_virtio-balloon.c.o [67/1034] Compiling C object libqemu-x86_64-softmmu.fa.p/hw_virtio_vhost-user.c.o ninja: build stopped: subcommand failed. make[1]: [Makefile:163: run-ninja] Error 1 make[1]: Leaving directory '/qemu-git/qemu/build' make: [GNUmakefile:11: all] Error 2

Host: ubuntu server : Linux 5.4.0-105-generic #119-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux CPU: i5-9400 iGPU: Intel UHD Graphics 630

rahulc07 commented 2 years ago

You don't have to do this anymore, just install qemu from your package repo or just compile the latest qemu WITHOUT the patch. I think the patch or a similar version was merged already