Linux kernel >= 4.12 have some changes in API. gentoo-sources-4.12.5 is stable now, so virtualbox-modules-5.0.40 can't be build. Seems this is fixed in virtualbox-modules-5.1.26. Reproducible: Always Steps to Reproduce: 1. emerge =sys-kernel/gentoo-sources-4.12.5 2. Build new kernel with genkernel or manualy 3. emerge =app-emulation/virtualbox-modules-5.0.40 Actual Results: emerge should build package Expected Results: emerge fails with vuild error /var/tmp/portage/app-emulation/virtualbox-modules-5.0.40/work/vboxdrv/r0drv/linux/alloc-r0drv-linux.c: In function ‘VBoxHost_RTMemContAlloc’: /var/tmp/portage/app-emulation/virtualbox-modules-5.0.40/work/vboxdrv/r0drv/linux/alloc-r0drv-linux.c:444:13: error: implicit declaration of function ‘set_pages_x’ [-Werror=implicit-function-declaration] MY_SET_PAGES_EXEC(&paPages[iPage], 1); ^ /var/tmp/portage/app-emulation/virtualbox-modules-5.0.40/work/vboxdrv/r0drv/linux/alloc-r0drv-linux.c: In function ‘VBoxHost_RTMemContFree’: /var/tmp/portage/app-emulation/virtualbox-modules-5.0.40/work/vboxdrv/r0drv/linux/alloc-r0drv-linux.c:492:13: error: implicit declaration of function ‘set_pages_nx’ [-Werror=implicit-function-declaration] MY_SET_PAGES_NOEXEC(&paPages[iPage], 1); ^ cc1: some warnings being treated as errors make[4]: *** [/usr/src/linux-4.12.5-gentoo/scripts/Makefile.build:302: /var/tmp/portage/app-emulation/virtualbox-modules-5.0.40/work/vboxdrv/r0drv/linux/alloc-r0drv-linux.o] Error 1 make[4]: *** Waiting for unfinished jobs.... /var/tmp/portage/app-emulation/virtualbox-modules-5.0.40/work/vboxdrv/r0drv/linux/memobj-r0drv-linux.c: In function ‘rtR0MemObjLinuxVirtToPage’: /var/tmp/portage/app-emulation/virtualbox-modules-5.0.40/work/vboxdrv/r0drv/linux/memobj-r0drv-linux.c:921:27: error: passing argument 1 of ‘pud_offset’ from incompatible pointer type [-Werror=incompatible-pointer-types] u.Upper = *pud_offset(&u.Global, ulAddr);
Expected Results: emerge should build package Actual Results: emerge fails with build error
I can confirm it, have same problem, too
Same issue. Fixed appling this patch: https://gist.github.com/herbmillerjr/a48314d18d65a60ee22c40790aaafc0b/revisions
The patch doesn't apply cleanly on 5.0.40... Does someone has a working version ?
Remove fist 3 lines from patch
Created attachment 489244 [details, diff] patch
Created attachment 489282 [details] Failed build
Created attachment 489370 [details, diff] removed_cpp_hack_for_the_new.patch
I can confirm this problem exists. In my case I was building "app-emulation/libvirt-3.3.0" with the following flags: "app-emulation/libvirt-3.3.0 +caps +dbus +elibc_glibc +libssh +libvirtd +lvm +lxc +nls +parted +pcap +qemu +udev +virt-network -apparmor -audit -firewalld -fuse -glusterfs -iscsi -macvtap -nfs -numa -openvz -phyp -policykit -rbd -sasl -selinux -uml -vepa -virtualbox -wireshark-plugins -xen -zeroconf -zfs" The "crash" does occur in the "virtualbox-modules-5.1.26" package due to a fault in the "ebuild" for this package. The "ebuild" is looking for "autoconf.h". In the source for 4.12.5, that file is located at: "/usr/src/linux/include/generated/autoconf.h" The "ebuild" is using the following search logic: less -N /usr/portage/app-emulation/virtualbox-modules/virtualbox-modules-5.0.40.ebuild [and reformatted here to improve readability] 40 src_prepare() { 41 if kernel_is -ge 2 6 33 ; then 42 # evil patch for new kernels - header moved 43 grep -lR linux/autoconf.h * | xargs sed -i -e 's:<linux/autoconf.h>:<generated/autoconf.h>:' 44 fi 45 46 if use pax_kernel && kernel_is -ge 3 0 0 ; then 47 epatch "${FILESDIR}"/${PN}-4.1.4-pax-const.patch 48 fi 49 50 default 51 } I changed line 43 to say this: 43 grep -lR linux/include/generated/autoconf.h * | xargs sed -i -e 's:<linux/autoconf.h>:<generated/autoconf.h>:' Now the original "emerge" request I am making for "app-emulation/libvirt-3.3.0" actually compiles the "virtualbox-modules" package without error and "emerge" announces the new modules in it's "spill" at the end of the compile. I have yet to test the actual "virtualbox" code, but now I am seeing an error in the "app-emulation/virtualbox-5.1.26" package that needs investigation. Yes, I had to use the "emerge --digest" option to turn off digest checking of the "ebuild" file so that I could test my change. That is not a recommended workaround, but it makes things work for testing purposes on a non-production machine.
(In reply to Arnaud Launay from comment #4) > The patch doesn't apply cleanly on 5.0.40... Does someone has a working > version ? My page table patch doesn't work on 5.0.40 because it's for 5.1.22.
Thanks. I applied the two patches enclosed in the bug, I have the pleasure to report that 5.0.40 compiles fine again.
Same here. Virtualbox-modules-5.0.40 fails with 4.12.5 The above two patches fixed the issue for me (i.e. it builds now). Regards, Alex
What do you mean by two patches? Do you mean https://bugs.gentoo.org/show_bug.cgi?id=627822#c6 and https://bugs.gentoo.org/show_bug.cgi?id=627822#c8?
Yes, those two exactly: https://627822.bugs.gentoo.org/attachment.cgi?id=489244 https://627822.bugs.gentoo.org/attachment.cgi?id=489370 From Sergey (thanks !)
I confirm that those two patches fix the issue, and boxes run fine. Thanks a lot.
In my case, those patches cause host hard-lock with linux-4.12.12 when VM OS (Win 10 x64 in my case) is started.
After implementation of these two patches I am getting for all virtual machines: Failed to open a session for the virtual machine xp. The VM session was aborted. Result Code: NS_ERROR_FAILURE (0x80004005) Component: SessionMachine Interface: ISession {7844aa05-b02e-4cdd-a04f-ade4a762e6b7}
Should be fixed with stabilization fo virtualbox-5.1.26
*** Bug 630076 has been marked as a duplicate of this bug. ***