Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 623628 - app-emulation/virtualbox-modules-5.1.22 fails to compile against 4.12 kernel: undefined operand 'new'
Summary: app-emulation/virtualbox-modules-5.1.22 fails to compile against 4.12 kernel:...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 4 votes (vote)
Assignee: Lars Wendler (Polynomial-C) (RETIRED)
URL:
Whiteboard: Will be fixed with 5.1.24 release
Keywords:
: 623730 624328 625526 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-07-03 10:49 UTC by fuse809
Modified: 2017-08-17 06:54 UTC (History)
44 users (show)

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


Attachments
build.log "undefined named operand ‘new’" (build.log,44.47 KB, text/x-log)
2017-07-04 07:18 UTC, poncho
Details
Patch 1/2 (kernel_4.12.0_1.patch,2.68 KB, patch)
2017-07-05 11:31 UTC, Konstantinos Smanis
Details | Diff
Patch 2/2 (kernel_4.12.0_2.patch,2.56 KB, patch)
2017-07-05 11:31 UTC, Konstantinos Smanis
Details | Diff
4.12.patch (vbox_fix_for_kernel_4.12_rf.patch,11.29 KB, patch)
2017-07-05 15:19 UTC, Pacho Ramos
Details | Diff
Revised Patch 2/2 (kernel_4.12.0_2.patch,3.18 KB, patch)
2017-07-06 16:54 UTC, Konstantinos Smanis
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description fuse809 2017-07-03 10:49:16 UTC
I tried to compile app-emulation/virtualbox-modules-5.1.22 against the 4.12 kernel , the complete errors I received are too long to fit here but they are along the lines of:

/usr/src/linux-4.12.0-gentoo/arch/x86/include/asm/atomic64_64.h:182:2: error: undefined named opera
nd ‘new’

attached would be the build log but I cannot seem to attach it to this bug as whenever I do I am taken back to https://bugs.gentoo.org/enter_bug.cgi?format=guided when I submit the bug. In the first comment I'll attach the emerge --info output, the emerge -pqv '=app-emulation/virtualbox-modules-5.1.22::gentoo' output is:

[ebuild   R   ] app-emulation/virtualbox-modules-5.1.22  USE="-pax_kernel"
Comment 1 fuse809 2017-07-03 10:51:35 UTC
I tried to attach the log again and it won't let me due to attachment.cgi issues so here it is: 

https://paste.pound-python.org/show/KfOyW9jX9TD80m1W7Srb/

emerge --info output is:

Portage 2.3.6 (python 3.4.6-final-0, default/linux/amd64/13.0/desktop/plasma/systemd, gcc-6.3.0, gl
ibc-2.24-r3, 4.11.8-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.11.8-gentoo-x86_64-Intel-R-_Core-TM-_i7-4700MQ_CPU_@_2.40GHz-with-gentoo-2.4.
1
KiB Mem:    16344240 total,   8020848 free
KiB Swap:          0 total,         0 free
sh bash 4.4_p12
ld GNU ld (Gentoo 2.27 p1.0) 2.27
app-shells/bash:          4.4_p12::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.1-r2::gentoo
dev-lang/python:          2.7.13::gentoo, 3.4.6::gentoo
dev-util/cmake:           3.8.2::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1::gentoo
sys-apps/openrc:          0.27.2::gentoo
sys-apps/sandbox:         2.10-r4::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r3::gentoo
sys-devel/automake:       1.12.6-r1::gentoo, 1.13.4-r1::gentoo, 1.15.1::gentoo
sys-devel/binutils:       2.27::gentoo, 2.28-r2::gentoo
sys-devel/gcc:            6.3.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r4::gentoo
sys-devel/make:           4.2.1-r1::gentoo
sys-kernel/linux-headers: 4.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.24-r3::gentoo
Repositories:

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

fusion809
    location: /usr/local/fusion809-overlay
    masters: gentoo

flatpak-overlay
    location: /usr/local/flatpak-overlay
    sync-type: git
    sync-uri: git://github.com/fosero/flatpak-overlay.git
    masters: gentoo
    priority: 50

gamerlay
    location: /var/lib/layman/gamerlay
    sync-type: git
    sync-uri: git://anongit.gentoo.org/proj/gamerlay.git
    masters: gentoo
    priority: 50

games-overlay
    location: /var/lib/layman/games-overlay
    sync-type: git
    sync-uri: git://github.com/hasufell/games-overlay.git
    masters: gentoo
    priority: 50

gnome
    location: /var/lib/layman/gnome
    sync-type: git
    sync-uri: git://github.com/gentoo/gnome.git
    masters: gentoo
    priority: 50

grub2-themes
    location: /var/lib/layman/grub2-themes
    sync-type: git
    sync-uri: git://github.com/gentoo/grub2-themes-overlay.git
    masters: gentoo
    priority: 50

kde
    location: /var/lib/layman/kde
    sync-type: git
    sync-uri: git://anongit.gentoo.org/proj/kde.git
    masters: gentoo
    priority: 50

mozilla
    location: /var/lib/layman/mozilla
    sync-type: git
    sync-uri: git://anongit.gentoo.org/proj/mozilla.git
    masters: gentoo
    priority: 50

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

tlp
    location: /var/lib/layman/tlp-portage
    sync-type: git
    sync-uri: git://github.com/dywisor/tlp-portage.git
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /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/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://ftp.swin.edu.au/gentoo"
LANG="en_AU.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
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 branding bumblebee bzip2 cairo cdda cdr cli cracklib crypt cups cxx dbus declarative dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif glamor gpm gtk iconv ipv6 jpeg kde kipi kms kwallet lcms ldap libnotify mad mng modules mp3 mp4 mpeg multilib ncurses nls nptl nvidia ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds qml qt3support qt4 qt5 readline sdl seccomp semantic-desktop session spell ssl startup-notification svg systemd tcpd tiff truetype udev udisks unicode upower usb vorbis wayland widgets wxwidgets x264 xattr xcb xcomposite xinerama xml xscreensaver xv xvid xwayland zlib" ABI_X86="64" 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="kexi words flow plan sheets stage tables krita karbon braindump author" 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" INPUT_DEVICES="evdev synaptics" KERNEL="linux" L10N="en en_AU en_GB en_US en-AU en-GB en-US" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_AU en_GB en-AU en-GB" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby21 ruby22" USERLAND="GNU" VIDEO_CARDS="nvidia 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:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

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

app-emulation/virtualbox-modules-5.1.22::gentoo was built with the following:
USE="-pax_kernel" ABI_X86="(64)"
Comment 2 Vasilis Lourdas 2017-07-03 14:10:40 UTC
Just compiled gentoo-sources-4.12.0 and tried to emerge virtualbox-modules. Something similar here:

x86_64-pc-linux-gnu-gcc -Wp,-MD,/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/.memuserkernel-r0drv-linux.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include -I/usr/src/linux-4.12.0-gentoo/arch/x86/include -I./arch/x86/include/generated/uapi -I./arch/x86/include/generated  -I/usr/src/linux-4.12.0-gentoo/include -I./include -I/usr/src/linux-4.12.0-gentoo/arch/x86/include/uapi -I/usr/src/linux-4.12.0-gentoo/include/uapi -I./include/generated/uapi -include /usr/src/linux-4.12.0-gentoo/include/linux/kconfig.h  -I/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv -I/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=core2 -mno-red-zone -mcmodel=kernel -funit-at-a-time -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -DCONFIG_AS_AVX512=1 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -fno-delete-null-pointer-checks -O2 --param=allow-store-data-races=0 -DCC_HAVE_ASM_GOTO -fno-stack-protector -Wno-unused-but-set-variable -fomit-frame-pointer -fno-var-tracking-assignments -fno-inline-functions-called-once -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -include /var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/include/VBox/SUPDrvMangling.h  -I/usr/src/linux/include  -I/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/  -I/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/include  -I/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux  -I/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/vboxdrv/  -I/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/vboxdrv/include  -I/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/vboxdrv/r0drv/linux -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING -DSUPDRV_WITH_RELEASE_LOGGER -Wno-declaration-after-statement -DCONFIG_VBOXDRV_AS_MISC -DRT_ARCH_AMD64 -DVBOX_WITH_64_BITS_GUESTS -fno-omit-frame-pointer -fno-pie  -DMODULE  -DKBUILD_BASENAME='"memuserkernel_r0drv_linux"'  -DKBUILD_MODNAME='"vboxdrv"' -c -o /var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/memuserkernel-r0drv-linux.o /var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/memuserkernel-r0drv-linux.c
In file included from /var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/alloc-r0drv-linux.c:31:0:
/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/alloc-r0drv-linux.c: In function ‘VBoxHost_RTMemContAlloc’:
/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/the-linux-kernel.h:323:47: error: implicit declaration of function ‘set_pages_x’ [-Werror=implicit-function-declaration]
 # define MY_SET_PAGES_EXEC(pPages, cPages)    set_pages_x(pPages, cPages)
                                               ^
/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/alloc-r0drv-linux.c:445:13: note: in expansion of macro ‘MY_SET_PAGES_EXEC’
             MY_SET_PAGES_EXEC(&paPages[iPage], 1);
             ^
/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/alloc-r0drv-linux.c: In function ‘VBoxHost_RTMemContFree’:
/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/the-linux-kernel.h:324:47: error: implicit declaration of function ‘set_pages_nx’ [-Werror=implicit-function-declaration]
 # define MY_SET_PAGES_NOEXEC(pPages, cPages)  set_pages_nx(pPages, cPages)
                                               ^
/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/alloc-r0drv-linux.c:493:13: note: in expansion of macro ‘MY_SET_PAGES_NOEXEC’
             MY_SET_PAGES_NOEXEC(&paPages[iPage], 1);
             ^
  x86_64-pc-linux-gnu-gcc -Wp,-MD,/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/.mp-r0drv-linux.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include -I/usr/src/linux-4.12.0-gentoo/arch/x86/include -I./arch/x86/include/generated/uapi -I./arch/x86/include/generated  -I/usr/src/linux-4.12.0-gentoo/include -I./include -I/usr/src/linux-4.12.0-gentoo/arch/x86/include/uapi -I/usr/src/linux-4.12.0-gentoo/include/uapi -I./include/generated/uapi -include /usr/src/linux-4.12.0-gentoo/include/linux/kconfig.h  -I/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv -I/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=core2 -mno-red-zone -mcmodel=kernel -funit-at-a-time -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -DCONFIG_AS_AVX512=1 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -fno-delete-null-pointer-checks -O2 --param=allow-store-data-races=0 -DCC_HAVE_ASM_GOTO -fno-stack-protector -Wno-unused-but-set-variable -fomit-frame-pointer -fno-var-tracking-assignments -fno-inline-functions-called-once -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -include /var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/include/VBox/SUPDrvMangling.h  -I/usr/src/linux/include  -I/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/  -I/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/include  -I/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux  -I/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/vboxdrv/  -I/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/vboxdrv/include  -I/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/vboxdrv/r0drv/linux -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING -DSUPDRV_WITH_RELEASE_LOGGER -Wno-declaration-after-statement -DCONFIG_VBOXDRV_AS_MISC -DRT_ARCH_AMD64 -DVBOX_WITH_64_BITS_GUESTS -fno-omit-frame-pointer -fno-pie  -DMODULE  -DKBUILD_BASENAME='"mp_r0drv_linux"'  -DKBUILD_MODNAME='"vboxdrv"' -c -o /var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/mp-r0drv-linux.o /var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/mp-r0drv-linux.c
cc1: some warnings being treated as errors
make[4]: *** [/usr/src/linux-4.12.0-gentoo/scripts/Makefile.build:302: /var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/alloc-r0drv-linux.o] Error 1
make[4]: *** Waiting for unfinished jobs....
/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/memobj-r0drv-linux.c: In function ‘rtR0MemObjLinuxVirtToPage’:
/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/memobj-r0drv-linux.c:922:27: error: passing argument 1 of ‘pud_offset’ from incompatible pointer type [-Werror=incompatible-pointer-types]
     u.Upper = *pud_offset(&u.Global, ulAddr);
                           ^
In file included from /usr/src/linux-4.12.0-gentoo/include/linux/mm.h:70:0,
                 from /var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/the-linux-kernel.h:98,
                 from /var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/memobj-r0drv-linux.c:31:
/usr/src/linux-4.12.0-gentoo/arch/x86/include/asm/pgtable.h:826:22: note: expected ‘p4d_t * {aka struct <anonymous> *}’ but argument is of type ‘pgd_t * {aka struct <anonymous> *}’
 static inline pud_t *pud_offset(p4d_t *p4d, unsigned long address)
                      ^
cc1: some warnings being treated as errors
make[4]: *** [/usr/src/linux-4.12.0-gentoo/scripts/Makefile.build:302: /var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/memobj-r0drv-linux.o] Error 1
make[3]: *** [/usr/src/linux-4.12.0-gentoo/Makefile:1512: _module_/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv] Error 2
make[3]: Leaving directory '/usr/src/linux-4.12.0-gentoo'
make[2]: *** [Makefile:152: sub-make] Error 2
make[2]: Leaving directory '/usr/src/linux-4.12.0-gentoo'
make[1]: *** [Makefile:304: vboxdrv] Error 2
make[1]: Leaving directory '/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv'
make: *** [Makefile:41: all] Error 2
 * ERROR: app-emulation/virtualbox-modules-5.1.22::gentoo failed (compile phase):
 *   emake failed
Comment 3 Nick 2017-07-03 20:41:54 UTC
There is a patch from oracle, but it does not currently work for me; the modules compile, but when I actually try to start a virtual machine my desktop environment freezes and becomes unresponsive.

(see http://mom.hlmjr.com/2017/05/28/bleeding-on-the-edge-app-emulationvirtualbox-modules-5-1-22-vs-kernel-4-12-0-rc2/ and https://www.virtualbox.org/changeset/66927/vbox)
Comment 4 Perfect Gentleman 2017-07-04 06:42:35 UTC
(In reply to Nick from comment #3)
> There is a patch from oracle, but it does not currently work for me; the
> modules compile, but when I actually try to start a virtual machine my
> desktop environment freezes and becomes unresponsive.
> 
> (see
> http://mom.hlmjr.com/2017/05/28/bleeding-on-the-edge-app-emulationvirtualbox-
> modules-5-1-22-vs-kernel-4-12-0-rc2/ and
> https://www.virtualbox.org/changeset/66927/vbox)

the same
Comment 5 Silvio 2017-07-04 06:58:41 UTC
same here
Comment 6 poncho 2017-07-04 07:18:58 UTC
Created attachment 480618 [details]
build.log "undefined named operand ‘new’"

It's failing here as well with "undefined named operand ‘new’"

In file included from /usr/src/linux-4.12.0/include/linux/atomic.h:4:0,
                 from /usr/src/linux-4.12.0/include/linux/jump_label.h:183,
                 from /usr/src/linux-4.12.0/arch/x86/include/asm/string_64.h:5,
                 from /usr/src/linux-4.12.0/arch/x86/include/asm/string.h:4,
                 from /usr/src/linux-4.12.0/include/linux/string.h:18,
                 from /var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/include/iprt/string.h:37,
                 from /var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/SUPDrvInternal.h:43,
                 from /var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/SUPDrvTracer.c:33:
/usr/src/linux-4.12.0/arch/x86/include/asm/atomic.h: In function ‘atomic_try_cmpxchg’:
/usr/src/linux-4.12.0/arch/x86/include/asm/atomic.h:192:2: error: undefined named operand ‘new’
  return try_cmpxchg(&v->counter, old, new);
Comment 7 Pacho Ramos gentoo-dev 2017-07-04 10:01:47 UTC
*** Bug 623730 has been marked as a duplicate of this bug. ***
Comment 8 Thomas Scheiblauer 2017-07-05 11:20:45 UTC
There actually seem  to bee two different build problems. The one which can be fixed with Oracle's page-table patch and the one resulting in "error: undefined named operand ‘new’" compiler errors.
Comment 9 Konstantinos Smanis 2017-07-05 11:30:35 UTC
I have found and applied patches for both issues and the ebuild is successfully emerged. However, the kernel panics whenever I launch a VM (I haven't found a patch for this issue as of yet). I will attach the aforementioned patches below for anyone interested.
Comment 10 Konstantinos Smanis 2017-07-05 11:31:28 UTC
Created attachment 480830 [details, diff]
Patch 1/2
Comment 11 Konstantinos Smanis 2017-07-05 11:31:44 UTC
Created attachment 480832 [details, diff]
Patch 2/2
Comment 12 Herb Miller Jr. 2017-07-05 12:07:21 UTC
What is causing the need for patch 1? I can't seem to reproduce that issues but I want to understand it better.
Comment 13 Matt 2017-07-05 12:38:34 UTC
I'm getting a different failure than what others have reported so far.

~~~~~~~~~

In file included from /usr/local/portage/tmpdir/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/alloc-r0drv-linux.c:31:0:
/usr/local/portage/tmpdir/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/alloc-r0drv-linux.c: In function ‘VBoxHost_RTMemContAlloc’:
/usr/local/portage/tmpdir/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/the-linux-kernel.h:323:47: error: implicit declaration of function ‘set_pages_x’ [-Werror=implicit-function-declaration]
 # define MY_SET_PAGES_EXEC(pPages, cPages)    set_pages_x(pPages, cPages)
                                               ^
/usr/local/portage/tmpdir/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/alloc-r0drv-linux.c:445:13: note: in expansion of macro ‘MY_SET_PAGES_EXEC’
             MY_SET_PAGES_EXEC(&paPages[iPage], 1);
             ^
/usr/local/portage/tmpdir/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/alloc-r0drv-linux.c: In function ‘VBoxHost_RTMemContFree’:
/usr/local/portage/tmpdir/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/the-linux-kernel.h:324:47: error: implicit declaration of function ‘set_pages_nx’ [-Werror=implicit-function-declaration]
 # define MY_SET_PAGES_NOEXEC(pPages, cPages)  set_pages_nx(pPages, cPages)
                                               ^
/usr/local/portage/tmpdir/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/alloc-r0drv-linux.c:493:13: note: in expansion of macro ‘MY_SET_PAGES_NOEXEC’
             MY_SET_PAGES_NOEXEC(&paPages[iPage], 1);
             ^
cc1: some warnings being treated as errors

~~~~~~~~~

I'm still on 32bit x86 (long story...).

sys-kernel/linux-firmware-20170314
sys-kernel/linux-headers-4.4
sys-devel/gcc-5.4.0-r3
Comment 14 Pacho Ramos gentoo-dev 2017-07-05 15:19:24 UTC
Created attachment 480840 [details, diff]
4.12.patch

This patch is from rpmfusion packages for fedora
Comment 15 Konstantinos Smanis 2017-07-06 16:54:27 UTC
Created attachment 481450 [details, diff]
Revised Patch 2/2

Using "Patch 1/2" and "Revised Patch 2/2" I managed to successfully emerge the ebuild and VirtualBox no longer hangs (Win7 guest).
Comment 16 Thomas Scheiblauer 2017-07-07 06:47:38 UTC
I can confirm that.
Comment 17 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2017-07-09 08:19:15 UTC
*** Bug 624328 has been marked as a duplicate of this bug. ***
Comment 18 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2017-07-09 08:20:45 UTC
Upstream is already working on the 5.1.24 release which is supposed to fix this issue.
Comment 19 jospezial 2017-07-16 07:17:38 UTC
app-emulation/virtualbox-modules-5.1.22 fails to compile against linux-4.13-rc1 because of this:

sched/wait: Rename wait_queue_t => wait_queue_entry_t

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ac6424b981bce1c4bc55675c6ce11bfe1bbfa64f



In file included from /var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/semevent-r0drv-linux.c:42:0:
/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/waitqueue-r0drv-linux.h:49:5: error: unknown type name ‘wait_queue_t’
     wait_queue_t    WaitQE;
     ^~~~~~~~~~~~
In file included from /usr/src/linux-4.13-rc1/include/linux/mmzone.h:9:0,
                 from /usr/src/linux-4.13-rc1/include/linux/gfp.h:5,
                 from /usr/src/linux-4.13-rc1/include/linux/slab.h:14,
                 from /var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/the-linux-kernel.h:82,
                 from /var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/semevent-r0drv-linux.c:32:
/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/waitqueue-r0drv-linux.h: In function ‘rtR0SemLnxWaitInit’:
/usr/src/linux-4.13-rc1/include/linux/wait.h:962:9: error: request for member ‘private’ in something not a structure or union
   (wait)->private = current;     \
         ^
/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/waitqueue-r0drv-linux.h:179:5: note: in expansion of macro ‘init_wait’
     init_wait((&pWait->WaitQE));
     ^~~~~~~~~
/usr/src/linux-4.13-rc1/include/linux/wait.h:963:9: error: request for member ‘func’ in something not a structure or union
   (wait)->func = autoremove_wake_function;   \
         ^
/var/tmp/portage/app-emulation/virtualbox-modules-5.1.22/work/vboxdrv/r0drv/linux/waitqueue-r0drv-linux.h:179:5: note: in expansion of macro ‘init_wait’
     i
Comment 20 Knut Masanetz 2017-07-18 20:48:25 UTC
Virtualbox 5.1.24 released.
 See https://www.virtualbox.org/

Changelog: https://www.virtualbox.org/wiki/Changelog#v24
Comment 21 André 2017-07-19 21:07:52 UTC
That was fast and I confirm that fixed it for me on kernel 4.12.0-gentoo and virtualbox-bin 5.1.24.117012.
Well done to the ebuild maintainers, that was again a fast integration.
Comment 22 jospezial 2017-07-20 00:21:49 UTC
fixed in 5.1.24 for kernel 4.13 too.
Comment 23 Brian Evans (RETIRED) gentoo-dev 2017-08-16 18:10:02 UTC
*** Bug 625526 has been marked as a duplicate of this bug. ***