After upgrading my kernel to gentoo-sources-3.6.11, remerging virtualbox-modules-4.1.22 fails with compilation error: In file included from /var/tmp/portage/app-emulation/virtualbox-modules-4.1.22/work/vboxpci/VBoxPciInternal.h:34:0, from /var/tmp/portage/app-emulation/virtualbox-modules-4.1.22/work/vboxpci/VBoxPci.c:38: include/linux/iommu.h: In function ‘iommu_group_alloc’: include/linux/iommu.h:272:2: error: implicit declaration of function ‘ERR_PTR’ This error is due to a change in the kernel headers between kernel versions 3.5.7 and 3.6.11. The fix is quite simple VBoxPciInternal.h should also include <linux/err.h> in case the kernel is equal or greater 3.6.11 (assuming that it was not changed again in higher kernel versions). I attached a patch and ebuild that fix this problem. Reproducible: Always Steps to Reproduce: 1. emerge sys-kernel/gentoo-sources-3.6.11 2. update /usr/src/linux to point to that kernel 3.(try to) emerge app-emulation/virtualbox-modules-4.1.22 Actual Results: Compilation of vboxpci module fails, as a result emerge fails Expected Results: app-emulation/virtualbox-modules-4.1.22 should be installed successfully
Created attachment 333162 [details, diff] This patch adds the needed include of <linux/err.h> in vboxpci/VBoxPciInternal.h
Created attachment 333164 [details] This is the ebuild that applies the patch
I suppose this problem doesn't appear with virtualbox-4.1.24 (currently in unstable branch). If yes please mark this bug as a duplicate of bug #447892.
Sorry, it seems that this bug was already reported and a patch was already suggested. There are minor differences between #433796's patch and my patch - in my patch I included the missing <linux/err.h> header file conditionally and in the ebuild I applied the patch conditionally, in #433796 the include is unconditional. I don't know whether it makes any change at all. Another difference is that the patch of #433796 also adds include of <linux/notifier.h> to vboxpci/VBoxPci.c, which I didn't add, so I am wondering whether that include is really needed. I tested only on amd64, maybe x86 requires the other include? *** This bug has been marked as a duplicate of bug 433796 ***