Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 880229 - app-emulation/virtualbox-modules fails to build: error: ‘VMX_BF_EPT_PT_1_SHIFT’ undeclared
Summary: app-emulation/virtualbox-modules fails to build: error: ‘VMX_BF_EPT_PT_1_SHIF...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: Viorel Munteanu
URL: https://www.virtualbox.org/ticket/21321
Whiteboard:
Keywords: PullRequest, UPSTREAM
Depends on:
Blocks:
 
Reported: 2022-11-07 16:46 UTC by Jean-Claude Repetto
Modified: 2023-04-21 16:38 UTC (History)
2 users (show)

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


Attachments
Full build log (build.log,84.33 KB, text/plain)
2022-11-07 16:47 UTC, Jean-Claude Repetto
Details
ebuild environment file (environment,89.19 KB, text/plain)
2022-11-22 11:29 UTC, Guido
Details
build log (build.log,82.46 KB, text/plain)
2022-11-22 11:32 UTC, Guido
Details
linux kernel .config (.config,109.20 KB, text/plain)
2022-11-29 20:07 UTC, Fitzgerald Krudde
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Claude Repetto 2022-11-07 16:46:28 UTC
It fails to build:
/var/tmp/portage/app-emulation/virtualbox-modules-7.0.2/work/vboxdrv/include/VBox/vmm/hm_vmx.h:532:29: error: ‘VMX_BF_EPT_PT_1_SHIFT’ undeclared here (not in a function); did you mean ‘VMX_BF_EPT_PT_READ_SHIFT’?
  532 | RT_BF_ASSERT_COMPILE_CHECKS(VMX_BF_EPT_PT_, UINT64_C(0), UINT64_MAX,
      |                             ^~~~~~~~~~~~~~


Reproducible: Always
Comment 1 Jean-Claude Repetto 2022-11-07 16:47:08 UTC
Created attachment 828489 [details]
Full build log
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-11-08 06:25:14 UTC
Please include emerge --info.
Comment 3 Jean-Claude Repetto 2022-11-08 07:56:24 UTC
emerge --info '=app-emulation/virtualbox-modules-7.0.2::gentoo'
Portage 3.0.38.1 (python 3.10.8-final-0, default/linux/amd64/17.1, gcc-11.3.0, glibc-2.35-r8, 5.10.76-gentoo-r1 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.10.76-gentoo-r1-x86_64-Intel-R-_Core-TM-_i5-3550_CPU_@_3.30GHz-with-glibc2.35
KiB Mem:     7851104 total,   6522812 free
KiB Swap:   16777212 total,  16777212 free
Timestamp of repository gentoo: Mon, 07 Nov 2022 16:00:01 +0000
Head commit of repository gentoo: eaceccfa7548d133e33add079ba76618a39730f8
sh bash 5.1_p16-r2
ld GNU ld (Gentoo 2.38 p4) 2.38
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r2::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.34.1-r4::gentoo
dev-lang/python:           2.7.18_p16::gentoo, 3.8.15_p2::gentoo, 3.9.15_p2::gentoo, 3.10.8_p2::gentoo, 3.11.0_p1::gentoo
dev-lang/rust:             1.64.0-r1::gentoo
dev-util/cmake:            3.24.2::gentoo
dev-util/meson:            0.63.2-r1::gentoo
sys-apps/baselayout:       2.8::gentoo
sys-apps/openrc:           0.45.2-r1::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-devel/autoconf:        2.13-r2::gentoo, 2.71-r1::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.38-r2::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/clang:           14.0.6-r1::gentoo, 15.0.3::gentoo
sys-devel/gcc:             11.3.0::gentoo
sys-devel/gcc-config:      2.8::gentoo
sys-devel/libtool:         2.4.7::gentoo
sys-devel/lld:             14.0.6-r1::gentoo, 15.0.3::gentoo
sys-devel/llvm:            14.0.6-r2::gentoo, 15.0.3::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/glibc:            2.35-r8::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts: 

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 0

eclipse
    location: /var/lib/layman/eclipse
    masters: gentoo
    priority: 50

mate-de-gentoo
    location: /var/lib/layman/mate-de-gentoo
    masters: gentoo
    priority: 50

vaca
    location: /var/lib/layman/vaca
    masters: gentoo
    priority: 50

zugaina
    location: /var/lib/layman/zugaina
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* PUEL dlj-1.1 AdobeFlash-10.3 googleearth Oracle-BCLA-JavaSE AdobeFlash-11.x license(s)"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /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 /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live 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 qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="fr_FR.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="fr en"
MAKEOPTS="-j5"
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"
SHELL="/bin/bash"
USE="X alsa amd64 apache2 branding bzip2 cairo cli consolekit corefonts dbus dhclient django dri dv dvb dvd dvdnav dvdr dvi ecwj2k elogind exif expat ffmpeg firefox flac gcrypt gdbm geos gif gnutls gtk hwdb iconv icu java jpeg keymap libglvnd libsamplerate libtirpc live logrotate mate mjpeg mmx mp3 mpeg mtp multilib nautilus ncurses nlpsolver nls nptl nsplugin ogg openmp opus pam pcre pcre16 pdf pdfimport png pulseaudio python qt3support qt5 readline samba seccomp spatialite split-usr sqlite sqlite3 sse sse2 ssl svg svg2 taglib test-rust threads tiff truetype unicode v4l vidstab visio vorbis winbind x264 xattr zlib" ABI_X86="64" ADA_TARGET="gnat_2020" 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="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" L10N="fr" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" RUBY_TARGETS="ruby27" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 4 Guido 2022-11-21 17:03:33 UTC
same problem with version 7.0.4
Comment 5 Viorel Munteanu gentoo-dev 2022-11-22 06:21:42 UTC
I could not reproduce this problem yet.

If you are not the same person as the bug reporter could you please also post an emerge --info?

Also what kernel do you have installed - the exact package name (i.e., sys-kernel/gentoo-sources or sys-kernel/gentoo-kernel-bin or sys-kernel/gentoo-kernel or whatever else) and how was it installed (genkernel or manually?)
Comment 6 Jean-Claude Repetto 2022-11-22 08:11:37 UTC
Hi,
I upgraded the gentoo kernel from linux-5.10.76-gentoo-r1 to linux-5.15.75-gentoo, and it solved the problem.
Comment 7 Guido 2022-11-22 11:29:23 UTC
Created attachment 835863 [details]
ebuild environment file
Comment 8 Guido 2022-11-22 11:32:59 UTC
Created attachment 835865 [details]
build log
Comment 9 Jean-Claude Repetto 2022-11-23 16:22:23 UTC
Guido, could you try to update your kernel to verify if it solves your problem like it did for me?
Comment 10 Guido 2022-11-23 16:37:24 UTC
Ok, I can try this. 
I need to check if the 5.15 kernel supports nvidia-drivers-390.xxx
I'll update you as soon as possible.
Comment 11 Guido 2022-11-24 14:35:25 UTC
I confirm that using the 5.15.79 kernel, the compilation takes place as expected.

My computer won't boot with this kernel, but that's another problem.
Comment 12 Fitzgerald Krudde 2022-11-27 18:41:56 UTC
I have the same issue. I am using kernel version 4.19.264-gentoo

I think the cause is that the C preprocessor is processing vboxdrv/include/VBox/vmm/hm_vmx.h line 523:

RT_BF_ASSERT_COMPILE_CHECKS(VMX_BF_EPT_PT_, UINT64_C(0), UINT64_MAX,
                            (READ, WRITE, EXECUTE, MEMTYPE, IGNORE_PAT, IGN_7, ACCESSED, DIRTY, EXECUTE_USER, IGN_59_11,
                            SUPER_SHW_STACK, IGN_62_61, SUPPRESS_VE));

and replacing READ with '0' (and WRITE with '1') due to the header file: tools/virtio/linux/kernel.h

which has (line 29):
/* generic data direction definitions */
#define READ                    0
#define WRITE                   1

The newest Linux kernel (6.0.10) also has the definition for READ in the tools/virtio/linux/kernel.h so I would assume the issue also exists there.
Comment 13 Viorel Munteanu gentoo-dev 2022-11-28 08:47:06 UTC
(In reply to Guido from comment #11)
> I confirm that using the 5.15.79 kernel, the compilation takes place as
> expected.
> 
> My computer won't boot with this kernel, but that's another problem.

There are newer 5.10 kernels also, I tried with 5.10.150 and 5.4.220 and it seems to work.
Comment 14 Viorel Munteanu gentoo-dev 2022-11-28 08:51:38 UTC
(In reply to Fitzgerald Krudde from comment #12)
> I have the same issue. I am using kernel version 4.19.264-gentoo
> 
> I think the cause is that the C preprocessor is processing
> vboxdrv/include/VBox/vmm/hm_vmx.h line 523:
> 
> RT_BF_ASSERT_COMPILE_CHECKS(VMX_BF_EPT_PT_, UINT64_C(0), UINT64_MAX,
>                             (READ, WRITE, EXECUTE, MEMTYPE, IGNORE_PAT,
> IGN_7, ACCESSED, DIRTY, EXECUTE_USER, IGN_59_11,
>                             SUPER_SHW_STACK, IGN_62_61, SUPPRESS_VE));
> 
> and replacing READ with '0' (and WRITE with '1') due to the header file:
> tools/virtio/linux/kernel.h
> 
> which has (line 29):
> /* generic data direction definitions */
> #define READ                    0
> #define WRITE                   1
> 
> The newest Linux kernel (6.0.10) also has the definition for READ in the
> tools/virtio/linux/kernel.h so I would assume the issue also exists there.

I tried with kernel 4.19.264-gentoo and it still works for me.  Can you attach the .config file?  I used `make allyesconfig`
Comment 15 Guido 2022-11-28 11:50:46 UTC
Well, for me the bug is fixed. 
Many thanks.
Comment 16 Fitzgerald Krudde 2022-11-29 20:07:11 UTC
Created attachment 838357 [details]
linux kernel .config
Comment 17 Viorel Munteanu gentoo-dev 2022-11-30 07:40:04 UTC
(In reply to Fitzgerald Krudde from comment #16)
> Created attachment 838357 [details]
> linux kernel .config

Thank you!  I reproduces the issue.

You were right, the problem comes from kernel.h, but that doesn't get included if you set CONFIG_JUMP_LABEL.

Setting "General architecture-dependent options  ---> Optimize very unlikely/likely branches" solves the issue.
Comment 18 Viorel Munteanu gentoo-dev 2022-11-30 07:40:50 UTC
*I reproduced,  sorry.
Comment 19 Fitzgerald Krudde 2022-11-30 11:16:30 UTC
(In reply to Viorel Munteanu from comment #17)
> (In reply to Fitzgerald Krudde from comment #16)
> > Created attachment 838357 [details]
> > linux kernel .config
> 
> Thank you!  I reproduces the issue.
> 
> You were right, the problem comes from kernel.h, but that doesn't get
> included if you set CONFIG_JUMP_LABEL.
> 
> Setting "General architecture-dependent options  ---> Optimize very
> unlikely/likely branches" solves the issue.


@Viorel that is a nice catch! Completely unexpected side effect for me.
I will set the flag and retry.

I still find it weird that the VirtualBox kernel-modules compilation depends on this.

This can be easily fixed in the VirtualBox hm_vmx.h but I guess I will need to file a bug report for virtualbox.org then
Comment 20 Fitzgerald Krudde 2022-11-30 11:32:33 UTC
I have created  a bug report at VirtualBox: https://www.virtualbox.org/ticket/21321
Comment 21 Viorel Munteanu gentoo-dev 2022-11-30 11:35:02 UTC
Nice.  Thanks
Comment 22 Fitzgerald Krudde 2022-11-30 13:50:26 UTC
(In reply to Viorel Munteanu from comment #17)
> (In reply to Fitzgerald Krudde from comment #16)
> > Created attachment 838357 [details]
> > linux kernel .config
> 
> Thank you!  I reproduces the issue.
> 
> You were right, the problem comes from kernel.h, but that doesn't get
> included if you set CONFIG_JUMP_LABEL.
> 
> Setting "General architecture-dependent options  ---> Optimize very
> unlikely/likely branches" solves the issue.

Yes, setting CONFIG_JUMP_LABEL to true also fixes it here
Comment 23 Larry the Git Cow gentoo-dev 2023-04-21 16:38:27 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c0bce2f517147970c05ac7c809ff31b83477509

commit 7c0bce2f517147970c05ac7c809ff31b83477509
Author:     Viorel Munteanu <ceamac@gentoo.org>
AuthorDate: 2023-04-18 16:45:22 +0000
Commit:     Viorel Munteanu <ceamac@gentoo.org>
CommitDate: 2023-04-21 16:35:22 +0000

    app-emulation/virtualbox-modules: add 7.0.8
    
    Bug: https://bugs.gentoo.org/760102
    Closes: https://bugs.gentoo.org/880229
    Signed-off-by: Viorel Munteanu <ceamac@gentoo.org>

 app-emulation/virtualbox-modules/Manifest          |  1 +
 .../virtualbox-modules-7.0.8.ebuild                | 81 ++++++++++++++++++++++
 2 files changed, 82 insertions(+)