Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 680296 - app-emulation/virtualbox-modules-6.0.4 with >=sys-kernel/gentoo-sources-5.0.0 - .../work/vboxdrv/Makefile.include.header:143: *** Error: unable to find the headers of the Linux kernel to build against. Specify KERN_VER=<version> (...) and run Make again.
Summary: app-emulation/virtualbox-modules-6.0.4 with >=sys-kernel/gentoo-sources-5.0.0...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Viorel Munteanu
URL:
Whiteboard:
Keywords:
: 683726 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-03-14 08:05 UTC by Jan Vansteenkiste
Modified: 2023-04-21 13:20 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,2.83 KB, text/plain)
2019-03-14 09:24 UTC, Jan Vansteenkiste
Details
build.log (app-emulation/virtualbox-modules-6.0.6) (build.log,2.85 KB, text/x-log)
2019-04-30 06:47 UTC, Jan Vansteenkiste
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Vansteenkiste 2019-03-14 08:05:29 UTC
Looks like there are some issues with the build environment while trying to compile the virtualbox-modules with a newer kernel (5.x) although upstream should support it since this release.

Manually going into the work folder and running the same make command, the compile goes through without issues.

BUILD LOG:

# emerge virtualbox-modules
Calculating dependencies... done!

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) app-emulation/virtualbox-modules-6.0.4::gentoo
 * vbox-kernel-module-src-6.0.4.tar.xz BLAKE2B SHA512 size ;-) ...                                [ ok ]
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found sources for kernel version:
 *     5.0.2-gentoo
 * Checking for suitable kernel configuration options...                                          [ ok ]
>>> Unpacking source...
>>> Unpacking vbox-kernel-module-src-6.0.4.tar.xz to /var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/work
>>> Source unpacked in /var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/work
>>> Preparing source in /var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/work ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/work ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/work ...
ln: failed to create symbolic link 'Module.symvers': File exists
 * Preparing vboxdrv module
make -j9 HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- 'LDFLAGS=-m elf_x86_64' CC=x86_64-pc-linux-gnu-gcc KERN_DIR=/usr/src/linux KERN_VER=5.0.2-gentoo O=/usr/src/linux V=1 KBUILD_VERBOSE=1 all 
=== Building 'vboxdrv' module ===
make[1]: Entering directory '/var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/work/vboxdrv'
/var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/work/vboxdrv/Makefile.include.header:143: *** Error: unable to find the headers of the Linux kernel to build against. Specify KERN_VER=<version> (currently 5.0.2-gentoo) and run Make again.  Stop.
make[1]: Leaving directory '/var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/work/vboxdrv'
make: *** [Makefile:58: vboxdrv] Error 2
 * ERROR: app-emulation/virtualbox-modules-6.0.4::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=app-emulation/virtualbox-modules-6.0.4::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-emulation/virtualbox-modules-6.0.4::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/temp/environment'.
 * Working directory: '/var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/work'
 * S: '/var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/work'

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

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

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

 * ERROR: app-emulation/virtualbox-modules-6.0.4::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=app-emulation/virtualbox-modules-6.0.4::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-emulation/virtualbox-modules-6.0.4::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/temp/environment'.
 * Working directory: '/var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/work'
 * S: '/var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/work'




EMERGE_INFO:

Portage 2.3.62 (python 3.6.5-final-0, default/linux/amd64/17.0/desktop, gcc-8.2.0, glibc-2.27-r6, 5.0.1-gentoo x86_64)
=================================================================
System uname: Linux-5.0.1-gentoo-x86_64-Intel-R-_Core-TM-_i7-8550U_CPU_@_1.80GHz-with-gentoo-2.6
KiB Mem:    32654604 total,  20010600 free
KiB Swap:   33554428 total,  33554428 free
Timestamp of repository gentoo: Thu, 14 Mar 2019 06:44:13 +0000
Head commit of repository gentoo: cd3ba0ec32476c45080101496632f4f43dec4fd1

