# can't compile vboxdrv

## braxkung

Hi!

Im new too linux / gentoo . Can someone help me with this? I cant really figure out whats wrong..

output of emerge: 

>>> Emerging (2 of 17) app-emulation/virtualbox-modules-4.0.12

 * vbox-kernel-module-src-4.0.12.tar.bz2 RMD160 SHA1 SHA256 size  :Wink:  ...                                              [ ok ]

 * Package:    app-emulation/virtualbox-modules-4.0.12

 * Repository: gentoo

 * Maintainer: polynomial-c@gentoo.org patrick@gentoo.org,swapon@gmail.com

 * USE:        elibc_glibc kernel_linux userland_GNU x86

 * FEATURES:   sandbox

 * Determining the location of the kernel source code

 * Found kernel source directory:

 *     /usr/src/linux

 * Found kernel object directory:

 *     /lib/modules/2.6.36-gentoo-r8/build

 * Found sources for kernel version:

 *     2.6.36-gentoo-r8

>>> Unpacking source...

>>> Unpacking vbox-kernel-module-src-4.0.12.tar.bz2 to /var/tmp/portage/app-emulation/virtualbox-modules-4.0.12/work

>>> Source unpacked in /var/tmp/portage/app-emulation/virtualbox-modules-4.0.12/work

>>> Preparing source in /var/tmp/portage/app-emulation/virtualbox-modules-4.0.12/work ...

>>> Source prepared.

>>> Configuring source in /var/tmp/portage/app-emulation/virtualbox-modules-4.0.12/work ...

>>> Source configured.

>>> Compiling source in /var/tmp/portage/app-emulation/virtualbox-modules-4.0.12/work ...

ln: failed to create symbolic link `Module.symvers': File exists

 * Preparing vboxdrv module

make HOSTCC=i686-pc-linux-gnu-gcc CROSS_COMPILE=i686-pc-linux-gnu- LDFLAGS= KERN_DIR=/usr/src/linux KERNOUT=/lib/modules/2.6.36-gentoo-r8/build all 

*** Building 'vboxdrv' module ***

make[1]: Entering directory `/var/tmp/portage/app-emulation/virtualbox-modules-4.0.12/work/vboxdrv'

make KBUILD_VERBOSE= SUBDIRS=/var/tmp/portage/app-emulation/virtualbox-modules-4.0.12/work/vboxdrv SRCROOT=/var/tmp/portage/app-emulation/virtualbox-modules-4.0.12/work/vboxdrv -C /usr/src/linux modules

make[2]: Entering directory `/usr/src/linux-2.6.36-gentoo-r8'

  WARNING: Symbol version dump /usr/src/linux-2.6.36-gentoo-r8/Module.symvers

           is missing; modules will have no dependencies and modversions.

  CC [M]  /var/tmp/portage/app-emulation/virtualbox-modules-4.0.12/work/vboxdrv/linux/SUPDrv-linux.o

/bin/sh: scripts/genksyms/genksyms: No such file or directory

make[3]: *** [/var/tmp/portage/app-emulation/virtualbox-modules-4.0.12/work/vboxdrv/linux/SUPDrv-linux.o] Error 1

make[2]: *** [_module_/var/tmp/portage/app-emulation/virtualbox-modules-4.0.12/work/vboxdrv] Error 2

make[2]: Leaving directory `/usr/src/linux-2.6.36-gentoo-r8'

make[1]: *** [vboxdrv] Error 2

make[1]: Leaving directory `/var/tmp/portage/app-emulation/virtualbox-modules-4.0.12/work/vboxdrv'

make: *** [all] Error 2

emake failed

 * ERROR: app-emulation/virtualbox-modules-4.0.12 failed (compile phase):

 *   Unable to emake HOSTCC=i686-pc-linux-gnu-gcc CROSS_COMPILE=i686-pc-linux-gnu- LDFLAGS=  KERN_DIR=/usr/src/linux KERNOUT=/lib/modules/2.6.36-gentoo-r8/build all

 * 

 * Call stack:

 *     ebuild.sh, line   56:  Called src_compile

 *   environment, line 3432:  Called linux-mod_src_compile

 *   environment, line 2640:  Called die

 * The specific snippet of code:

 *               eval "emake HOSTCC=\"$(tc-getBUILD_CC)\" 						CROSS_COMPILE=${CHOST}- 						LDFLAGS=\"$(get_abi_LDFLAGS)\" 						${BUILD_FIXES} 						${BUILD_PARAMS} 						${BUILD_TARGETS} " || die "Unable to emake HOSTCC="$(tc-getBUILD_CC)" CROSS_COMPILE=${CHOST}- LDFLAGS="$(get_abi_LDFLAGS)" ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}";

 * 

 * If you need support, post the output of 'emerge --info =app-emulation/virtualbox-modules-4.0.12',

 * the complete build log and the output of 'emerge -pqv =app-emulation/virtualbox-modules-4.0.12'.

 * The complete build log is located at '/var/tmp/portage/app-emulation/virtualbox-modules-4.0.12/temp/build.log'.

 * The ebuild environment file is located at '/var/tmp/portage/app-emulation/virtualbox-modules-4.0.12/temp/environment'.

 * S: '/var/tmp/portage/app-emulation/virtualbox-modules-4.0.12/work'

>>> Failed to emerge app-emulation/virtualbox-modules-4.0.12, Log file:

>>>  '/var/tmp/portage/app-emulation/virtualbox-modules-4.0.12/temp/build.log'

 * Messages for package app-emulation/virtualbox-modules-4.0.12:

 * ERROR: app-emulation/virtualbox-modules-4.0.12 failed (compile phase):

 *   Unable to emake HOSTCC=i686-pc-linux-gnu-gcc CROSS_COMPILE=i686-pc-linux-gnu- LDFLAGS=  KERN_DIR=/usr/src/linux KERNOUT=/lib/modules/2.6.36-gentoo-r8/build all

 * 

 * Call stack:

 *     ebuild.sh, line   56:  Called src_compile

 *   environment, line 3432:  Called linux-mod_src_compile

 *   environment, line 2640:  Called die

 * The specific snippet of code:

 *               eval "emake HOSTCC=\"$(tc-getBUILD_CC)\" 						CROSS_COMPILE=${CHOST}- 						LDFLAGS=\"$(get_abi_LDFLAGS)\" 						${BUILD_FIXES} 						${BUILD_PARAMS} 						${BUILD_TARGETS} " || die "Unable to emake HOSTCC="$(tc-getBUILD_CC)" CROSS_COMPILE=${CHOST}- LDFLAGS="$(get_abi_LDFLAGS)" ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}";

 * 

 * If you need support, post the output of 'emerge --info =app-emulation/virtualbox-modules-4.0.12',

 * the complete build log and the output of 'emerge -pqv =app-emulation/virtualbox-modules-4.0.12'.

 * The complete build log is located at '/var/tmp/portage/app-emulation/virtualbox-modules-4.0.12/temp/build.log'.

 * The ebuild environment file is located at '/var/tmp/portage/app-emulation/virtualbox-modules-4.0.12/temp/environment'.

 * S: '/var/tmp/portage/app-emulation/virtualbox-modules-4.0.12/work'

 * GNU info directory index is up-to-date.

Let me know if more info is needed.

regards,

braxkung

----------

## roarinelk

build the kernel before building modules for it,

export KBUILD_OUTPUT=/path/to/compiled/kernel/

----------

