[vbox-dev] Build errors for vboxpci module om kernel 3.6-rc1

Larry Finger Larry.Finger at lwfinger.net
Fri Aug 3 08:53:49 PDT 2012


Kernel 3.6-rc1 has been released. Building the VirtualBox modules against this 
version results in the following errors:

   CC [M]  /usr/share/virtualbox/src/vboxhost/vboxpci/VBoxPci.o
In file included from 
/usr/share/virtualbox/src/vboxhost/vboxpci/VBoxPciInternal.h:34:0,
                  from /usr/share/virtualbox/src/vboxhost/vboxpci/VBoxPci.c:38:
include/linux/iommu.h: In function ‘iommu_group_alloc’:
include/linux/iommu.h:268:2: error: implicit declaration of function ‘ERR_PTR’ 
[-Werror=implicit-function-declaration]
include/linux/iommu.h:268:2: warning: return makes pointer from integer without 
a cast [enabled by default]
include/linux/iommu.h: At top level:
include/linux/iommu.h:311:14: warning: ‘struct notifier_block’ declared inside 
parameter list [enabled by default]
include/linux/iommu.h:311:14: warning: its scope is only this definition or 
declaration, which is probably not what you want [enabled by default]
include/linux/iommu.h:317:16: warning: ‘struct notifier_block’ declared inside 
parameter list [enabled by default]
cc1: some warnings being treated as errors
make[3]: *** [/usr/share/virtualbox/src/vboxhost/vboxpci/VBoxPci.o] Error 1

These two errors are fixed by the following patch file:

Index: vboxhost/vboxpci/VBoxPciInternal.h
===================================================================
--- vboxhost.orig/vboxpci/VBoxPciInternal.h
+++ vboxhost/vboxpci/VBoxPciInternal.h
@@ -22,6 +22,7 @@
  #include <VBox/rawpci.h>
  #include <iprt/semaphore.h>
  #include <iprt/assert.h>
+#include <linux/err.h>

  #ifdef RT_OS_LINUX

@@ -31,6 +32,7 @@

  #ifdef VBOX_WITH_IOMMU
  #include <linux/errno.h>
+#include <linux/notifier.h>
  #include <linux/iommu.h>
  #endif

After fixing these problems, we now get the following errors:

   LD [M]  /usr/share/virtualbox/src/vboxhost/vboxpci/vboxpci.o
/usr/share/virtualbox/src/vboxhost/vboxpci/VBoxPci.o: In function 
`iommu_attach_group':
/home/finger/wireless-testing-new/include/linux/iommu.h:258: multiple definition 
of `iommu_attach_group'
/usr/share/virtualbox/src/vboxhost/vboxpci/linux/VBoxPci-linux.o:/home/finger/wireless-testing-new/include/linux/iommu.h:258: 
first defined here
/usr/share/virtualbox/src/vboxhost/vboxpci/VBoxPci.o: In function 
`iommu_detach_group':
/home/finger/wireless-testing-new/include/linux/iommu.h:263: multiple definition 
of `iommu_detach_group'
/usr/share/virtualbox/src/vboxhost/vboxpci/linux/VBoxPci-linux.o:/home/finger/wireless-testing-new/include/linux/iommu.h:263: 
first defined here
/usr/share/virtualbox/src/vboxhost/vboxpci/VBoxPci.o: In function 
`iommu_group_alloc':
/home/finger/wireless-testing-new/include/linux/iommu.h:267: multiple definition 
of `iommu_group_alloc'
/usr/share/virtualbox/src/vboxhost/vboxpci/linux/VBoxPci-linux.o:/home/finger/wireless-testing-new/include/linux/iommu.h:267: 
first defined here
/usr/share/virtualbox/src/vboxhost/vboxpci/VBoxPci.o: In function 
`iommu_group_get_iommudata':
/home/finger/wireless-testing-new/include/linux/iommu.h:272: multiple definition 
of `iommu_group_get_iommudata'
/usr/share/virtualbox/src/vboxhost/vboxpci/linux/VBoxPci-linux.o:/home/finger/wireless-testing-new/include/linux/iommu.h:272: 
first defined here
/usr/share/virtualbox/src/vboxhost/vboxpci/VBoxPci.o: In function 
`iommu_group_set_iommudata':
/home/finger/wireless-testing-new/include/linux/iommu.h:278: multiple definition 
of `iommu_group_set_iommudata'
/usr/share/virtualbox/src/vboxhost/vboxpci/linux/VBoxPci-linux.o:/home/finger/wireless-testing-new/include/linux/iommu.h:278: 
first defined here
/usr/share/virtualbox/src/vboxhost/vboxpci/VBoxPci.o: In function 
`iommu_group_set_name':
/home/finger/wireless-testing-new/include/linux/iommu.h:282: multiple definition 
of `iommu_group_set_name'
/usr/share/virtualbox/src/vboxhost/vboxpci/linux/VBoxPci-linux.o:/home/finger/wireless-testing-new/include/linux/iommu.h:282: 
first defined here
/usr/share/virtualbox/src/vboxhost/vboxpci/VBoxPci.o: In function 
`iommu_group_add_device':
/home/finger/wireless-testing-new/include/linux/iommu.h:287: multiple definition 
of `iommu_group_add_device'
/usr/share/virtualbox/src/vboxhost/vboxpci/linux/VBoxPci-linux.o:/home/finger/wireless-testing-new/include/linux/iommu.h:287: 
first defined here
/usr/share/virtualbox/src/vboxhost/vboxpci/VBoxPci.o: In function 
`iommu_group_remove_device':
/home/finger/wireless-testing-new/include/linux/iommu.h:292: multiple definition 
of `iommu_group_remove_device'
/usr/share/virtualbox/src/vboxhost/vboxpci/linux/VBoxPci-linux.o:/home/finger/wireless-testing-new/include/linux/iommu.h:292: 
first defined here
/usr/share/virtualbox/src/vboxhost/vboxpci/VBoxPci.o: In function 
`iommu_group_for_each_dev':
/home/finger/wireless-testing-new/include/linux/iommu.h:297: multiple definition 
of `iommu_group_for_each_dev'
/usr/share/virtualbox/src/vboxhost/vboxpci/linux/VBoxPci-linux.o:/home/finger/wireless-testing-new/include/linux/iommu.h:297: 
first defined here
/usr/share/virtualbox/src/vboxhost/vboxpci/VBoxPci.o: In function `iommu_group_get':
/home/finger/wireless-testing-new/include/linux/iommu.h:302: multiple definition 
of `iommu_group_get'
/usr/share/virtualbox/src/vboxhost/vboxpci/linux/VBoxPci-linux.o:/home/finger/wireless-testing-new/include/linux/iommu.h:302: 
first defined here
/usr/share/virtualbox/src/vboxhost/vboxpci/VBoxPci.o: In function `iommu_group_put':
/home/finger/wireless-testing-new/include/linux/iommu.h:307: multiple definition 
of `iommu_group_put'
/usr/share/virtualbox/src/vboxhost/vboxpci/linux/VBoxPci-linux.o:/home/finger/wireless-testing-new/include/linux/iommu.h:307: 
first defined here
/usr/share/virtualbox/src/vboxhost/vboxpci/VBoxPci.o: In function 
`iommu_group_register_notifier':
/home/finger/wireless-testing-new/include/linux/iommu.h:312: multiple definition 
of `iommu_group_register_notifier'
/usr/share/virtualbox/src/vboxhost/vboxpci/linux/VBoxPci-linux.o:/home/finger/wireless-testing-new/include/linux/iommu.h:312: 
first defined here
/usr/share/virtualbox/src/vboxhost/vboxpci/VBoxPci.o: In function 
`iommu_group_unregister_notifier':
/home/finger/wireless-testing-new/include/linux/iommu.h:318: multiple definition 
of `iommu_group_unregister_notifier'
/usr/share/virtualbox/src/vboxhost/vboxpci/linux/VBoxPci-linux.o:/home/finger/wireless-testing-new/include/linux/iommu.h:318: 
first defined here
/usr/share/virtualbox/src/vboxhost/vboxpci/VBoxPci.o: In function `iommu_group_id':
/home/finger/wireless-testing-new/include/linux/iommu.h:323: multiple definition 
of `iommu_group_id'
/usr/share/virtualbox/src/vboxhost/vboxpci/linux/VBoxPci-linux.o:/home/finger
/wireless-testing-new/include/linux/iommu.h:323: first defined here
make[3]: *** [/usr/share/virtualbox/src/vboxhost/vboxpci/vboxpci.o] Error 1
make[2]: *** [_module_/usr/share/virtualbox/src/vboxhost/vboxpci] Error 2
make[2]: Leaving directory `/home/finger/wireless-testing-new'
make[1]: *** [vboxpci] Error 2

It seems that the header <linux/iommu.h> is being called with a different set of 
configuration parameters when vboxpci/linux/VBoxPci-linux.c is compiled than for 
vboxpci/VBoxPci.c. I do not feel qualified to determine which one, if either, is 
correct. In my setup, I don't use vboxpci.ko, then I can accept the error in 
"make" and still do the "make install" and use VBox.

Larry





More information about the vbox-dev mailing list