CC [M] /var/tmp/portage/app-emulation/virtualbox-modules-4.1.0-r1/work/vboxdrv/linux/SUPDrv-linux.o CC [M] /var/tmp/portage/app-emulation/virtualbox-modules-4.1.0-r1/work/vboxdrv/SUPDrv.o CC [M] /var/tmp/portage/app-emulation/virtualbox-modules-4.1.0-r1/work/vboxdrv/r0drv/alloc-r0drv.o CC [M] /var/tmp/portage/app-emulation/virtualbox-modules-4.1.0-r1/work/vboxdrv/SUPDrvSem.o CC [M] /var/tmp/portage/app-emulation/virtualbox-modules-4.1.0-r1/work/vboxdrv/r0drv/initterm-r0drv.o /var/tmp/portage/app-emulation/virtualbox-modules-4.1.0-r1/work/vboxdrv/SUPDrv.c: In function 'supdrvIDC_LdrGetSymbol': /var/tmp/portage/app-emulation/virtualbox-modules-4.1.0-r1/work/vboxdrv/SUPDrv.c:4346:17: error: assignment of read-only member 'Out' /var/tmp/portage/app-emulation/virtualbox-modules-4.1.0-r1/work/vboxdrv/SUPDrv.c:4377:21: error: assignment of read-only member 'Out' At top level: cc1: warning: unrecognized command line option "-Wno-unused-but-set-variable" make[3]: *** [/var/tmp/portage/app-emulation/virtualbox-modules-4.1.0-r1/work/vboxdrv/SUPDrv.o] Error 1 make[3]: *** Waiting for unfinished jobs.... make[2]: *** [_module_/var/tmp/portage/app-emulation/virtualbox-modules-4.1.0-r1/work/vboxdrv] Error 2 make[2]: Leaving directory `/usr/src/linux-2.6.39-hardened-r9' make[1]: *** [vboxdrv] Error 2 make[1]: Leaving directory `/var/tmp/portage/app-emulation/virtualbox-modules-4.1.0-r1/work/vboxdrv' make: *** [all] Error 2 emake failed * ERROR: app-emulation/virtualbox-modules-4.1.0-r1 failed (compile phase): * Unable to emake HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- LDFLAGS= KERN_DIR=/usr/src/linux KERNOUT=/usr/src/linux all # emerge --info =app-emulation/virtualbox-modules-4.1.0-r1 Portage 2.1.10.11 (hardened/linux/amd64, gcc-4.5.3, glibc-2.13-r4, 2.6.39-hardened-r10 x86_64) ================================================================= System Settings ================================================================= System uname: Linux-2.6.39-hardened-r10-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q8400_@_2.66GHz-with-gentoo-2.0.3 Timestamp of tree: Tue, 16 Aug 2011 01:00:01 +0000 app-shells/bash: 4.2_p10 dev-java/java-config: 2.1.11-r3 dev-lang/python: 2.7.2-r2, 3.2-r2 dev-util/cmake: 2.8.5-r2 dev-util/pkgconfig: 0.26 sys-apps/baselayout: 2.0.3 sys-apps/openrc: 0.8.3-r1 sys-apps/sandbox: 2.5 sys-devel/autoconf: 2.13, 2.68 sys-devel/automake: 1.9.6-r3, 1.11.1-r1 sys-devel/binutils: 2.21.1 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.13-r4 Repositories: gentoo ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="*" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=nocona -O2 -pipe" 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/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-march=nocona -O2 -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 userpriv usersandbox" FFLAGS="" GENTOO_MIRRORS="ftp://ftp.snt.utwente.nl/pub/os/linux/gentoo ftp://mirror.cambrium.nl/pub/os/linux/gentoo/ ftp://mirror.leaseweb.com/gentoo/" LANG="C" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j5" 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://192.168.0.1/gentoo-portage" USE="3dnow X a52 aac acl acpi alsa amd64 attr automount bash-completion berkdb bzip2 cairo caps cdr cracklib crypt cups cxx dbus dga directfb dvb dvd dvdr erandom eselect exif fbcondecor ffmpeg flac gdbm gif gnome gstreamer gtk gtk3 hardened ipv6 java jpeg jpeg2k libnotify lm_sensors lzma mmx mng mp3 mpeg mudflap multilib ncurses nls nptl nptlonly ogg opengl openmp oss pam pax_kernel pcre pdf pic png python qt3support readline samba sdl sha512 sse sse2 sse3 ssl ssse3 svg tcpd tetex threads tiff truetype udev udisks unicode upower v4l v4l2 vaapi vorbis xattr xcomposite xine xinerama xml xulrunner xv xvmc zlib" ALSA_CARDS="virtuoso" 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 sh shm softvol" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" USERLAND="GNU" VIDEO_CARDS="intel" Unset: CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS The bug is also mentioned in #378731 (comment 5) and a patch should be available by PaX Team (comment 8). I don't know what his homedir should be, but found a patch at the Virtualbox forums (see URL for more information and the origin of the attached patch).
Created attachment 283571 [details, diff] constification.patch
I've also hit this bug and I can confirm that the attached patch allowed virtualbox-modules to compile.
Is this still a problem with virtualbox-modules-4.1.2.ebuild?
(In reply to comment #3) > Is this still a problem with virtualbox-modules-4.1.2.ebuild? Yes, I still cannot compile virtualbox-modules-4.1.2 on hardened-sources-2.6.39-r11. In the same time I can confirm that it compiles fine on hardened-sources-2.6.39-r8.
(In reply to comment #3) > Is this still a problem with virtualbox-modules-4.1.2.ebuild? I can confirm it too, still the same problem. I did some additional testing and tried to compile the patched version with 2.6.39-r8 and it fails, which is suspected as the code that the patch adds isn't compatible with that specific kernel revision. So there should be a check for the specific revision of the hardened-sources that is used. I couldn't find a predefined way to do this though... Or the 'pax_kernel' use flag could be added. I know mesa and some others use it to fix hardened-sources problems. But again, there should be a specific kernel revision check, otherwise it will fail on everthing below -r9.
Let's add the hardened-kernel team. I don't want to add patches that might make the virtualbox-modules incompatible to non-hardened kernels and they maybe can shed some more light into this...
(In reply to comment #6) > Let's add the hardened-kernel team. I don't want to add patches that might make > the virtualbox-modules incompatible to non-hardened kernels and they maybe can > shed some more light into this... This is supposed to be fixed in the later version of 2.6.39 (try -r12), however there is another bug on x86 that needs to be resolved before stabilizing the higher -rX's. See bug #378731, comments #5 and #7. Can you test on hardened-sources-2.6.39-r12 without modifying vboxhost/vboxdrv/SUPDrvIDC.h and report back.
(In reply to comment #7) > Can you test on hardened-sources-2.6.39-r12 without modifying > vboxhost/vboxdrv/SUPDrvIDC.h and report back. The build still fails for me with -r12.
(In reply to comment #7) > Can you test on hardened-sources-2.6.39-r12 without modifying > vboxhost/vboxdrv/SUPDrvIDC.h and report back. Unfortunately, at the moment I can't compile 2.6.39-hardened-r12 on amd64, see https://bugs.gentoo.org/show_bug.cgi?id=378731#c18
(In reply to comment #9) > (In reply to comment #7) > > Can you test on hardened-sources-2.6.39-r12 without modifying > > vboxhost/vboxdrv/SUPDrvIDC.h and report back. > > Unfortunately, at the moment I can't compile 2.6.39-hardened-r12 on amd64, see > https://bugs.gentoo.org/show_bug.cgi?id=378731#c18 Please use gcc-4.4.5
(In reply to comment #10) > Please use gcc-4.4.5 Hi, Indeed, I can confirm that virtualbox-modules-4.1.2 compiles fine on hardened-sources-2.6.39-r12 using gcc-4.4.5 (and fails with gcc-4.5.3-r1)
(In reply to comment #11) > Indeed, I can confirm that virtualbox-modules-4.1.2 compiles fine on > hardened-sources-2.6.39-r12 using gcc-4.4.5 (and fails with gcc-4.5.3-r1) For the record - it also compiles fine with gcc-4.4.6-r1 which is the latest gcc-4.4.x in portage tree.
Created attachment 287873 [details] virtualbox-modules-4.1.2-bug379421.patch Now when sys-devel/gcc-4.5.3-r1 is table it would be nice to apply that patch because all versions of virtualbox including the stable one are broken.
FYI, the problem is fixed in the next version app-emulation/virtualbox-modules-4.1.4
*** This bug has been marked as a duplicate of bug 386497 ***