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

Bug 408611

Summary: x11-drivers/xf86-video-virtualbox-4.1.10 - work/VirtualBox-4.1.10/include/iprt/types.h:112:30: fatal error: linux/compiler.h: No such file or directory
Product: Gentoo Linux Reporter: DaggyStyle <daggs>
Component: Current packagesAssignee: Lars Wendler (Polynomial-C) (RETIRED) <polynomial-c>
Status: RESOLVED WORKSFORME    
Severity: normal CC: bkohler, cynede, massimobalestra, proxy-maint, swapon
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build log

Description DaggyStyle 2012-03-17 18:08:46 UTC
in a nutshell:
In file included from /var/tmp/portage/x11-drivers/xf86-video-virtualbox-4.1.10/work/VirtualBox-4.1.10/include/iprt/mem.h:31:0,
                 from /var/tmp/portage/x11-drivers/xf86-video-virtualbox-4.1.10/work/VirtualBox-4.1.10/src/VBox/Runtime/common/alloc/alloc.cpp:34:
/var/tmp/portage/x11-drivers/xf86-video-virtualbox-4.1.10/work/VirtualBox-4.1.10/include/iprt/types.h:112:30: fatal error: linux/compiler.h: No such file or directory
compilation terminated.


Reproducible: Always
Comment 1 DaggyStyle 2012-03-17 18:09:18 UTC
Created attachment 305731 [details]
build log
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2012-04-05 20:31:10 UTC
Please provide the output of

  emerge --info

