Bug 1168910 - Virtualbox host source fails to compile for kernel 5.5.13
Virtualbox host source fails to compile for kernel 5.5.13
Status: RESOLVED FIXED
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Virtualization:Other
Current
x86-64 openSUSE Factory
: P5 - None : Normal (vote)
: ---
Assigned To: Larry Finger
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-04-07 20:16 UTC by Rüdiger Becker
Modified: 2020-04-08 19:17 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rüdiger Becker 2020-04-07 20:16:52 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0
Build Identifier: 

___:/usr/src/kernel-modules/virtualbox/src # make
=== Building 'vboxdrv' module ===
make[1]: Verzeichnis „/usr/src/kernel-modules/virtualbox/src/vboxdrv“ wird betreten
make V= CONFIG_MODULE_SIG= CONFIG_MODULE_SIG_ALL= -C /lib/modules/5.5.13-z64smp/build M=/usr/src/kernel-modules/virtualbox/src/vboxdrv SRCROOT=/usr/src/kernel-modules/virtualbox/src/vboxdrv -j8 modules
make[2]: Verzeichnis „/usr/src/linux-5.5.13-1“ wird betreten
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/linux/SUPDrv-linux.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/SUPDrv.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/SUPDrvGip.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/SUPDrvSem.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/SUPDrvTracer.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/SUPLibAll.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/r0drv/initterm-r0drv.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/r0drv/alloc-r0drv.o
In Datei, eingebunden von /usr/src/kernel-modules/virtualbox/src/vboxdrv/SUPDrvGip.c:59:
/usr/src/kernel-modules/virtualbox/src/vboxdrv/include/iprt/x86.h:843: Warnung: »X86_CR0_PE« redefiniert
  843 | #define X86_CR0_PE                          RT_BIT_32(0)
      | 
In Datei, eingebunden von ./arch/x86/include/asm/processor-flags.h:5,
                 von ./arch/x86/include/asm/processor.h:5,
                 von ./arch/x86/include/asm/cpufeature.h:5,
                 von ./arch/x86/include/asm/thread_info.h:53,
                 von ./include/linux/thread_info.h:38,
                 von ./arch/x86/include/asm/preempt.h:7,
                 von ./include/linux/preempt.h:78,
                 von ./include/linux/spinlock.h:51,
                 von ./include/linux/seqlock.h:36,
                 von ./include/linux/time.h:6,
                 von ./include/linux/ktime.h:24,
                 von /usr/src/kernel-modules/virtualbox/src/vboxdrv/include/iprt/time.h:44,
                 von /usr/src/kernel-modules/virtualbox/src/vboxdrv/SUPDrvInternal.h:44,
                 von /usr/src/kernel-modules/virtualbox/src/vboxdrv/SUPDrvGip.c:33:
./arch/x86/include/uapi/asm/processor-flags.h:52: Anmerkung: dies ist die Stelle der vorherigen Definition
   52 | #define X86_CR0_PE  _BITUL(X86_CR0_PE_BIT)
      | 
__________many similar warnings__________
      | 
In Datei, eingebunden von ./arch/x86/include/asm/msr.h:5,
                 von ./arch/x86/include/asm/processor.h:22,
                 von ./arch/x86/include/asm/cpufeature.h:5,
                 von ./arch/x86/include/asm/thread_info.h:53,
                 von ./include/linux/thread_info.h:38,
                 von ./arch/x86/include/asm/preempt.h:7,
                 von ./include/linux/preempt.h:78,
                 von ./include/linux/spinlock.h:51,
                 von ./include/linux/seqlock.h:36,
                 von ./include/linux/time.h:6,
                 von ./include/linux/ktime.h:24,
                 von /usr/src/kernel-modules/virtualbox/src/vboxdrv/include/iprt/time.h:44,
                 von /usr/src/kernel-modules/virtualbox/src/vboxdrv/common/string/strformatrt.c:49:
