Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 878411 - www-client/chromium-107.0.5304.29: AVX vector return of type '__m512' (vector of 16 'float' values) without 'avx512f' enabled changes the ABI
Summary: www-client/chromium-107.0.5304.29: AVX vector return of type '__m512' (vector...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Chromium Project
URL:
Whiteboard:
Keywords:
: 890593 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-10-26 22:30 UTC by Zoltan Puskas
Modified: 2023-01-12 21:34 UTC (History)
2 users (show)

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


Attachments
Compressed build.log (build.log.zst,888.71 KB, application/zstd)
2022-10-26 22:51 UTC, Zoltan Puskas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zoltan Puskas 2022-10-26 22:30:51 UTC
# emerge --info
Portage 3.0.38.1 (python 3.10.8-final-0, default/linux/amd64/17.1/desktop/plasma/systemd, gcc-11, glibc-2.36-r5, 6.0.0-gentoo-x86_64 x86_64)
=================================================================
System uname: Linux-6.0.0-gentoo-x86_64-x86_64-Intel-R-_Core-TM-_i7-8650U_CPU_@_1.90GHz-with-glibc2.36
KiB Mem:    24368636 total,  10111588 free
KiB Swap:    2198504 total,   1979304 free
Timestamp of repository gentoo: Sun, 23 Oct 2022 22:15:01 +0000
Head commit of repository gentoo: 201ed022afc286de68bfcd87fb2cf961b0e99d0a
Timestamp of repository SwordArMor: 1
Head commit of repository SwordArMor: eb36030c31f05fd654dd2bfdb3bb7342c56818e3

Head commit of repository sinustrom: d2980771a4f976d1df0cbf62ebd563bc519bdef5

sh bash 5.1_p16-r2
ld GNU ld (Gentoo 2.38 p4) 2.38
distcc 3.4 x86_64-pc-linux-gnu [enabled]
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.36.0::gentoo
dev-lang/python:           3.9.13::gentoo, 3.10.8::gentoo, 3.11.0_rc2_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.9::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-apps/systemd:          251.6::gentoo
sys-devel/autoconf:        2.13-r3::gentoo, 2.71-r4::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.38-r2::gentoo, 2.39-r4::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.1_p20221007::gentoo
sys-devel/gcc-config:      2.8::gentoo
sys-devel/libtool:         2.4.7::gentoo
sys-devel/lld:             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:  6.0::gentoo (virtual/os-headers)
sys-libs/glibc:            2.36-r5::gentoo
Repositories:

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

SwordArMor
    location: /var/db/repos/SwordArMor
    sync-type: git
    sync-uri: https://git.grifon.fr/alarig/SwordArMor-gentoo-overlay.git
    masters: gentoo

sinustrom
    location: /var/db/repos/sinustrom
    sync-type: git
    sync-uri: https://github.com/zpuskas/sinustrom-gentoo-overlay.git
    masters: gentoo

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=broadwell -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -msgx -mbmi2 -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mrtm -mhle -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mclflushopt -mxsavec -mxsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-avx5124fmaps -mno-avx5124vnniw -mno-clwb -mno-mwaitx -mno-clzero -mno-pku -mno-rdpid --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=generic -O3 -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 /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=broadwell -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -msgx -mbmi2 -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mrtm -mhle -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mclflushopt -mxsavec -mxsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-avx5124fmaps -mno-avx5124vnniw -mno-clwb -mno-mwaitx -mno-clzero -mno-pku -mno-rdpid --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=generic -O3 -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 binpkg-multi-instance buildpkg-live cgroup collision-protect config-protect-if-modified distcc 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://mirror.csclub.uwaterloo.ca/gentoo-distfiles/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j80 -l8"
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/zsh"
USE="X a52 aac acl acpi activities aes alsa amd64 avx avx2 bash-completion bluetooth branding bzip2 cairo cdda cdr cli crypt cups dbus declarative dri dts dvd dvdr encode exif f16c flac fma3 fortran gdbm gif gphoto2 gpm gtk gui hardened iconv icu ipv6 jpeg jpeg2k kde kwallet lcms libglvnd libnotify libtirpc lm_sensors lto lzma mad mmx mmxext mng mp3 mp4 mpeg multilib ncurses networkmanager nls nptl ogg opengl openmp pam pango pclmul pcre pdf plasma png policykit popcnt posix ppds pulseaudio qml qt5 readline sdl seccomp smp spell split-usr sse sse2 sse3 sse4_1 sse4_2 ssl ssse3 startup-notification svg systemd test-rust threads tiff truetype udev udisks unicode upower usb uxa vaapi vim-syntax vorbis webp widgets wifi wxwidgets x264 xattr xcb xml xpm xv xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2020" ALSA_CARDS="hda-intel usb-audio" 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 avx2 f16c fma3 mmx mmxext pclmul 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="libinput wacom synaptics joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="x86 BPF" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" QEMU_SOFTMMU_TARGETS="x86_64 arm aarch64" QEMU_USER_TARGETS="x86_64 arm aarch64" RUBY_TARGETS="ruby27 ruby30 ruby31" SANE_BACKENDS="plustek pixma" USERLAND="GNU" VIDEO_CARDS="intel i965 iris" 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, LINGUAS, 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

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

www-client/chromium-101.0.4951.26::gentoo was built with the following:
USE="cups hangouts js-type-check official (pic) proprietary-codecs pulseaudio suid system-harfbuzz system-icu system-png vaapi (-component-build) -custom-cflags -debug -gtk4 (-headless) -kerberos -libcxx -screencast (-selinux) (-system-ffmpeg) -wayland -widevine" ABI_X86="(64)" L10N="af am ar bg bn ca cs da de el en-GB es es-419 et fa fi fil fr gu he hi hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl sr sv sw ta te th tr uk ur vi zh-CN zh-TW"
CFLAGS="-march=broadwell -mno-3dnow -mno-sse4a -mno-sha -mno-lwp -mno-xop -mno-tbm -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mtune=generic -pipe -O2"
CXXFLAGS="-march=broadwell -mno-3dnow -mno-sse4a -mno-sha -mno-lwp -mno-xop -mno-tbm -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mtune=generic -pipe -O2"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live cgroup collision-protect config-protect-if-modified distcc distlocks ebuild-locks fail-clean 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"



Reproducible: Always

Steps to Reproduce:
1. emerge -1 chromium




Build fails over avx512f support. I've tried building chromium both with and without `custom-cflags` USE flag, but it fails with the same message regardless of my choice.

`distcc` is disabled for this ebuild via portage env.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-26 22:35:50 UTC
Please attach the full build.log.
Comment 2 Zoltan Puskas 2022-10-26 22:51:15 UTC
Created attachment 825545 [details]
Compressed build.log

Raw build log is 101MB in size, and gz or bz2 were insufficient, so I had to compress it with zstd to fit into the 1000kB limit.

This build log comes from my last ditch attempt with custom-cflags enabled (in the hopes that -mno-avx512f would maybe help, since my CPU has no AVX512 instructions), but the error is exactly the same as when I built it with the default USE flags previously.
Comment 3 Matt Turner gentoo-dev 2022-10-26 23:31:28 UTC
> System uname: Linux-6.0.0-gentoo-x86_64-x86_64-Intel-R-_Core-TM-_i7-8650U_CPU_@_1.90GHz-with-glibc2.36
> ...
> -march=broadwell

8650U is a Kaby Lake, but -march=broadwell is fine because there are basically no differences between it and -march=skylake (which would be the closest thing to Kaby Lake)

> -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -msgx -mbmi2 -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mrtm -mhle -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mclflushopt -mxsavec -mxsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-avx5124fmaps -mno-avx5124vnniw -mno-clwb -mno-mwaitx -mno-clzero -mno-pku -mno-rdpid

Why do you think you need all this? -march=broadwell turns on/off these for you.

Specifying -mno-* flags basically only serves to break runtime-enabled code that uses specific instruction set features (like what I suspect is happening here).

> -mtune=generic

Now you've *completely* lost me.
Comment 4 Zoltan Puskas 2022-10-27 01:32:13 UTC
Since I use distcc, and my build box is of a different model, I need to be explicit about my CFLAGS. When I set up my machine back in 2017, I've used the


$ gcc -v -E -x c /dev/null -o /dev/null -march=native 2>&1 | grep /cc1 | grep mtune


trick to obtain the CFLAGS, that's why I have what I have there. I'll change the CLFAGS to

-march=skylake -mabm --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=8192

that I've obtained from app-misc/resolve-march-native just now, and will retry the build and see if I get a different result. I'll report back with the results  once the build has finished/failed.
Comment 5 Zoltan Puskas 2022-10-27 17:43:30 UTC
I've retried with the new CFLAGS, and it has successfully finished the build. It seems the problem was my overly specific ancient compiler flags that I've obtained years ago from a previous version of GCC.
Comment 6 Stephan Hartmann (RETIRED) gentoo-dev 2022-10-27 18:26:24 UTC
We need to add something like -mno-avx512* to the filter-flags list.
Comment 7 Matt Turner gentoo-dev 2022-10-27 18:29:51 UTC
(In reply to Stephan Hartmann from comment #6)
> We need to add something like -mno-avx512* to the filter-flags list.

We can, but people putting -mno-* in their CFLAGS is a problem across all of ::gentoo.
Comment 8 Mike Gilbert gentoo-dev 2022-10-27 18:55:43 UTC
(In reply to Stephan Hartmann from comment #6)
> We need to add something like -mno-avx512* to the filter-flags list.

I think filtering -mno-xxx flags is a probably a bad idea, and we should probably stop doing it in the chromium ebuild.

For example see bug 863563. The user has an ivybridge chip which is supposed to support AVX2, but this specific variant of the chip actually lacks support for AVX2 instructions. Blame Intel for the inconsistency I guess.

If we filter -mno-avx2 and similar flags, the compiler may end up generating invalid opcodes for the user's system.

Currently, the only workaround is for the user to pick less featureful -march setting.
Comment 9 Stephan Hartmann (RETIRED) gentoo-dev 2022-10-28 16:20:43 UTC
(In reply to Mike Gilbert from comment #8)
> (In reply to Stephan Hartmann from comment #6)
> > We need to add something like -mno-avx512* to the filter-flags list.
> 
> I think filtering -mno-xxx flags is a probably a bad idea, and we should
> probably stop doing it in the chromium ebuild.
> 
> For example see bug 863563. The user has an ivybridge chip which is supposed
> to support AVX2, but this specific variant of the chip actually lacks
> support for AVX2 instructions. Blame Intel for the inconsistency I guess.
> 
> If we filter -mno-avx2 and similar flags, the compiler may end up generating
> invalid opcodes for the user's system.
> 
> Currently, the only workaround is for the user to pick less featureful
> -march setting.

nodejs does runtime CPU features detection:
https://github.com/nodejs/node/blob/main/deps/base64/base64.gyp#L41

Again the build systems adds -mavx2 and the user overwrites with -mno-avx2. A possible workaround is to force inside the sources with "#pragma GCC target ...". But I don't think it is upstreamable.
Comment 10 Stephan Hartmann (RETIRED) gentoo-dev 2023-01-12 21:34:30 UTC
*** Bug 890593 has been marked as a duplicate of this bug. ***