sh bash 4.4_p23-r1
ld GNU ld (Gentoo 2.30 p5) 2.30.0
app-shells/bash:          4.4_p23-r1::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.26.2::gentoo
dev-lang/python:          2.7.15::gentoo, 3.6.5::gentoo
dev-util/cmake:           3.9.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.38.3-r1::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r3::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.30-r4::gentoo
sys-devel/gcc:            7.3.0-r3::gentoo, 8.2.0-r6::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.0-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.27-r6::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000

go-overlay
    location: /var/lib/layman/go-overlay
    sync-type: laymansync
    sync-uri: https://github.com/Dr-Terrible/go-overlay.git
    masters: gentoo
    priority: 50

steam-overlay
    location: /var/lib/layman/steam-overlay
    sync-type: laymansync
    sync-uri: https://github.com/anyc/steam-overlay.git
    masters: gentoo
    priority: 50

vstone
    location: /var/lib/layman/vstone
    sync-type: laymansync
    sync-uri: https://github.com/vStone/vstone-overlay.git
    masters: gentoo
    priority: 50

Installed sets: @automation, @binpackages, @bluetooth, @communication, @consoletools, @coretools, @desktop, @development, @emulation, @gaming, @gentools, @go-overlay--consoletools, @hardware, @kernel, @laptoptools, @multimedia, @networking, @office
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA Oracle-BCLA-JavaSE AdobeFlash-11.x PUEL RAR Q3AEULA Intel-SDP Broadcom NVIDIA-CUDA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.2/ext-active/ /etc/php/cgi-php7.2/ext-active/ /etc/php/cli-php7.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-march=native -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O2 -pipe"
GENTOO_MIRRORS="https://mirror.leaseweb.com/gentoo/"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en nl nl_BE"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit crypt cryptsetup cups cxx dbus dri dri3 dts dvd dvdr emboss encode exif fam flac fortran gdbm gif git glamor gpg gtk gtk3 iconv ipv6 jpeg lcms ldap libnotify libtirpc lvm mad mng mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcre pcre16 pdf png policykit ppds pulseaudio qt5 readline sdl seccomp spell ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vim-syntax vorbis wxwidgets x264 xattr xcb xml xv xvid zlib" ABI_X86="64 32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="evdev keyboard mouse synaptics" KERNEL="linux" L10N="en nl" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-1" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby24" USERLAND="GNU" VIDEO_CARDS="intel i965 vesa fbdev" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2019-03-14 09:01:11 UTC
Please attach the build.log file to this bug.
Comment 2 Jan Vansteenkiste 2019-03-14 09:14:16 UTC
I tried uploading the build.log but I'm getting 

Software error:

Malformed multipart POST: data truncated

For help, please send mail to the webmaster (webmaster@gentoo.org), giving this error message and the time and date of the error. 

The build.log is actually pretty small so I can copy paste it here:


# cat /var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/temp/build.log
 * Package:    app-emulation/virtualbox-modules-6.0.4
 * Repository: gentoo
 * Maintainer: polynomial-c@gentoo.org
 * USE:        abi_x86_64 amd64 elibc_glibc kernel_linux userland_GNU
 * FEATURES:   network-sandbox preserve-libs sandbox userpriv usersandbox
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found sources for kernel version:
 *     5.0.2-gentoo
 * Checking for suitable kernel configuration options...                                         [ ok ]
>>> Unpacking source...
>>> Unpacking vbox-kernel-module-src-6.0.4.tar.xz to /var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/work
>>> Source unpacked in /var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/work
>>> Preparing source in /var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/work ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/work ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/work ...
ln: failed to create symbolic link 'Module.symvers': File exists
 * Preparing vboxdrv module
make -j9 HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- 'LDFLAGS=-m elf_x86_64' CC=x86_64-pc-linux-gnu-gcc KERN_DIR=/usr/src/linux KERN_VER=5.0.2-gentoo O=/usr/src/linux V=1 KBUILD_VERBOSE=1 all 
=== Building 'vboxdrv' module ===
make[1]: Entering directory '/var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/work/vboxdrv'
/var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/work/vboxdrv/Makefile.include.header:143: *** Error: unable to find the headers of the Linux kernel to build against. Specify KERN_VER=<version> (currently 5.0.2-gentoo) and run Make again.  Stop.
make[1]: Leaving directory '/var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/work/vboxdrv'
make: *** [Makefile:58: vboxdrv] Error 2
 * ERROR: app-emulation/virtualbox-modules-6.0.4::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=app-emulation/virtualbox-modules-6.0.4::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-emulation/virtualbox-modules-6.0.4::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/temp/environment'.
 * Working directory: '/var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/work'
 * S: '/var/tmp/portage/app-emulation/virtualbox-modules-6.0.4/work'
Comment 3 Jan Vansteenkiste 2019-03-14 09:24:26 UTC
Created attachment 569076 [details]
build.log
Comment 4 Jan Vansteenkiste 2019-03-21 06:51:31 UTC
Small update: When I go to the work folder and run

make -j9 HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- 'LDFLAGS=-m elf_x86_64' CC=x86_64-pc-linux-gnu-gcc KERN_DIR=/usr/src/linux KERN_VER=5.0.3-gentoo O=/usr/src/linux V=1 KBUILD_VERBOSE=1 all

by hand, the compile goes through fine.
Comment 5 rooky 2019-04-04 12:20:53 UTC
Related Problem on my System, but with other output.
Manually executing 
test -e include/generated/autoconf.h -a -e include/config/auto.conf
works fine, $? is 0.


but compiling fails:
...
make -C /usr/src/linux KBUILD_SRC=/usr/src/linux-5.0.5-gentoo \
-f /usr/src/linux-5.0.5-gentoo/Makefile modules
make[3]: Entering directory '/usr/src/linux-5.0.5-gentoo'
/usr/src/linux-5.0.5-gentoo/Makefile:189: ================= WARNING ================
/usr/src/linux-5.0.5-gentoo/Makefile:190: 'SUBDIRS' will be removed after Linux 5.3
/usr/src/linux-5.0.5-gentoo/Makefile:191: Please use 'M=' or 'KBUILD_EXTMOD' instead
/usr/src/linux-5.0.5-gentoo/Makefile:192: ==========================================
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (                \
echo >&2;                                                       \
echo >&2 "  ERROR: Kernel configuration is invalid.";           \
echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";      \
echo >&2 ;                                                      \
/bin/false)

  ERROR: Kernel configuration is invalid.
         include/generated/autoconf.h or include/config/auto.conf are missing.
         Run 'make oldconfig && make prepare' on kernel src to fix it.


...
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2019-04-18 09:05:24 UTC
*** Bug 683726 has been marked as a duplicate of this bug. ***
Comment 7 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2019-04-20 13:18:55 UTC
Does this still happen with app-emulation/virtualbox-modules-6.0.6?
Comment 8 Jan Vansteenkiste 2019-04-30 06:46:11 UTC
I'm afraid this does still happen with 6.0.6.

>>> Emerging (1 of 1) app-emulation/virtualbox-modules-6.0.6::gentoo
 * vbox-kernel-module-src-6.0.6.tar.xz BLAKE2B SHA512 size ;-) ...                                                                                                                                          [ ok ]
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found sources for kernel version:
 *     5.0.10-gentoo
 * Checking for suitable kernel configuration options...                                                                                                                                                    [ ok ]
>>> Unpacking source...
>>> Unpacking vbox-kernel-module-src-6.0.6.tar.xz to /var/tmp/portage/app-emulation/virtualbox-modules-6.0.6/work
>>> Source unpacked in /var/tmp/portage/app-emulation/virtualbox-modules-6.0.6/work
>>> Preparing source in /var/tmp/portage/app-emulation/virtualbox-modules-6.0.6/work ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/app-emulation/virtualbox-modules-6.0.6/work ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/app-emulation/virtualbox-modules-6.0.6/work ...
ln: failed to create symbolic link 'Module.symvers': File exists
 * Preparing vboxdrv module
make -j9 HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- 'LDFLAGS=-m elf_x86_64' CC=x86_64-pc-linux-gnu-gcc KERN_DIR=/usr/src/linux KERN_VER=5.0.10-gentoo O=/usr/src/linux V=1 KBUILD_VERBOSE=1 all 
=== Building 'vboxdrv' module ===
make[1]: Entering directory '/var/tmp/portage/app-emulation/virtualbox-modules-6.0.6/work/vboxdrv'
/var/tmp/portage/app-emulation/virtualbox-modules-6.0.6/work/vboxdrv/Makefile-header.gmk:182: *** Error: unable to find the headers of the Linux kernel to build against (KERN_DIR=/usr/src/linux). Specify KERN_VER=<version> (currently 5.0.10-gentoo) and run Make again.  Stop.
make[1]: Leaving directory '/var/tmp/portage/app-emulation/virtualbox-modules-6.0.6/work/vboxdrv'
make: *** [Makefile:58: vboxdrv] Error 2
 * ERROR: app-emulation/virtualbox-modules-6.0.6::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=app-emulation/virtualbox-modules-6.0.6::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-emulation/virtualbox-modules-6.0.6::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/app-emulation/virtualbox-modules-6.0.6/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-emulation/virtualbox-modules-6.0.6/temp/environment'.
 * Working directory: '/var/tmp/portage/app-emulation/virtualbox-modules-6.0.6/work'
 * S: '/var/tmp/portage/app-emulation/virtualbox-modules-6.0.6/work'
Comment 9 Jan Vansteenkiste 2019-04-30 06:47:16 UTC
Created attachment 574772 [details]
build.log (app-emulation/virtualbox-modules-6.0.6)
Comment 10 Jan Vansteenkiste 2019-04-30 06:52:15 UTC
gaz /etc/portage # emerge --info virtualbox-modules
Portage 2.3.62 (python 3.6.5-final-0, default/linux/amd64/17.0/desktop, gcc-8.2.0, glibc-2.28-r6, 5.0.9-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.0.9-gentoo-x86_64-Intel-R-_Core-TM-_i7-8550U_CPU_@_1.80GHz-with-gentoo-2.6
KiB Mem:    32646936 total,  14364348 free
KiB Swap:   33554428 total,  33554428 free
Timestamp of repository gentoo: Tue, 30 Apr 2019 05:04:28 +0000
Head commit of repository gentoo: 381d32e9e1d2d5264311d5c2b4f7d4d1c054df6a

Head commit of repository vstone: 97aeebfa1c3be1f5d6227a1e8bbc67333819663a

sh bash 4.4_p23-r1
ld GNU ld (Gentoo 2.31.1 p5) 2.31.1
distcc 3.3.2 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.4_p23-r1::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.26.2::gentoo
dev-lang/python:          2.7.15::gentoo, 3.6.5::gentoo
dev-util/cmake:           3.9.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.38.3-r1::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.31.1-r4::gentoo
sys-devel/gcc:            8.2.0-r6::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.0-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.28-r6::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000

vstone
    location: /var/lib/overlays/vstone
    sync-type: git
    sync-uri: https://github.com/vStone/vstone-overlay.git
    masters: gentoo

go-overlay
    location: /var/lib/layman/go-overlay
    sync-type: laymansync
    sync-uri: https://github.com/Dr-Terrible/go-overlay.git
    masters: gentoo
    priority: 50

steam-overlay
    location: /var/lib/layman/steam-overlay
    sync-type: laymansync
    sync-uri: https://github.com/anyc/steam-overlay.git
    masters: gentoo
    priority: 50

wine
    location: /var/lib/layman/wine
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/repo/proj/wine.git
    masters: gentoo
    priority: 50

Installed sets: @automation, @binpackages, @bluetooth, @communication, @consoletools, @coretools, @desktop, @development, @emulation, @gaming, @gentools, @go-overlay--consoletools, @hardware, @kernel, @laptoptools, @multimedia, @networking, @office, @systemtools
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA Oracle-BCLA-JavaSE AdobeFlash-11.x PUEL RAR Q3AEULA Intel-SDP Broadcom NVIDIA-CUDA google-chrome"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.2/ext-active/ /etc/php/cgi-php7.2/ext-active/ /etc/php/cli-php7.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-march=native -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O2 -pipe"
GENTOO_MIRRORS="https://mirror.leaseweb.com/gentoo/"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en nl nl_BE"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit crypt cryptsetup cups cxx dbus dri dri3 dts dvd dvdr emboss encode exif fam flac fortran gdbm gif git glamor gpg gtk gtk3 http2 iconv ipv6 jpeg lcms ldap libnotify libtirpc lvm mad mng mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcre pcre16 pdf png policykit ppds pulseaudio qt5 readline sdl seccomp spell ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vim-syntax vorbis wxwidgets x264 xattr xcb xml xv xvid zlib" ABI_X86="64 32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="evdev keyboard mouse synaptics" KERNEL="linux" L10N="en nl" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-1" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby24" USERLAND="GNU" VIDEO_CARDS="intel i965 vesa fbdev" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

app-emulation/virtualbox-modules-6.0.6::gentoo was built with the following:
USE="-pax_kernel" ABI_X86="(64)"
Comment 11 Jan Vansteenkiste 2019-04-30 06:54:23 UTC
For reference: I downgraded the linux-headers to the latest stable (4.14-r1) and it gives the same error.
Comment 12 Jan Vansteenkiste 2019-05-21 05:34:02 UTC
This is still the case for virtualbox-modules-6.0.8
Comment 13 Jesús Guerrero 2019-08-10 07:18:00 UTC
This happens for me as well, with latest vanilla kernel and app-emulation/virtualbox-modules-6.0.10
Comment 14 Xavier Fernández i Marín 2019-09-28 13:23:32 UTC
Same with 6.0.12 here.
Comment 15 Xavier Fernández i Marín 2019-09-30 08:13:58 UTC
I correct myself: trying it now with the new portage-2.3.76 solves the issue for me. So I would suggest to update portage to the new version.
Comment 16 Jesús Guerrero 2019-11-15 09:34:40 UTC
(In reply to Xavier Fernández i Marín from comment #15)
> I correct myself: trying it now with the new portage-2.3.76 solves the issue
> for me. So I would suggest to update portage to the new version.

I've been suffering this same issue for months now. That didn't help either. I agree this is something to do with the build environment. At some point I was able to build the thing against kernel 5.0.0, which now I can't. So I am stuck with kernel 5.0.0 and virtualbox 6.0.8.130520 which is no longer in the portage tree. 

Haven't had the time to check into the issue, but it's probably fixable in the ebuild without even patching the sources.
Comment 17 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2020-03-10 10:59:10 UTC
Just for the record, a user in #gentoo-de on freenode IRC had the same issue and it turned out to be /usr/src directory not having the correct permissions so user portage could read the content of /usr/src

Please make sure that the portage user can access all files below /usr/src/*
Comment 18 Jan Vansteenkiste 2020-03-10 11:18:06 UTC
(In reply to Lars Wendler (Polynomial-C) from comment #17)
> Just for the record, a user in #gentoo-de on freenode IRC had the same issue
> and it turned out to be /usr/src directory not having the correct
> permissions so user portage could read the content of /usr/src
> 
> Please make sure that the portage user can access all files below /usr/src/*

This was exactly my problem. /usr/src was set to 700. Not sure when/how that happened for me.
Comment 19 Viorel Munteanu gentoo-dev 2022-11-11 10:09:39 UTC
I can reproduce this issue in v7.0.2 if I do not install the current kernel modules.  Please check the directories exist, are valid and have proper permissions:

ls -l /lib/modules/`uname -r`/build
ls -l /usr/src/linux

ls -l /lib/modules/`uname -r`/build/
ls -l /usr/src/linux/