Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 448332

Summary: app-emulation/virtualbox-modules-4.1.22 compilation fails with sys-kernel/gentoo-sources-3.6.11
Product: Gentoo Linux Reporter: Asaf Gery <asaf.gery>
Component: Current packagesAssignee: Lars Wendler (Polynomial-C) (RETIRED) <polynomial-c>
Status: RESOLVED DUPLICATE    
Severity: normal CC: patrick, swapon
Priority: Normal    
Version: 10.1   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: This patch adds the needed include of <linux/err.h> in vboxpci/VBoxPciInternal.h
This is the ebuild that applies the patch

Description Asaf Gery 2012-12-23 21:38:38 UTC
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
Comment 1 Asaf Gery 2012-12-23 21:41:13 UTC
Created attachment 333162 [details, diff]
This patch adds the needed include of <linux/err.h> in vboxpci/VBoxPciInternal.h
Comment 2 Asaf Gery 2012-12-23 21:41:43 UTC
Created attachment 333164 [details]
This is the ebuild that applies the patch
Comment 3 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2012-12-23 22:01:49 UTC
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.
Comment 4 Asaf Gery 2012-12-23 22:38:29 UTC
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 ***