Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 394219 - >=app-emulation/virtualbox-modules-4.1.4[pax_kernel] - work/vboxdrv/SUPDrvIDC.h:163:22: error: expected ':', ',', ';', '}' or '__attribute__' before 'Out'
Summary: >=app-emulation/virtualbox-modules-4.1.4[pax_kernel] - work/vboxdrv/SUPDrvIDC...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
: 446966 472356 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-12-10 09:49 UTC by Matthias Hanft
Modified: 2018-10-26 12:19 UTC (History)
16 users (show)

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


Attachments
/usr/src/linux/.config (config.txt,81.76 KB, text/plain)
2011-12-10 21:08 UTC, Matthias Hanft
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Hanft 2011-12-10 09:49:57 UTC
Updating "app-emulation/virtualbox-modules" from 4.0.12 to 4.1.4 doesn't work because the compiler brings some errors (see "Actual Results")

Reproducible: Always

Steps to Reproduce:
1. emerge -uv virtualbox-modules

Actual Results:  
>>> Emerging (1 of 2) app-emulation/virtualbox-modules-4.1.4
 * vbox-kernel-module-src-4.1.4.tar.bz2 RMD160 SHA1 SHA256 size ;-) ...                                                                                                  [ ok ]
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found kernel object directory:
 *     /lib/modules/3.0.6-gentoo/build
 * Found sources for kernel version:
 *     3.0.6-gentoo