Thanks
Comment 3 DaggyStyle 2012-04-06 10:58:25 UTC
(In reply to comment #2)
> Please provide the output of
> 
>   emerge --info
> 
> Thanks

Portage 2.1.10.56 (default/linux/amd64/10.0/desktop/kde, gcc-4.6.2, glibc-2.14.1-r2, 3.3.1-gentoo x86_64)
=================================================================
System uname: Linux-3.3.1-gentoo-x86_64-Intel-R-_Core-TM-_i7-2600_CPU_@_3.40GHz-with-gentoo-2.1
Timestamp of tree: Fri, 06 Apr 2012 04:30:01 +0000
app-shells/bash:          4.2_p20
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.2-r3, 3.2.2-r1
dev-util/cmake:           2.8.7-r5
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1
sys-apps/openrc:          0.9.9.3
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.5.3-r2, 4.6.2
sys-devel/gcc-config:     1.5-r2
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 3.3 (virtual/os-headers)
sys-libs/glibc:           2.14.1-r2
Repositories: gentoo x11 kde enlightenment vmware gamerlay-stable Utopia_Platinia
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1 skype-eula Broadcom PUEL googleearth LOKI-EULA AdobeFlash-10.3 RTCW-ETEULA ut2003 MakeMKV-EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -msse4.1"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe -msse4.1"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--keep-going --quiet-build=n"
FEATURES="assume-digests binpkg-logs collision-protect distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans"
FFLAGS=""
GENTOO_MIRRORS="ftp://ftp.halifax.rwth-aachen.de/gentoo/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en he es"
MAKEOPTS="-j10"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--timeout=180"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/x11 /var/lib/layman/kde /var/lib/layman/enlightenment /var/lib/layman/vmware /var/lib/layman/gamerlay /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi aio alsa amd64 amr audiofile bash-completion berkdb bidi branding bzip2 c++0x cairo cdda cdparanoia cdr cjk cli consolekit cracklib crypt css cups curl cxx dbus declarative device-mapper dga dri dts dv dvb dvd dvdr dvdread edb emboss encode exif faad fam ffmpeg firefox flac fortran ftp gallium gdbm gdu gif gphoto2 gpm gtk iconv icq id3tag imagemagick java javascript jpeg jpeg2k kde kipi lame lcms ldap libnotify lua lzma mad matroska mmx mng modules mono mp3 mp4 mpeg mtp mudflap multilib nas ncurses nls nptl nptlonly nsplugin ogg openal openexr opengl openmp oss pam pango pcre pdf perl phonon php plasma png policykit ppds pppd private-headers python qt3support qt4 quicktime readline samba scanner sdl session smp sndfile spell srt sse sse2 sse3 ssl ssse3 startup-notification svg sysfs tcpd theora threads tiff truetype udev unicode usb v4l v4l2 vcd vdpau vorbis vpx wavpack wifi wma x264 xcb xcomposite xinerama xml xorg xosd xrandr xscreensaver xulrunner xv xvid xvmc zlib" ALSA_CARDS="hda-intel usb-audio" ALSA_PCM_PLUGINS="multi asym rate dmix dshare dsnoop softvol plug extplug ioplug hooks empty route file" APACHE2_MODULES="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="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" GRUB_PLATFORMS="pc efi-64" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en he es" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" SANE_BACKENDS="hp" USERLAND="GNU" VIDEO_CARDS="vesa v4l radeon r600 i915 intel" 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:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, USE_PYTHON

note that I've stopped using it and upgraded both kernel and vb, I can retry if you wish.
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2012-10-30 15:13:58 UTC
*** Bug 440206 has been marked as a duplicate of this bug. ***
Comment 5 Cynede (RETIRED) gentoo-dev 2012-10-31 04:08:08 UTC
though file is missing in linux-headers

workaround:

ln -s /usr/src/linux-3.99-linux0/include/linux/compiler.h .                                                                                                                               

in /usr/include/linux/
Comment 6 Cynede (RETIRED) gentoo-dev 2012-11-19 08:02:59 UTC
btw, you need to update symlink everytime with kernel update or better create symlinks to linked dir /usr/src/linux

In some cases gentoo reaction is truly slow :P
Comment 7 Cynede (RETIRED) gentoo-dev 2012-11-30 12:47:13 UTC
btw, yes seems like compiler.h is not related linux-headers and must not be there, my bad.

but video-virtualbox build should be corrected to point correct place for it (kernel source include) though
Comment 8 Cynede (RETIRED) gentoo-dev 2013-01-31 06:00:52 UTC
suggestion:


pkg_setup() {
		linux-mod_pkg_setup
		BUILD_PARAMS="KERN_DIR=${KV_DIR} KERNOUT=${KV_OUT_DIR}"
		enewgroup vboxguest
		enewuser vboxguest -1 /bin/sh /dev/null vboxguest

		elog "Linking compiler.h to /usr/include/linux to fix bug #408611"
		ln -s /usr/src/linux/include/linux/compiler.h /usr/include/linux/compiler.h
}
Comment 9 Cynede (RETIRED) gentoo-dev 2013-01-31 09:32:22 UTC
No, don't read previous suggestion. header file just must search includes in /usr/src/linux/include.
Comment 10 Anton Bolshakov 2013-04-06 08:20:47 UTC
I hit the same problem and managed to find the solution:

make sure the latest stable kernel compiled and *installed* properly.

The hint came from manual attempt: I went to /var/tmp/portage directory and tried to compile it manually. The real error came from yasm - not able to find some /lib/module-<old kernel> modules.

My broken setup was: the /usr/src/linux link to the latest kernel and /lib/modules -> to the previous version.


Hope it helps.
Comment 11 Ben Kohler gentoo-dev 2013-10-02 03:08:23 UTC
All indications suggest this is just an issue of an incomplete/unusable copy of sources at /usr/src/linux, I myself even saw this same error when /usr/src was a symlink so /usr/src/linux was 2 symlink levels deep.

Can anyone still reproduce this, when /usr/src/linux is a fully intact (and built) set of sources?
Comment 12 Ben Kohler gentoo-dev 2013-11-16 16:12:18 UTC
Please reopen if you can reproduce this with a complete & correct kernel source tree.
Comment 13 Jeroen Roovers (RETIRED) gentoo-dev 2014-03-04 00:42:58 UTC
*** Bug 503346 has been marked as a duplicate of this bug. ***
Comment 14 rkuris 2014-10-13 11:17:31 UTC
This happened for me too, as a result of an 'emerge --depclean' that erased my current kernel. It seems that somewhere in the build it still references the old kernel headers. I got around this problem with mv /lib/modules/old-version /lib/modules/old-version.sv && ln -s /lib/modules/new-version /lib/modules/old-version, doing the build, and then undoing that.
Comment 15 Kai Damm 2015-01-05 18:19:02 UTC
I hit this too with virtualbox-4.3.20 while upgrading hardened-sources from 3.17.6 to 3.17.7-r1. Out-of-tree build, symlink is correct,

KERNEL_DIR="/usr/src/linux"
KBUILD_OUTPUT="/var/build/kernel/linux"

The latter directory is a symlink to the build directory.

I emerge --depcleaned =hardened-sources-3.17.6 before configuring/compiling the new kernel.

For the new kernel, make && make modules_install have been completed.

The virtualbox module build cannot find linux/compiler.h, both for virtualbox-guest-additions and xf86-video-virtualbox.

The workaround in Comment 14 only masks the fundamental problem, because linux/compiler.h is alternatively searched in lib/modules if not found in /usr/src. It is not found in /usr/src/ because the variable pointing to the target kernel source is not honoured, instead the build seems to look in /usr/src/linux-$(uname -r) and /lib/modules/$(uname -r). Which fails if the currently-running kernel sources are depcleaned already.

The build must target the to-be-installed kernel, and not the running kernel.
Comment 16 Johannes Buchner 2015-01-22 00:32:33 UTC
I think this bug needs to be re-opened, I also ran across it.
I had applied a emerge update to the kernel (gentoo-sources), and  depclean. 4 installed versions, including the running one, are still there.

I think I solved the issue by merely using "eselect kernel set" to point to the next kernel version (which I have not built or run yet).

I suspect something went wrong in depclean (or the update) which "eselect kernel set" fixed.
Comment 17 Ben Kohler gentoo-dev 2015-01-22 00:37:04 UTC
You may want to look at bug #283587
Comment 18 Josh Holmer 2015-03-11 23:20:51 UTC
(In reply to Johannes Buchner from comment #16)
> I think this bug needs to be re-opened, I also ran across it.
> I had applied a emerge update to the kernel (gentoo-sources), and  depclean.
> 4 installed versions, including the running one, are still there.
> 
> I think I solved the issue by merely using "eselect kernel set" to point to
> the next kernel version (which I have not built or run yet).
> 
> I suspect something went wrong in depclean (or the update) which "eselect
> kernel set" fixed.

I ran across this issue as well with both 4.3.20 and 4.3.24, after upgrading my kernel. "eselect kernel set" did not fix anything, and the /usr/src/linux symlink is pointing to the new kernel. I had to reboot the guest machine using the new kernel then run "emerge @module-rebuild" for it to work.