./arch/x86/include/asm/msr-index.h:489: Anmerkung: dies ist die Stelle der vorherigen Definition
  489 | #define MSR_K8_TOP_MEM2   0xc001001d
      | 
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/common/string/strtonum.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/common/table/avlpv.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/common/time/time.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/r0drv/linux/RTLogWriteDebugger-r0drv-linux.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/generic/RTAssertShouldPanic-generic.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/generic/RTLogWriteStdErr-stub-generic.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/generic/RTLogWriteStdOut-stub-generic.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/generic/RTLogWriteUser-generic.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/generic/RTMpGetArraySize-generic.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/generic/RTMpGetCoreCount-generic.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/generic/RTSemEventWait-2-ex-generic.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/generic/RTSemEventWaitNoResume-2-ex-generic.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/generic/RTSemEventMultiWait-2-ex-generic.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/generic/RTSemEventMultiWaitNoResume-2-ex-generic.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/generic/RTTimerCreate-generic.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/generic/errvars-generic.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/generic/mppresent-generic.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/generic/uuid-generic.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/VBox/log-vbox.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/common/alloc/heapsimple.o
  LD [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/vboxdrv.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/vboxdrv.mod.o
  LD [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/vboxdrv.ko
make[2]: Verzeichnis „/usr/src/linux-5.5.13-1“ wird verlassen
make[1]: Verzeichnis „/usr/src/kernel-modules/virtualbox/src/vboxdrv“ wird verlassen

=== Building 'vboxnetflt' module ===
make[1]: Verzeichnis „/usr/src/kernel-modules/virtualbox/src/vboxnetflt“ wird betreten
make V= CONFIG_MODULE_SIG= CONFIG_MODULE_SIG_ALL= -C /lib/modules/5.5.13-z64smp/build M=/usr/src/kernel-modules/virtualbox/src/vboxnetflt SRCROOT=/usr/src/kernel-modules/virtualbox/src/vboxnetflt -j8 modules
make[2]: Verzeichnis „/usr/src/linux-5.5.13-1“ wird betreten
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxnetflt/linux/VBoxNetFlt-linux.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxnetflt/VBoxNetFlt.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxnetflt/SUPR0IdcClient.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxnetflt/SUPR0IdcClientComponent.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxnetflt/linux/SUPR0IdcClient-linux.o
  LD [M]  /usr/src/kernel-modules/virtualbox/src/vboxnetflt/vboxnetflt.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxnetflt/vboxnetflt.mod.o
  LD [M]  /usr/src/kernel-modules/virtualbox/src/vboxnetflt/vboxnetflt.ko
make[2]: Verzeichnis „/usr/src/linux-5.5.13-1“ wird verlassen
make[1]: Verzeichnis „/usr/src/kernel-modules/virtualbox/src/vboxnetflt“ wird verlassen

=== Building 'vboxnetadp' module ===
make[1]: Verzeichnis „/usr/src/kernel-modules/virtualbox/src/vboxnetadp“ wird betreten
make V= CONFIG_MODULE_SIG= CONFIG_MODULE_SIG_ALL= -C /lib/modules/5.5.13-z64smp/build M=/usr/src/kernel-modules/virtualbox/src/vboxnetadp SRCROOT=/usr/src/kernel-modules/virtualbox/src/vboxnetadp -j8 modules
make[2]: Verzeichnis „/usr/src/linux-5.5.13-1“ wird betreten
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxnetadp/linux/VBoxNetAdp-linux.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxnetadp/VBoxNetAdp.o
  LD [M]  /usr/src/kernel-modules/virtualbox/src/vboxnetadp/vboxnetadp.o
  Building modules, stage 2.
  MODPOST 1 modules
ERROR: "VBoxHost_RTStrPrintf" [/usr/src/kernel-modules/virtualbox/src/vboxnetadp/vboxnetadp.ko] undefined!
ERROR: "VBoxHost_RTErrConvertToErrno" [/usr/src/kernel-modules/virtualbox/src/vboxnetadp/vboxnetadp.ko] undefined!
ERROR: "VBoxHost_RTErrConvertFromErrno" [/usr/src/kernel-modules/virtualbox/src/vboxnetadp/vboxnetadp.ko] undefined!
ERROR: "VBoxHost_RTLogLoggerEx" [/usr/src/kernel-modules/virtualbox/src/vboxnetadp/vboxnetadp.ko] undefined!
ERROR: "VBoxHost_RTLogRelGetDefaultInstanceEx" [/usr/src/kernel-modules/virtualbox/src/vboxnetadp/vboxnetadp.ko] undefined!
ERROR: "VBoxHost_RTStrToUInt32" [/usr/src/kernel-modules/virtualbox/src/vboxnetadp/vboxnetadp.ko] undefined!
ERROR: "VBoxHost_RTR0Term" [/usr/src/kernel-modules/virtualbox/src/vboxnetadp/vboxnetadp.ko] undefined!
ERROR: "VBoxHost_RTR0Init" [/usr/src/kernel-modules/virtualbox/src/vboxnetadp/vboxnetadp.ko] undefined!
make[3]: *** [scripts/Makefile.modpost:99: __modpost] Fehler 1
make[2]: *** [Makefile:1622: modules] Fehler 2
make[2]: Verzeichnis „/usr/src/linux-5.5.13-1“ wird verlassen
make[1]: *** [/usr/src/kernel-modules/virtualbox/src/vboxnetadp/Makefile-footer.gmk:114: vboxnetadp] Fehler 2
make[1]: Verzeichnis „/usr/src/kernel-modules/virtualbox/src/vboxnetadp“ wird verlassen
make: *** [Makefile:73: vboxnetadp] Fehler 1

Reproducible: Always

Steps to Reproduce:
1. install kernel 5.5.13-1 inc. source
2. compile, install and boot kernel
3. install virtualbox-host-source 6.1.4-4.2
4. go to /usr/src/kernel-modules/virtualbox
5. execute make
Comment 1 Larry Finger 2020-04-08 17:25:44 UTC
I no longer had kernel 5.5.13 available, thus I downloaded 5.5.16 from the Kernel Archives and built it. That should not make a difference, nor should my getting a mainline kernel source instead of from openSUSE.

My results were:

finger@linux-n6zm:/usr/src/kernel-modules/virtualbox/src> sudo make
=== Building 'vboxdrv' module ===
make[1]: Entering directory '/usr/src/kernel-modules/virtualbox/src/vboxdrv'
make V= CONFIG_MODULE_SIG= CONFIG_MODULE_SIG_ALL= -C /lib/modules/5.5.16/build M=/usr/src/kernel-modules/virtualbox/src/vboxdrv SRCROOT=/usr/src/kernel-modules/virtualbox/src/vboxdrv -j4 modules
make[2]: Entering directory '/home/finger/linux-5.5.16'
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/linux/SUPDrv-linux.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/SUPDrv.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/SUPDrvGip.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxdrv/SUPDrvSem.o
In file included from /usr/src/kernel-modules/virtualbox/src/vboxdrv/SUPDrvGip.c:59:
/usr/src/kernel-modules/virtualbox/src/vboxdrv/include/iprt/x86.h:843: warning: "X86_CR0_PE" redefined
  843 | #define X86_CR0_PE                          RT_BIT_32(0)
      | 
In file included from ./arch/x86/include/asm/processor-flags.h:5,
                 from ./arch/x86/include/asm/processor.h:5,
                 from ./arch/x86/include/asm/cpufeature.h:5,
                 from ./arch/x86/include/asm/thread_info.h:53,
                 from ./include/linux/thread_info.h:38,
                 from ./arch/x86/include/asm/preempt.h:7,
                 from ./include/linux/preempt.h:78,
                 from ./include/linux/spinlock.h:51,
                 from ./include/linux/seqlock.h:36,
                 from ./include/linux/time.h:6,
                 from ./include/linux/ktime.h:24,
                 from /usr/src/kernel-modules/virtualbox/src/vboxdrv/include/iprt/time.h:44,
                 from /usr/src/kernel-modules/virtualbox/src/vboxdrv/SUPDrvInternal.h:44,
                 from /usr/src/kernel-modules/virtualbox/src/vboxdrv/SUPDrvGip.c:33:
./arch/x86/include/uapi/asm/processor-flags.h:52: note: this is the location of the previous definition
   52 | #define X86_CR0_PE  _BITUL(X86_CR0_PE_BIT)
      | 
In file included from /usr/src/kernel-modules/virtualbox/src/vboxdrv/SUPDrv.c:62:
/usr/src/kernel-modules/virtualbox/src/vboxdrv/include/iprt/x86.h:843: warning: "X86_CR0_PE" redefined
  843 | #define X86_CR0_PE                          RT_BIT_32(0)
      | 
In file included from ./arch/x86/include/asm/processor-flags.h:5,
                 from ./arch/x86/include/asm/processor.h:5,
                 from ./arch/x86/include/asm/cpufeature.h:5,
                 from ./arch/x86/include/asm/thread_info.h:53,
                 from ./include/linux/thread_info.h:38,
                 from ./arch/x86/include/asm/preempt.h:7,
                 from ./include/linux/preempt.h:78,
                 from ./include/linux/spinlock.h:51,
                 from ./include/linux/seqlock.h:36,
                 from ./include/linux/time.h:6,
                 from ./include/linux/ktime.h:24,
                 from /usr/src/kernel-modules/virtualbox/src/vboxdrv/include/iprt/time.h:44,
                 from /usr/src/kernel-modules/virtualbox/src/vboxdrv/SUPDrvInternal.h:44,
                 from /usr/src/kernel-modules/virtualbox/src/vboxdrv/SUPDrv.c:33:
./arch/x86/include/uapi/asm/processor-flags.h:52: note: this is the location of the previous definition
   52 | #define X86_CR0_PE  _BITUL(X86_CR0_PE_BIT)
      | 

-- snip --

=== Building 'vboxnetadp' module ===
make[1]: Entering directory '/usr/src/kernel-modules/virtualbox/src/vboxnetadp'
make V= CONFIG_MODULE_SIG= CONFIG_MODULE_SIG_ALL= -C /lib/modules/5.5.16/build M=/usr/src/kernel-modules/virtualbox/src/vboxnetadp SRCROOT=/usr/src/kernel-modules/virtualbox/src/vboxnetadp -j4 modules
make[2]: Entering directory '/home/finger/linux-5.5.16'
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxnetadp/linux/VBoxNetAdp-linux.o
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxnetadp/VBoxNetAdp.o
  LD [M]  /usr/src/kernel-modules/virtualbox/src/vboxnetadp/vboxnetadp.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC [M]  /usr/src/kernel-modules/virtualbox/src/vboxnetadp/vboxnetadp.mod.o
  LD [M]  /usr/src/kernel-modules/virtualbox/src/vboxnetadp/vboxnetadp.ko
make[2]: Leaving directory '/home/finger/linux-5.5.16'
make[1]: Leaving directory '/usr/src/kernel-modules/virtualbox/src/vboxnetadp'

finger@linux-n6zm:/usr/src/kernel-modules/virtualbox/src> uname -r
5.5.16

As you see, it built correctly. I am working at preparing patches to eliminate all those warnings, but that job has a very low probability.

There is a bug in the current Makefile, but it leads to a very different error than what you are reporting. There is the following sequence:

vboxnetadp: vboxdrv
        @if [ -d vboxnetadp ]; then \
            if [ -f vboxdrv/Module.symvers ]; then \
                cp vboxdrv/Module.symvers vboxnetadp; \
            fi; \
            export KBUILD_EXTRA_SYMBOLS=${PWD}/vboxnetadp/Module.symvers; \
            echo "=== Building 'vboxnetadp' module ==="; \
            $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) KBUILD_EXTRA_SYMBOLS=$(abspath vboxpci/Module.symvers) -C vboxnetadp || exit 1; \
            cp vboxnetadp/vboxnetadp.ko .; \
            echo; \
        fi

The "vboxpci" in the $(MAKE) line should be "vboxdrv". With that change, which has been submitted to Factory, the kernel modules build correctly.

It is possible that the above bug is leading to different errors on your system than mine. Please check Makefile in /usr/src/kernel-modules/virtualbox/src/ for that problem and report what you find.
Comment 2 Rüdiger Becker 2020-04-08 18:23:10 UTC
Changing the Makefile line from vboxpci to vboxdrv removes the error. The sources compile now. Thank you for your help.
Comment 3 Larry Finger 2020-04-08 19:17:22 UTC
Fix already pushed upstreal to Virtualization.virtualbox.