>>> Unpacking source...
>>> Unpacking vbox-kernel-module-src-4.1.4.tar.bz2 to /var/tmp/portage/app-emulation/virtualbox-modules-4.1.4/work
>>> Source unpacked in /var/tmp/portage/app-emulation/virtualbox-modules-4.1.4/work
>>> Preparing source in /var/tmp/portage/app-emulation/virtualbox-modules-4.1.4/work ...
 * Applying virtualbox-modules-4.1.4-pax-const.patch ...                                                                                                                 [ ok ]
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/app-emulation/virtualbox-modules-4.1.4/work ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/app-emulation/virtualbox-modules-4.1.4/work ...
ln: failed to create symbolic link `Module.symvers': File exists
 * Preparing vboxdrv module
make -j2 HOSTCC=i686-pc-linux-gnu-gcc CROSS_COMPILE=i686-pc-linux-gnu- LDFLAGS= KERN_DIR=/usr/src/linux KERNOUT=/lib/modules/3.0.6-gentoo/build all
*** Building 'vboxdrv' module ***
make[1]: Entering directory `/var/tmp/portage/app-emulation/virtualbox-modules-4.1.4/work/vboxdrv'
make KBUILD_VERBOSE= SUBDIRS=/var/tmp/portage/app-emulation/virtualbox-modules-4.1.4/work/vboxdrv SRCROOT=/var/tmp/portage/app-emulation/virtualbox-modules-4.1.4/work/vboxdrv -C /usr/src/linux modules
make[2]: Entering directory `/usr/src/linux-3.0.6-gentoo'
  CC [M]  /var/tmp/portage/app-emulation/virtualbox-modules-4.1.4/work/vboxdrv/linux/SUPDrv-linux.o
  CC [M]  /var/tmp/portage/app-emulation/virtualbox-modules-4.1.4/work/vboxdrv/SUPDrv.o
In file included from /var/tmp/portage/app-emulation/virtualbox-modules-4.1.4/work/vboxdrv/SUPDrvInternal.h:146:0,
                 from /var/tmp/portage/app-emulation/virtualbox-modules-4.1.4/work/vboxdrv/SUPDrv.c:32:
/var/tmp/portage/app-emulation/virtualbox-modules-4.1.4/work/vboxdrv/SUPDrvIDC.h:163:22: error: expected ':', ',', ';', '}' or '__attribute__' before 'Out'
In file included from /var/tmp/portage/app-emulation/virtualbox-modules-4.1.4/work/vboxdrv/linux/../SUPDrvInternal.h:146:0,
                 from /var/tmp/portage/app-emulation/virtualbox-modules-4.1.4/work/vboxdrv/linux/SUPDrv-linux.c:31:
/var/tmp/portage/app-emulation/virtualbox-modules-4.1.4/work/vboxdrv/linux/../SUPDrvIDC.h:163:22: error: expected ':', ',', ';', '}' or '__attribute__' before 'Out'
/var/tmp/portage/app-emulation/virtualbox-modules-4.1.4/work/vboxdrv/SUPDrv.c: In function 'supdrvIDC_LdrGetSymbol':
/var/tmp/portage/app-emulation/virtualbox-modules-4.1.4/work/vboxdrv/SUPDrv.c:4345:24: error: 'union <anonymous>' has no member named 'Out'
/var/tmp/portage/app-emulation/virtualbox-modules-4.1.4/work/vboxdrv/SUPDrv.c:4376:28: error: 'union <anonymous>' has no member named 'Out'
make[3]: *** [/var/tmp/portage/app-emulation/virtualbox-modules-4.1.4/work/vboxdrv/SUPDrv.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [/var/tmp/portage/app-emulation/virtualbox-modules-4.1.4/work/vboxdrv/linux/SUPDrv-linux.o] Error 1
make[2]: *** [_module_/var/tmp/portage/app-emulation/virtualbox-modules-4.1.4/work/vboxdrv] Error 2
make[2]: Leaving directory `/usr/src/linux-3.0.6-gentoo'
make[1]: *** [vboxdrv] Error 2
make[1]: Leaving directory `/var/tmp/portage/app-emulation/virtualbox-modules-4.1.4/work/vboxdrv'
make: *** [all] Error 2
emake failed
 * ERROR: app-emulation/virtualbox-modules-4.1.4 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/3.0.6-gentoo/build all
 *
 * Call stack:
 *     ebuild.sh, line   56:  Called src_compile
 *   environment, line 3386:  Called linux-mod_src_compile
 *   environment, line 2599:  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}";


Expected Results:  
Updates app-emulation/virtualbox-modules

Portage 2.1.10.11 (hardened/linux/x86, gcc-4.5.3, glibc-2.12.2-r0, 3.0.6-gentoo i686)
=================================================================
System uname: Linux-3.0.6-gentoo-i686-Intel-R-_Xeon-R-_CPU_X5690_@_3.47GHz-with-gentoo-2.0.3
Timestamp of tree: Sat, 10 Dec 2011 09:00:01 +0000
app-shells/bash:          4.1_p9
dev-lang/python:          2.7.2-r3, 3.1.4-r3
dev-util/cmake:           2.8.4-r1
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.9.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.10.3, 1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.5.3-r1
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 2.6.39 (virtual/os-headers)
sys-libs/glibc:           2.12.2
Repositories: gentoo
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/openvpn/easy-rsa /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /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"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask=n"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://de-mirror.org/gentoo/ http://ftp.uni-erlangen.de/pub/mirrors/gentoo"
LANG="C"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="acl berkdb bzip2 cli cracklib crypt cxx dri fam gdbm geoip gpm hardened iconv idn iproute2 ipv6 modules mudflap ncurses nls nptl nptlonly openmp pam passwordsave pax_kernel pcre pic pkcs11 pppd readline session ssl sysfs syslog tcpd unicode urandom x86 xml xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" 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 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" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 intel mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa via vmware nouveau" 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, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2011-12-10 16:25:06 UTC
Can't reproduce that. What does your kernel .config look like?
Comment 2 Matthias Hanft 2011-12-10 21:08:58 UTC
Created attachment 295417 [details]
/usr/src/linux/.config
Comment 3 Matthias Hanft 2011-12-10 21:09:26 UTC
I have 3 Gentoo systems.  With kernel-2.6.38-r6, virtualbox-modules-4.1.4 compile without problems.  The other 2 systems have kernel-3.0.6, there the error occurs.  In the attachment, you'll find the .config of one of them.  I just switched some net stuff to YES (Advanced Router, Multiple Routing Tables, iptables/netfilter), the rest is pretty default...
Comment 5 LoneWolf 2012-01-04 17:33:57 UTC
Same issue here.
Kernel 3.1.6-gentoo
Same virtualbox-modules version
Comment 6 Jiří Moravec 2012-01-08 14:25:40 UTC
Me too. I'm unable to successfuly compile any virtualbox-modules-4.1.* against linux-kernel >=3.0 with additional patches or clean vanilla gentoo-source. There is no problem with 2.6.39* at all.

Same error message:
"SUPDrvIDC.h:163:22: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘Out’".

It is strange that some people apparently have no problem with linux-3.* and virtualbox-modules.
Comment 7 Matthias Hanft 2012-01-14 09:57:14 UTC
Even worse: Since virtualbox-modules-4.0.12 was removed from portage, you can't upgrade the kernel any more because module-rebuild complains "emerge: there are no ebuilds to satisfy "=app-emulation/virtualbox-modules-4.0.12"."

Any workaround? Just copy /lib/modules/3.0.6-gentoo/misc/vboxdrv.ko etc. to /lib/modules/3.1.6-gentoo/misc?
Comment 8 Howard B. Golden 2012-01-21 22:07:10 UTC
The failing code in SUPDrvIDC.h:163:22 is added by the virtualbox-modules-4.1.4-pax-const.patch patch. This patch is only applied if use pax_kernel && kernel_is -ge 3 0 0.

Though I don't understand why, my GCC 4.5.3 doesn't understand the __no_const attribute.

When I comment out the test and epatch, virtualbox-modules-4.1.8 builds successfully.
Comment 9 corto 2012-03-02 12:48:45 UTC
(In reply to comment #8)
> The failing code in SUPDrvIDC.h:163:22 is added by the
> virtualbox-modules-4.1.4-pax-const.patch patch. This patch is only applied
> if use pax_kernel && kernel_is -ge 3 0 0.


After reading Howard's comment, I tried to emerge without pax_kernel use flag against my 3.2.9 kernel (straight from git's tag for v3.2.9).

With these options, virtualbox-modules version...
4.1.8 worked perfectly on first shot.
4.1.4 failed with the infamous "vboxpci.ko" issue (known bug)
4.1.6 worked perfectly on first shot.

Earlier, all 3 versions of vbox-mods had failed with all the kernel versions I tried that were >=3.0

My kernel config was an i386_defconfig before I modified it to support a few XEN-related options, some drivers (network, wireless, graphics, usb) and filesystems (only ext2, and udf,ntfs,samba for compatibility).

This is my current gcc profile:
[1] i686-pc-linux-gnu-4.5.3 *
Comment 10 Howard B. Golden 2012-03-18 20:52:22 UTC
(In reply to comment #8)
> When I comment out the test and epatch, virtualbox-modules-4.1.8 builds
> successfully.

This same workaround is successful with virtualbox-modules-4.1.10. Perhaps the 4.1.4 patch is not required with later versions?
Comment 11 Howard B. Golden 2012-04-07 22:12:19 UTC
(In reply to comment #10)
> (In reply to comment #8)
> > When I comment out the test and epatch, virtualbox-modules-4.1.8 builds
> > successfully.
> 
> This same workaround is successful with virtualbox-modules-4.1.10. Perhaps
> the 4.1.4 patch is not required with later versions?

And it works for virtualbox-modules-4.1.12 as well.
Comment 12 Matthias Hanft 2012-04-08 08:04:26 UTC
(In reply to comment #11)
> 
> And it works for virtualbox-modules-4.1.12 as well.

Correct (just USE="-pax_kernel" - no further patch required).  Does anyone know what "using" the pax_kernel flag/patch exactly does, and why it was introduced at all?

(BTW, do I have a "pax kernel" where USE="pax_kernel" might be necessary?  I'm just using the "hardened/linux/x86" profile, but everything else is plain vanilla.  Seems that virtualbox-modules run flawlessly with USE="-pax_kernel", but I'm still a bit uneasy about it...)

-Matt
Comment 13 Howard B. Golden 2012-04-28 21:38:46 UTC
(In reply to comment #11)
> And it works for virtualbox-modules-4.1.12 as well.

And it works for virtualbox-modules-4.1.14 as well. (What does it take to change the status to "Confirmed"?)
Comment 14 Lars Wendler (Polynomial-C) gentoo-dev 2012-04-28 21:48:48 UTC
Can someone from the hardened teams please have a look at this?
Comment 15 PaX Team 2012-06-21 19:20:05 UTC
__no_const is a define to an attribute introduced by a gcc plugin in PaX but it is meaningless (undefined) otherwise. USE=pax_kernel should control whether you're building your modules against a PaX or grsec patched kernel or not (you can use a non-plugin capable gcc, the PaX makefile will detect that and will define away these new attributes). so in order to see what exactly goes wrong, i'd like to know for each failure case:

1. exact kernel tree you're building against
2. gcc version used for building your kernel/modules
3. whether you enable USE=pax_kernel or not

a quick guide to a proper setup:

1. if your kernel includes PaX/grsec (e.g., hardened) then
1.1 you *must* set USE=pax_kernel *if* your gcc is plugin capable (gcc 4.5+)
1.2 you *may* set USE=pax_kernel but it won't do anything

2. if you kernel does *not* include PaX/grsec then you must *not* set USE=pax_kernel.
Comment 16 Lars Wendler (Polynomial-C) gentoo-dev 2012-12-13 13:58:20 UTC
*** Bug 446966 has been marked as a duplicate of this bug. ***
Comment 17 Ben Kohler gentoo-dev 2013-10-03 20:28:13 UTC
*** Bug 472356 has been marked as a duplicate of this bug. ***
Comment 18 Toralf Förster gentoo-dev 2015-06-14 10:15:27 UTC
same issue in current version :

app-emulation/virtualbox-modules-4.3.28: : /var/tmp/portage/app-emulation/virtualbox-modules-4.3.28/work/vboxdrv/linux/../SUPDrvIDC.h:163:22: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘Out’
Comment 19 PaX Team 2015-06-14 10:53:55 UTC
(In reply to Toralf Förster from comment #18)
> same issue in current version :
> 
> app-emulation/virtualbox-modules-4.3.28: :
> /var/tmp/portage/app-emulation/virtualbox-modules-4.3.28/work/vboxdrv/linux/.
> ./SUPDrvIDC.h:163:22: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’
> before ‘Out’

see comment #15 for the information i need. FWIW, virtualbox-modules-4.3.28 emerges fine here with linux-4.0.4 patched with PaX only and USE=pax_kernel.
Comment 20 Frédéric Barthelery 2015-07-27 16:21:22 UTC
Same issue on latest virtualbox-modules-5.0.0.
Note that with USE=pax_kernel, I am able to successfully build if I don't use an hardened gcc. 

```
nowhere ~ # gcc-config -l
 [1] i686-pc-mingw32-4.9.2
 [2] i686-pc-mingw32-4.9.2-hardenednopie
 [3] i686-pc-mingw32-4.9.2-vanilla
 [4] i686-pc-mingw32-4.9.3 *
 [5] i686-pc-mingw32-4.9.3-hardenednopie
 [6] i686-pc-mingw32-4.9.3-vanilla

 [7] x86_64-pc-linux-gnu-4.9.3
 [8] x86_64-pc-linux-gnu-4.9.3-hardenednopie *
 [9] x86_64-pc-linux-gnu-4.9.3-hardenednopiessp
 [10] x86_64-pc-linux-gnu-4.9.3-hardenednossp
 [11] x86_64-pc-linux-gnu-4.9.3-vanilla

```

I can build successfully with x86_64-pc-linux-gnu-4.9.3-hardenednopie  but not with x86_64-pc-linux-gnu-4.9.3.

Hope this will help
Comment 21 Tom Li 2015-08-28 18:20:54 UTC
Also confirms everything with GCC 5.1.

So basically it only works if /usr/src/linux is really a PaX kernel if USE="pax_kernel" is set. Thanks for information from PaX Team.
Comment 22 Walter 2016-10-28 06:25:42 UTC
Me too.

Successful workaround:

 USE="-pax_kernel" emerge -av virtualbox

Further details on my case:
 - running kernel: 4.3.3 (linux-4.3.3-hardened-r4 = Hardened Gentoo sources)
 - /usr/src/linux: 4.4.1 (linux-4.4.1-gentoo = Gentoo sources)

... running kernel version is mostly because ZFS (zfs-0.6.5.4).
Comment 23 Walter 2016-10-28 06:32:04 UTC
Also...

[8] x86_64-pc-linux-gnu-4.9.3 * 

gcc (Gentoo Hardened 4.9.3 p1.5, pie-0.6.4) 4.9.3

app-emulation/virtualbox-modules-4.3.38