Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

[Solved] Virtualbox fails to build with error: ‘asm’ operand

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
2 posts • Page 1 of 1
Author
Message
paddlaren
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 146
Joined: Wed Nov 23, 2005 7:45 am
Location: Hörby, Sweden

[Solved] Virtualbox fails to build with error: ‘asm’ operand

  • Quote

Post by paddlaren » Mon Mar 02, 2026 1:49 pm

I have trouble building Virtualbox after an update. Has been for a while but now some dependencies enforces the rebuild so I can't procrastinate any more.

The compilation error is:

Code: Select all

x86_64-pc-linux-gnu-gcc -m32 -c -O2 -march=znver4 -mavx512vp2intersect -mavx512f -mavx512bw -mavx512cd -mavx512dq -mavx512vl -mavxvnni -mmovdir64b -mmovdiri -mshstk --param=l1-cache-line-size=64 --param=l1-cache-size=48 --param=l2-cache-size=1024 -fno-pie -fcommon -ffreestanding -ffunction-sections -march=i386 -mtune=i386 -fno-unroll-loops -fomit-frame-pointer -fstrength-reduce -falign-jumps=1 -falign-loops=1 -Os -falign-functions=1 -mpreferred-stack-boundary=2 -mregparm=3 -mrtd -freg-struct-return -fshort-wchar -Ui386 -Ulinux -include compiler.h -Wall -W -Wformat-nonliteral -fno-stack-protector -fno-dwarf2-cfi-asm -Wno-address -fcf-protection=none -I/var/tmp/portage/app-emulation/virtualbox-7.2.6-r1/work/VirtualBox-7.2.6/src/VBox/Devices/PC/ipxe/vbox -I/var/tmp/portage/app-emulation/virtualbox-7.2.6-r1/work/VirtualBox-7.2.6/src/VBox/Devices/PC/ipxe/src -I/var/tmp/portage/app-emulation/virtualbox-7.2.6-r1/work/VirtualBox-7.2.6/src/VBox/Devices/PC/ipxe/src/include -I/var/tmp/portage/app-emulation/virtualbox-7.2.6-r1/work/VirtualBox-7.2.6/src/VBox/Devices/PC/ipxe/src/arch/x86/include -I/var/tmp/portage/app-emulation/virtualbox-7.2.6-r1/work/VirtualBox-7.2.6/src/VBox/Devices/PC/ipxe/src/arch/i386/include -I/var/tmp/portage/app-emulation/virtualbox-7.2.6-r1/work/VirtualBox-7.2.6/src/VBox/Devices/PC/ipxe/src/arch/i386/include/pcbios -I/var/tmp/portage/app-emulation/virtualbox-7.2.6-r1/work/VirtualBox-7.2.6/include -I/var/tmp/portage/app-emulation/virtualbox-7.2.6-r1/work/VirtualBox-7.2.6/out/linux.amd64/release -DVBOX -DVBOX_OSE -DRT_OS_LINUX -D_FILE_OFFSET_BITS=64 -DRT_ARCH_AMD64 -D__AMD64__ -DVBOX_WITH_HARDENING "-DRTPATH_APP_PRIVATE=\"/usr/share/virtualbox\"" "-DRTPATH_APP_PRIVATE_ARCH=\"/usr/lib64/virtualbox\"" "-DRTPATH_SHARED_LIBS=\"/usr/lib64/virtualbox\"" "-DRTPATH_APP_DOCS=\"/usr/share/doc/virtualbox-7.2.6-r1\"" -DARCH=i386 -DPLATFORM=pcbios -DVERSION_MAJOR=1 -DVERSION_MINOR=21 -DVERSION_PATCH=1 -DASM_TCHAR=@ -DASM_TCHAR_OPS=@ "-DVERSION=\"1.21.1\"" "-DBUILD_NAME=\"VBox\"" -DOBJECT=x86_tcpip -Wp,-MD,/var/tmp/portage/app-emulation/virtualbox-7.2.6-r1/work/VirtualBox-7.2.6/out/linux.amd64/release/obj/iPxeBaseBin/src/arch/x86/core/x86_tcpip.o.dep -Wp,-MT,/var/tmp/portage/app-emulation/virtualbox-7.2.6-r1/work/VirtualBox-7.2.6/out/linux.amd64/release/obj/iPxeBaseBin/src/arch/x86/core/x86_tcpip.o -Wp,-MP -o /var/tmp/portage/app-emulation/virtualbox-7.2.6-r1/work/VirtualBox-7.2.6/out/linux.amd64/release/obj/iPxeBaseBin/src/arch/x86/core/x86_tcpip.o /var/tmp/portage/app-emulation/virtualbox-7.2.6-r1/work/VirtualBox-7.2.6/src/VBox/Devices/PC/ipxe/src/arch/x86/core/x86_tcpip.c
/var/tmp/portage/app-emulation/virtualbox-7.2.6-r1/work/VirtualBox-7.2.6/src/VBox/Devices/PC/ipxe/src/arch/x86/core/x86_tcpip.c: In function ‘tcpip_continue_chksum’:
/var/tmp/portage/app-emulation/virtualbox-7.2.6-r1/work/VirtualBox-7.2.6/src/VBox/Devices/PC/ipxe/src/arch/x86/core/x86_tcpip.c:90:9: error: ‘asm’ operand has impossible constraints or there are not enough registers
   90 |         __asm__ ( /* Calculate position at which to jump into the
      |         ^~~~~~~
kmk: *** [/usr/share/kBuild/footer-pass2-compiling-targets.kmk:272: /var/tmp/portage/app-emulation/virtualbox-7.2.6-r1/work/VirtualBox-7.2.6/out/linux.amd64/release/obj/iPxeBaseBin/src/arch/x86/core/x86_tcpip.o] Error 1


I have tried several of versions available today:

Code: Select all

# eix virtualbox
* app-emulation/virtualbox
     Available versions:  7.0.26-r1(0/7.0)^t 7.1.14(0/7.1)^t (~)7.1.16-r1(0/7.1)^t 7.2.4-r1(0/7.2)^t (~)7.2.6-r1(0/7.2)^t **9999(0/9999)*l^t {alsa dbus debug dist-kernel doc dtrace +gui java lvm modules-compress modules-sign nls +opengl pam pch pulseaudio python +sdk +sdl +strip test +udev vboxwebsrv vde +vmmraw vnc PYTHON_SINGLE_TARGET="python3_11 python3_12 python3_13 python3_14"}
     Homepage:            https://www.virtualbox.org/ https://github.com/VirtualBox/virtualbox
     Description:         Family of powerful x86 virtualization products for enterprise and home use

All seems to fail the same. Also tried to build without any MAKEOPTS but no cigarr.

I have also bumped in the incompatibility with kernel 19 but reverted to kernel 18 to get around that one, the ticket is not solved or released.

My normal cpu-flags for a AMD Ryzen 9 9950X are:

Code: Select all

COMMON_FLAGS="-march=znver4 -mavx512vp2intersect -mavx512f -mavx512bw -mavx512cd -mavx512dq -mavx512vl -mavxvnni -mmovdir64b -mmovdiri -mshstk --param=l1-cache-line-size=64 --param=l1-cache-size=48 --param=l2-cache-size=1024  -O2 -pipe"


I have added package specific config where the -O2 and -pipe is left out. Either I failed or something else because it does not show in the emerge info:

Code: Select all

emerge --info =app-emulation/virtualbox-7.2.6-r1
Portage 3.0.77 (python 3.13.11-final-0, default/linux/amd64/23.0/desktop/plasma, gcc-15, glibc-2.42-r5, 6.18.12-gentoo-dist x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.18.12-gentoo-dist-x86_64-AMD_Ryzen_9_9950X_16-Core_Processor-with-glibc2.42
KiB Mem:   129385436 total, 117694928 free
KiB Swap:  134217344 total, 134217344 free
Timestamp of repository gentoo: Sun, 01 Mar 2026 14:45:00 +0000
Head commit of repository gentoo: 8979847bd254d3cd5e45db8c34fec585c5311e0b
Head commit of repository gentoo-zh: 335aa4437a7a8c4248715d5af65eedc1077c3a62

Head commit of repository jaredallard-overlay: 799b7f23656870e54cf9c963b35bc4390d06cbd4

sh bash 5.3_p9
ld GNU ld (Gentoo 2.45.1 p1) 2.45.1
distcc 3.4 x86_64-pc-linux-gnu [disabled]
app-misc/pax-utils:        1.3.10::gentoo
app-shells/bash:           5.3_p9::gentoo
dev-build/autoconf:        2.72-r6::gentoo
dev-build/automake:        1.18.1::gentoo
dev-build/cmake:           4.1.4::gentoo
dev-build/libtool:         2.5.4::gentoo options where 
dev-build/make:            4.4.1-r102::gentoo
dev-build/meson:           1.10.1::gentoo
dev-java/java-config:      2.3.4::gentoo
dev-lang/erlang:           28.3::gentoo
dev-lang/perl:             5.42.0-r1::gentoo
dev-lang/python:           3.13.11::gentoo, 3.14.2::gentoo
dev-lang/rust-bin:         1.92.0::gentoo
llvm-core/clang:           21.1.8::gentoo
llvm-core/lld:             21.1.8::gentoo
llvm-core/llvm:            21.1.8::gentoo
sys-apps/baselayout:       2.18::gentoo
sys-apps/openrc:           0.62.10::gentoo
sys-apps/sandbox:          2.46::gentoo
sys-devel/binutils:        2.45.1::gentoo
sys-devel/binutils-config: 5.6::gentoo
sys-devel/gcc:             15.2.1_p20260214::gentoo
sys-devel/gcc-config:      2.12.2::gentoo
sys-kernel/linux-headers:  6.18::gentoo (virtual/os-headers)
sys-libs/glibc:            2.42-r5::gentoo
Repositories:

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

gentoo-zh
    location: /var/db/repos/gentoo-zh
    sync-type: git
    sync-uri: https://github.com/microcai/gentoo-zh.git
    masters: gentoo
    volatile: False

jaredallard-overlay
    location: /var/db/repos/jaredallard-overlay
    sync-type: git
    sync-uri: https://github.com/jaredallard/overlay.git
    masters: gentoo
    volatile: False

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=znver4 -mavx512vp2intersect -mavx512f -mavx512bw -mavx512cd -mavx512dq -mavx512vl -mavxvnni -mmovdir64b -mmovdiri -mshstk --param=l1-cache-line-size=64 --param=l1-cache-size=48 --param=l2-cache-size=1024  -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /var/bind"
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"
CXXFLAGS="-march=znver4 -mavx512vp2intersect -mavx512f -mavx512bw -mavx512cd -mavx512dq -mavx512vl -mavxvnni -mmovdir64b -mmovdiri -mshstk --param=l1-cache-line-size=64 --param=l1-cache-size=48 --param=l2-cache-size=1024  -O2 -pipe"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE 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="-march=znver4 -mavx512vp2intersect -mavx512f -mavx512bw -mavx512cd -mavx512dq -mavx512vl -mavxvnni -mmovdir64b -mmovdiri -mshstk --param=l1-cache-line-size=64 --param=l1-cache-size=48 --param=l2-cache-size=1024  -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live compress-index config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=znver4 -mavx512vp2intersect -mavx512f -mavx512bw -mavx512cd -mavx512dq -mavx512vl -mavxvnni -mmovdir64b -mmovdiri -mshstk --param=l1-cache-line-size=64 --param=l1-cache-size=48 --param=l2-cache-size=1024  -O2 -pipe"
GENTOO_MIRRORS="http://mirrors.dotsrc.org/gentoo/"
LANG="C.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"
LEX="flex"
LINGUAS="sv en sv_SE en_GB en_US"
MAKEOPTS="-j33 -l32"
PKGDIR="/var/cache/binpkgs"
PORTAGE_COMPRESS="bzip2"
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 a52 aac acl acpi activities alsa amd64 avif bluetooth branding btrfs bzip2 cairo cdda cdr cet cmake crypt cryptsetup cups dbus declarative dist-kernel dri dts dvd dvdr elogind encode exif flac gdbm gif git gpm gtk gui iconv icu ipv6 jpeg jpegxl kde kwallet lcms libnotify libtirpc lspclient mad mercurial mng mp3 mp4 mpeg multilib ncurses networkmanager nls ogg opengl openmp pam pango pcre pdf pipewire plasma png policykit ppds pulseaudio qml qt6 readline screencast sdl seccomp semantic-desktop sna sound spell ssl startup-notification svg test-rust tiff truetype udev udisks unicode upower usb vaapi vorbis vulkan wayland webp widgets wxwidgets x264 xattr xcb xft xml xv xvid zlib" ABI_X86="64" ADA_TARGET="gcc_15" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 aes avx avx2 avx512_bf16 avx512_bitalg avx512_vbmi2 avx512_vnni avx512_vp2intersect avx512_vpopcntdq avx512bw avx512cd avx512dq avx512f avx512ifma avx512vbmi avx512vl f16c fma3 pclmul popcnt rdrand sha sse3 sse4_1 sse4_2 sse4a ssse3 vpclmulqdq" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax navcom oncore skytraq superstar2 tsip tripmate tnt" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="evdev eyboard mouse wacom" KERNEL="linux" L10N="sv en en-GB en-US" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LLVM_TARGETS="X86" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-3" POSTGRES_TARGETS="postgres17" PYTHON_SINGLE_TARGET="python3_13" PYTHON_TARGETS="python3_13" QEMU_SOFTMMU_TARGETS="x86_64 sparc arm i386" QEMU_USER_TARGETS="x86_64" RUBY_TARGETS="ruby32 ruby33" SANE_BACKENDS="epson2" VIDEO_CARDS="amdgpu radeonsi" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto 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, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Anyonw know how to deal with this?

Thanx,
Erik
Last edited by paddlaren on Tue Mar 03, 2026 8:13 am, edited 1 time in total.
Top
paddlaren
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 146
Joined: Wed Nov 23, 2005 7:45 am
Location: Hörby, Sweden

  • Quote

Post by paddlaren » Tue Mar 03, 2026 8:13 am

Changed CPU-flags to:

Code: Select all

COMMON_FLAGS="-march=native -O2 -pipe"
and things works OK.

The reason I had the CPU-flags I had is that I migrated to this CPU before -march=native it was supported by by GCC.

VirtualBox installed and calm is back on the farm.
Top
Post Reply

2 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic