Why make is failing while installing a hypervisor(Jailhouse) in Fedora34

Hi there,
I am new to fedora and trying to install a hypervisor named jailhouse in my Fedora 34 system. Wh does the "make " fail in Fedora as it is readily getting installed in Ubuntu. This is the error I am getting:

[prashant@fedora jailhouse]$ make
  UPD     /home/prashant/jailhouse/hypervisor/include/generated/config.mk
  UPD     /home/prashant/jailhouse/hypervisor/include/generated/version.h
  CC [M]  /home/prashant/jailhouse/driver/cell.o
  CC [M]  /home/prashant/jailhouse/driver/main.o
  CC [M]  /home/prashant/jailhouse/driver/sysfs.o
  CC [M]  /home/prashant/jailhouse/driver/pci.o
  LD [M]  /home/prashant/jailhouse/driver/jailhouse.o
  CC      /home/prashant/jailhouse/configs/x86/apic-demo.o
  OBJCOPY /home/prashant/jailhouse/configs/x86/apic-demo.cell
  CC      /home/prashant/jailhouse/configs/x86/e1000-demo.o
  OBJCOPY /home/prashant/jailhouse/configs/x86/e1000-demo.cell
  CC      /home/prashant/jailhouse/configs/x86/f2a88xm-hd3.o
  OBJCOPY /home/prashant/jailhouse/configs/x86/f2a88xm-hd3.cell
  CC      /home/prashant/jailhouse/configs/x86/imb-a180.o
  OBJCOPY /home/prashant/jailhouse/configs/x86/imb-a180.cell
  CC      /home/prashant/jailhouse/configs/x86/ioapic-demo.o
  OBJCOPY /home/prashant/jailhouse/configs/x86/ioapic-demo.cell
  CC      /home/prashant/jailhouse/configs/x86/ivshmem-demo.o
  OBJCOPY /home/prashant/jailhouse/configs/x86/ivshmem-demo.cell
  CC      /home/prashant/jailhouse/configs/x86/linux-x86-demo.o
  OBJCOPY /home/prashant/jailhouse/configs/x86/linux-x86-demo.cell
  CC      /home/prashant/jailhouse/configs/x86/pci-demo.o
  OBJCOPY /home/prashant/jailhouse/configs/x86/pci-demo.cell
  CC      /home/prashant/jailhouse/configs/x86/qemu-x86.o
  OBJCOPY /home/prashant/jailhouse/configs/x86/qemu-x86.cell
  CC      /home/prashant/jailhouse/configs/x86/smp-demo.o
  OBJCOPY /home/prashant/jailhouse/configs/x86/smp-demo.cell
  CC      /home/prashant/jailhouse/configs/x86/tiny-demo.o
  OBJCOPY /home/prashant/jailhouse/configs/x86/tiny-demo.cell
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/asm-defines.s
  GEN     /home/prashant/jailhouse/hypervisor/arch/x86/include/generated/asm/asm-defines.h
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/svm.o
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/amd_iommu.o
  AS      /home/prashant/jailhouse/hypervisor/arch/x86/svm-vmexit.o
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/apic.o
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/dbg-write.o
  AS      /home/prashant/jailhouse/hypervisor/arch/x86/entry.o
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/setup.o
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/control.o
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/mmio.o
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/iommu.o
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/paging.o
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/pci.o
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/i8042.o
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/vcpu.o
/home/prashant/jailhouse/hypervisor/arch/x86/vcpu.c: In function ‘vcpu_reset’:
/home/prashant/jailhouse/hypervisor/arch/x86/vcpu.c:429:9: error: ‘memset’ offset [0, 127] is out of the bounds [0, 0] [-Werror=array-bounds]
  429 |         memset(&cpu_data->guest_regs, 0, sizeof(cpu_data->guest_regs));
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[4]: *** [scripts/Makefile.build:279: /home/prashant/jailhouse/hypervisor/arch/x86/vcpu.o] Error 1
make[3]: *** [scripts/Makefile.build:496: /home/prashant/jailhouse/hypervisor/arch/x86] Error 2
make[2]: *** [scripts/Makefile.build:496: /home/prashant/jailhouse/hypervisor] Error 2
make[1]: *** [Makefile:1810: /home/prashant/jailhouse] Error 2
make: *** [Makefile:40: modules] Error 2
[prashant@fedora jailhouse]$ 

I have already installed the kernel-headers yet I am getting this result. Do I have to make any updates? Any suggestion will be much appreciated. Thank you

1 Like

It’s a compilation error. Take a look here: Warning Options (Using the GNU Compiler Collection (GCC)) for what array-bounds implies.

Can you tell us what compilation flags you are using? It should be a warning but you’ve got some flags enabled that convert warnings to errors (-Werror etc.)

Hello Ankur,
Thank you so much for your reply. I checked the Makefile and the Werror flag was enabled, disabling the flag solved the issue but I have further run into some issues,

[prashant@fedora jailhouse]$ make
make -C /lib/modules/`uname -r`/build M=$PWD modules
  CC [M]  /home/prashant/jailhouse/driver/cell.o
  CC [M]  /home/prashant/jailhouse/driver/main.o
  CC [M]  /home/prashant/jailhouse/driver/sysfs.o
  CC [M]  /home/prashant/jailhouse/driver/pci.o
  LD [M]  /home/prashant/jailhouse/driver/jailhouse.o
  CC      /home/prashant/jailhouse/configs/x86/apic-demo.o
  OBJCOPY /home/prashant/jailhouse/configs/x86/apic-demo.cell
  CC      /home/prashant/jailhouse/configs/x86/e1000-demo.o
  OBJCOPY /home/prashant/jailhouse/configs/x86/e1000-demo.cell
  CC      /home/prashant/jailhouse/configs/x86/f2a88xm-hd3.o
  OBJCOPY /home/prashant/jailhouse/configs/x86/f2a88xm-hd3.cell
  CC      /home/prashant/jailhouse/configs/x86/imb-a180.o
  OBJCOPY /home/prashant/jailhouse/configs/x86/imb-a180.cell
  CC      /home/prashant/jailhouse/configs/x86/ioapic-demo.o
  OBJCOPY /home/prashant/jailhouse/configs/x86/ioapic-demo.cell
  CC      /home/prashant/jailhouse/configs/x86/ivshmem-demo.o
  OBJCOPY /home/prashant/jailhouse/configs/x86/ivshmem-demo.cell
  CC      /home/prashant/jailhouse/configs/x86/linux-x86-demo.o
  OBJCOPY /home/prashant/jailhouse/configs/x86/linux-x86-demo.cell
  CC      /home/prashant/jailhouse/configs/x86/pci-demo.o
  OBJCOPY /home/prashant/jailhouse/configs/x86/pci-demo.cell
  CC      /home/prashant/jailhouse/configs/x86/qemu-x86.o
  OBJCOPY /home/prashant/jailhouse/configs/x86/qemu-x86.cell
  CC      /home/prashant/jailhouse/configs/x86/smp-demo.o
  OBJCOPY /home/prashant/jailhouse/configs/x86/smp-demo.cell
  CC      /home/prashant/jailhouse/configs/x86/tiny-demo.o
  OBJCOPY /home/prashant/jailhouse/configs/x86/tiny-demo.cell
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/asm-defines.s
  GEN     /home/prashant/jailhouse/hypervisor/arch/x86/include/generated/asm/asm-defines.h
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/svm.o
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/amd_iommu.o
  AS      /home/prashant/jailhouse/hypervisor/arch/x86/svm-vmexit.o
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/apic.o
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/dbg-write.o
  AS      /home/prashant/jailhouse/hypervisor/arch/x86/entry.o
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/setup.o
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/control.o
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/mmio.o
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/iommu.o
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/paging.o
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/pci.o
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/i8042.o
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/vcpu.o
/home/prashant/jailhouse/hypervisor/arch/x86/vcpu.c: In function ‘vcpu_reset’:
/home/prashant/jailhouse/hypervisor/arch/x86/vcpu.c:429:9: warning: ‘memset’ offset [0, 127] is out of the bounds [0, 0] [-Warray-bounds]
  429 |         memset(&cpu_data->guest_regs, 0, sizeof(cpu_data->guest_regs));
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/efifb.o
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/ivshmem.o
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/ioapic.o
  AR      /home/prashant/jailhouse/hypervisor/arch/x86/lib-amd.a
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/vmx.o
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/vtd.o
  AS      /home/prashant/jailhouse/hypervisor/arch/x86/vmx-vmexit.o
  CC      /home/prashant/jailhouse/hypervisor/arch/x86/cat.o
  AR      /home/prashant/jailhouse/hypervisor/arch/x86/lib-intel.a
  LDS     /home/prashant/jailhouse/hypervisor/hypervisor.lds
  CC      /home/prashant/jailhouse/hypervisor/setup.o
  CC      /home/prashant/jailhouse/hypervisor/printk.o
  CC      /home/prashant/jailhouse/hypervisor/paging.o
  CC      /home/prashant/jailhouse/hypervisor/control.o
  CC      /home/prashant/jailhouse/hypervisor/lib.o
  CC      /home/prashant/jailhouse/hypervisor/mmio.o
  CC      /home/prashant/jailhouse/hypervisor/pci.o
  CC      /home/prashant/jailhouse/hypervisor/ivshmem.o
  CC      /home/prashant/jailhouse/hypervisor/uart.o
  CC      /home/prashant/jailhouse/hypervisor/uart-8250.o
  LD      /home/prashant/jailhouse/hypervisor/hypervisor-amd.o
  OBJCOPY /home/prashant/jailhouse/hypervisor/jailhouse-amd.bin
  LD      /home/prashant/jailhouse/hypervisor/hypervisor-intel.o
  OBJCOPY /home/prashant/jailhouse/hypervisor/jailhouse-intel.bin
  CC      /home/prashant/jailhouse/inmates/lib/x86/../alloc.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/../cmdline.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/../pci.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/../printk.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/../setup.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/../string.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/../test.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/../uart-8250.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/cpu-features.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/excp.o
  AS      /home/prashant/jailhouse/inmates/lib/x86/header-64.o
  AS      /home/prashant/jailhouse/inmates/lib/x86/header-common.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/ioapic.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/irq.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/mem.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/pci.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/printk.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/setup.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/smp.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/timing.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/uart.o
  AR      /home/prashant/jailhouse/inmates/lib/x86/lib.a
  CC      /home/prashant/jailhouse/inmates/lib/x86/cpu-features-32.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/excp-32.o
  AS      /home/prashant/jailhouse/inmates/lib/x86/header-common-32.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/irq-32.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/ioapic-32.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/printk-32.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/setup-32.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/uart-32.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/../alloc-32.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/../pci-32.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/../string-32.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/../cmdline-32.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/../setup-32.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/../test-32.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/../uart-8250-32.o
  CC      /home/prashant/jailhouse/inmates/lib/x86/../printk-32.o
  AS      /home/prashant/jailhouse/inmates/lib/x86/header-32.o
  AR      /home/prashant/jailhouse/inmates/lib/x86/lib32.a
  CC      /home/prashant/jailhouse/inmates/demos/x86/tiny-demo.o
  LD      /home/prashant/jailhouse/inmates/demos/x86/tiny-demo-linked.o
  OBJCOPY /home/prashant/jailhouse/inmates/demos/x86/tiny-demo.bin
  CC      /home/prashant/jailhouse/inmates/demos/x86/apic-demo.o
  LD      /home/prashant/jailhouse/inmates/demos/x86/apic-demo-linked.o
  OBJCOPY /home/prashant/jailhouse/inmates/demos/x86/apic-demo.bin
  CC      /home/prashant/jailhouse/inmates/demos/x86/ioapic-demo.o
  LD      /home/prashant/jailhouse/inmates/demos/x86/ioapic-demo-linked.o
  OBJCOPY /home/prashant/jailhouse/inmates/demos/x86/ioapic-demo.bin
  CC      /home/prashant/jailhouse/inmates/demos/x86/32-bit-demo.o
  LD      /home/prashant/jailhouse/inmates/demos/x86/32-bit-demo-linked.o
  OBJCOPY /home/prashant/jailhouse/inmates/demos/x86/32-bit-demo.bin
  CC      /home/prashant/jailhouse/inmates/demos/x86/pci-demo.o
  LD      /home/prashant/jailhouse/inmates/demos/x86/pci-demo-linked.o
  OBJCOPY /home/prashant/jailhouse/inmates/demos/x86/pci-demo.bin
  CC      /home/prashant/jailhouse/inmates/demos/x86/e1000-demo.o
  LD      /home/prashant/jailhouse/inmates/demos/x86/e1000-demo-linked.o
  OBJCOPY /home/prashant/jailhouse/inmates/demos/x86/e1000-demo.bin
  CC      /home/prashant/jailhouse/inmates/demos/x86/../ivshmem-demo.o
  LD      /home/prashant/jailhouse/inmates/demos/x86/ivshmem-demo-linked.o
  OBJCOPY /home/prashant/jailhouse/inmates/demos/x86/ivshmem-demo.bin
  CC      /home/prashant/jailhouse/inmates/demos/x86/smp-demo.o
  LD      /home/prashant/jailhouse/inmates/demos/x86/smp-demo-linked.o
  OBJCOPY /home/prashant/jailhouse/inmates/demos/x86/smp-demo.bin
  CC      /home/prashant/jailhouse/inmates/demos/x86/cache-timings.o
  LD      /home/prashant/jailhouse/inmates/demos/x86/cache-timings-linked.o
  OBJCOPY /home/prashant/jailhouse/inmates/demos/x86/cache-timings.bin
  CC      /home/prashant/jailhouse/inmates/tests/x86/mmio-access.o
  LD      /home/prashant/jailhouse/inmates/tests/x86/mmio-access-linked.o
  OBJCOPY /home/prashant/jailhouse/inmates/tests/x86/mmio-access.bin
  CC      /home/prashant/jailhouse/inmates/tests/x86/mmio-access-32.o
  LD      /home/prashant/jailhouse/inmates/tests/x86/mmio-access-32-linked.o
  OBJCOPY /home/prashant/jailhouse/inmates/tests/x86/mmio-access-32.bin
  CC      /home/prashant/jailhouse/inmates/tests/x86/sse-demo.o
  LD      /home/prashant/jailhouse/inmates/tests/x86/sse-demo-linked.o
  OBJCOPY /home/prashant/jailhouse/inmates/tests/x86/sse-demo.bin
  CC      /home/prashant/jailhouse/inmates/tests/x86/sse-demo-32.o
  LD      /home/prashant/jailhouse/inmates/tests/x86/sse-demo-32-linked.o
  OBJCOPY /home/prashant/jailhouse/inmates/tests/x86/sse-demo-32.bin
  CC      /home/prashant/jailhouse/inmates/tools/x86/linux-loader.o
  LD      /home/prashant/jailhouse/inmates/tools/x86/linux-loader-linked.o
  OBJCOPY /home/prashant/jailhouse/inmates/tools/x86/linux-loader.bin
  GEN     /home/prashant/jailhouse/pyjailhouse/pci_defs.py
  CC      /home/prashant/jailhouse/tools/jailhouse.o
  LD      /home/prashant/jailhouse/tools/jailhouse
  CC      /home/prashant/jailhouse/tools/demos/ivshmem-demo.o
  LD      /home/prashant/jailhouse/tools/demos/ivshmem-demo
  CC      /home/prashant/jailhouse/tools/demos/cache-timings.o
  LD      /home/prashant/jailhouse/tools/demos/cache-timings
  GEN     /home/prashant/jailhouse/tools/jailhouse-config-collect
  CC      /home/prashant/jailhouse/tools/jailhouse-gcov-extract.o
  LD      /home/prashant/jailhouse/tools/jailhouse-gcov-extract
  GEN     /home/prashant/jailhouse/tools/jailhouse.8
  GEN     /home/prashant/jailhouse/tools/jailhouse-cell.8
  GEN     /home/prashant/jailhouse/tools/jailhouse-enable.8
  MODPOST /home/prashant/jailhouse/Module.symvers
ERROR: modpost: "lapic_timer_period" [/home/prashant/jailhouse/driver/jailhouse.ko] undefined!
ERROR: modpost: "__get_vm_area_caller" [/home/prashant/jailhouse/driver/jailhouse.ko] undefined!
ERROR: modpost: "ioremap_page_range" [/home/prashant/jailhouse/driver/jailhouse.ko] undefined!
make[2]: *** [scripts/Makefile.modpost:111: /home/prashant/jailhouse/Module.symvers] Error 1
make[2]: *** Deleting file '/home/prashant/jailhouse/Module.symvers'
make[1]: *** [Makefile:1714: modules] Error 2
make: *** [Makefile:40: modules] Error 2
[prashant@fedora jailhouse]$ uname -r
5.11.12-300.fc34.x86_64
[prashant@fedora jailhouse]$ 

Could you see this one? Do I need to apply some specific pathces or ?

1 Like

it can’t find the module, but I don’t know enough about “jailhouse” to say what is causing it and how to fix it. This seems quite specific, so perhaps the user forums for jailhouse would be your best bet?