Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 707390 - dev-qt/qtgui: emake failed: Illegal instruction (RDRND detected on CPUs with no support)
Summary: dev-qt/qtgui: emake failed: Illegal instruction (RDRND detected on CPUs with ...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Qt Bug Alias
URL: https://invent.kde.org/qt/qt/qtbase/-...
Whiteboard:
Keywords:
: 708792 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-01-30 18:54 UTC by Thomas Deutschmann (RETIRED)
Modified: 2024-01-31 23:10 UTC (History)
6 users (show)

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


Attachments
build.log (build.log,168.02 KB, text/plain)
2020-01-30 18:54 UTC, Thomas Deutschmann (RETIRED)
Details
Build Log (dev-qt:qtgui-5.14.2-r1:20200527-034816.log,178.39 KB, text/plain)
2020-05-27 04:13 UTC, Ian.au
Details
build.log.xz (amd64 musl/clang, 5.15.12) (qtgui-5.15.12:20240131-222427.log.xz,20.91 KB, application/x-xz)
2024-01-31 23:09 UTC, ernsteiswuerfel
Details
emerge --info (amd64 musl/clang) (file_707390.txt,7.68 KB, text/plain)
2024-01-31 23:10 UTC, ernsteiswuerfel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Deutschmann (RETIRED) gentoo-dev 2020-01-30 18:54:42 UTC
Created attachment 608600 [details]
build.log

Building qtgui fails with

> make: *** [Makefile:1599: vulkan/qvulkanfunctions.h] Illegal instruction (core dumped)

gdb reveals that the illegal instruction is "rdrand":

> (gdb) bt full
> #0  0x00007f7002bf61b3 in qRandomCpu(void*, long long) () from /usr/lib64/libQt5Core.so.5
> No symbol table info available.
> #1  0x00007f7002b80450 in ?? () from /usr/lib64/libQt5Core.so.5
> No symbol table info available.
> #2  0x00007f7002bd1d9b in ?? () from /usr/lib64/libQt5Core.so.5
> No symbol table info available.
> #3  0x00007f7002bd1e55 in ?? () from /usr/lib64/libQt5Core.so.5
> No symbol table info available.
> #4  0x00007f7002bd243a in QHashData::detach_helper(void (*)(QHashData::Node*, void*), void (*)(QHashData::Node*), int, int) () from /usr/lib64/libQt5Core.so.5
> No symbol table info available.
> #5  0x00007f7002d7a59a in ?? () from /usr/lib64/libQt5Core.so.5
> No symbol table info available.
> #6  0x00007f7002d7b86a in QTextCodec::codecForMib(int) () from /usr/lib64/libQt5Core.so.5
> No symbol table info available.
> #7  0x00007f7002db860b in ?? () from /usr/lib64/libQt5Core.so.5
> No symbol table info available.
> #8  0x00007f7002db8b9e in ?? () from /usr/lib64/libQt5Core.so.5
> No symbol table info available.
> #9  0x00007f7002db93ef in QXmlStreamReader::QXmlStreamReader() () from /usr/lib64/libQt5Core.so.5
> No symbol table info available.
> #10 0x000055929db5c46c in VkSpecParser::VkSpecParser (this=0x7ffd16738070) at qvkgen.cpp:494
> No locals.
> #11 main (argc=<optimized out>, argv=0x7ffd167381d8) at qvkgen.cpp:494
>         app = <incomplete type>
>         parser = {m_file = <incomplete type>, m_reader = {d_ptr = {d = 0x0}}, m_commands = {d = 0x1}, m_fn = {static null = {<No data fields>}, d = 0x2}}
>         commands = {d = 0x0}
>         ignoredFuncs = {<QList<QString>> = {<QListSpecialMethods<QString>> = {<No data fields>}, {p = {static shared_null = {ref = {atomic = {_q_value = {<std::__atomic_base<int>> = {static _S_alignment = 4,
>                           _M_i = -1}, static is_always_lock_free = true}}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x0}, d = 0x0}}, <No data fields>}
>         licenseHeaderFileName = {static null = {<No data fields>}, d = 0x0}
>         outputBase = {static null = {<No data fields>}, d = 0x0}
> 
> (gdb) disassemble
> Dump of assembler code for function _Z10qRandomCpuPvx:
>    0x00007f7002bf6160 <+0>:     lea    (%rdi,%rsi,4),%r8
>    0x00007f7002bf6164 <+4>:     mov    %rdi,%rax
>    0x00007f7002bf6167 <+7>:     mov    $0xa,%esi
>    0x00007f7002bf616c <+12>:    lea    0x8(%rdi),%rcx
>    0x00007f7002bf6170 <+16>:    cmp    %rcx,%r8
>    0x00007f7002bf6173 <+19>:    jb     0x7f7002bf61a9 <_Z10qRandomCpuPvx+73>
>    0x00007f7002bf6175 <+21>:    mov    $0x1,%r9d
>    0x00007f7002bf617b <+27>:    jmp    0x7f7002bf618e <_Z10qRandomCpuPvx+46>
>    0x00007f7002bf617d <+29>:    nopl   (%rax)
>    0x00007f7002bf6180 <+32>:    sub    $0x1,%esi
>    0x00007f7002bf6183 <+35>:    je     0x7f7002bf61c4 <_Z10qRandomCpuPvx+100>
>    0x00007f7002bf6185 <+37>:    lea    0x8(%rax),%rcx
>    0x00007f7002bf6189 <+41>:    cmp    %r8,%rcx
>    0x00007f7002bf618c <+44>:    ja     0x7f7002bf61a9 <_Z10qRandomCpuPvx+73>
>    0x00007f7002bf618e <+46>:    rdrand %rdx
>    0x00007f7002bf6192 <+50>:    mov    %rdx,(%rax)
>    0x00007f7002bf6195 <+53>:    cmovb  %r9d,%edx
>    0x00007f7002bf6199 <+57>:    test   %edx,%edx
>    0x00007f7002bf619b <+59>:    je     0x7f7002bf6180 <_Z10qRandomCpuPvx+32>
>    0x00007f7002bf619d <+61>:    mov    %rcx,%rax
>    0x00007f7002bf61a0 <+64>:    lea    0x8(%rax),%rcx
>    0x00007f7002bf61a4 <+68>:    cmp    %r8,%rcx
>    0x00007f7002bf61a7 <+71>:    jbe    0x7f7002bf618e <_Z10qRandomCpuPvx+46>
>    0x00007f7002bf61a9 <+73>:    mov    $0x1,%ecx
>    0x00007f7002bf61ae <+78>:    cmp    %rax,%r8
>    0x00007f7002bf61b1 <+81>:    je     0x7f7002bf61c4 <_Z10qRandomCpuPvx+100>
> => 0x00007f7002bf61b3 <+83>:    rdrand %edx
>    0x00007f7002bf61b6 <+86>:    mov    %edx,(%rax)
>    0x00007f7002bf61b8 <+88>:    cmovb  %ecx,%edx
>    0x00007f7002bf61bb <+91>:    test   %edx,%edx
>    0x00007f7002bf61bd <+93>:    jne    0x7f7002bf61cc <_Z10qRandomCpuPvx+108>
>    0x00007f7002bf61bf <+95>:    sub    $0x1,%esi
>    0x00007f7002bf61c2 <+98>:    jne    0x7f7002bf61ae <_Z10qRandomCpuPvx+78>
>    0x00007f7002bf61c4 <+100>:   sub    %rdi,%rax
>    0x00007f7002bf61c7 <+103>:   sar    $0x2,%rax
>    0x00007f7002bf61cb <+107>:   retq
>    0x00007f7002bf61cc <+108>:   add    $0x4,%rax
>    0x00007f7002bf61d0 <+112>:   sub    %rdi,%rax
>    0x00007f7002bf61d3 <+115>:   sar    $0x2,%rax
>    0x00007f7002bf61d7 <+119>:   retq
> End of assembler dump.

The user is using

> processor	: 3
> vendor_id	: GenuineIntel
> cpu family	: 6
> model		: 58
> model name	: Intel(R) Core(TM) i3-3240 CPU @ 3.40GHz
> stepping	: 9
> microcode	: 0x12
> cpu MHz		: 1744.632
> cache size	: 3072 KB
> physical id	: 0
> siblings	: 4
> core id		: 1
> cpu cores	: 2
> apicid		: 3
> initial apicid	: 3
> fpu		: yes
> fpu_exception	: yes
> cpuid level	: 13
> wp		: yes
> flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer xsave avx f16c lahf_lm cpuid_fault epb pti tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt dtherm arat pln pts
> bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
> bogomips	: 6784.88
> clflush size	: 64
> cache_alignment	: 64
> address sizes	: 36 bits physical, 48 bits virtual
> power management:

and this model (i3 in general) doesn't *have* rdrand as shown by app-misc/resolve-march-native:

> -march=ivybridge -mno-rdrnd --param l1-cache-line-size=64 --param l1-cache-size=32 --param l2-cache-size=3072

See also https://forums.intel.com/s/question/0D70P0000069SylSAE and https://github.com/anrieff/libcpuid/commit/86bf8e82698c12d5c625929c805c4e0d0c98d108

However, as you can see in build.log, build systems somehow detects rdrand...
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2020-01-30 18:55:55 UTC
Supportstdin by root
NewAboutYoursAPIHelp
5.7 KB, Plain text    Soft wrap Raw text Duplicate
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Portage 2.3.84 (python 3.6.9-final-0, default/linux/amd64/17.1/desktop, gcc-9.2.0, glibc-2.29-r7, 4.19.86-gentoo x86_64)
=================================================================
System uname: Linux-4.19.86-gentoo-x86_64-Intel-R-_Core-TM-_i3-3240_CPU_@_3.40GHz-with-gentoo-2.6
KiB Mem:     8029164 total,   2706700 free
KiB Swap:     524284 total,    524284 free
Timestamp of repository gentoo: Thu, 30 Jan 2020 15:30:01 +0000
Head commit of repository gentoo: 9d9f35e0060b6a62d8d32feddba7b8e76bf0fca2
sh bash 4.4_p23-r1
ld GNU ld (Gentoo 2.32 p2) 2.32.0
app-shells/bash:          4.4_p23-r1::gentoo
dev-lang/perl:            5.30.1::gentoo
dev-lang/python:          2.7.17::gentoo, 3.6.9::gentoo, 3.7.5-r1::gentoo
dev-util/cmake:           3.14.6::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.32-r1::gentoo
sys-devel/gcc:            9.2.0-r2::gentoo
sys-devel/gcc-config:     2.1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.19::gentoo (virtual/os-headers)
sys-libs/glibc:           2.29-r7::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    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: 

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=ivybridge -mno-rdrnd"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /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 -march=ivybridge -mno-rdrnd"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news nostrip parallel-fetch pid-sandbox preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="https://mirrors.evowise.com/gentoo/ https://mirrors.lug.mtu.edu/gentoo/"
LANG="de_DE.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="de"
MAKEOPTS="-j3"
PKGDIR="/var/cache/binpkgs"
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 asnl bash-completion berkdb bindist branding bzip2 cairo calendar cdda cdinstall cdr cli colord consolekit crypt css cups curl cxx dbi dbus djvu dri dts dv dvd dvdr emboss encode exif fam fastcgi fbcon ffmpeg flac fortran ftpgif gdbm gif gimp git glut gmp gnome gnome-keyring gnutls gpm graphviz gstreamer gtk gzip hddtemp iconv icu ios ipv6 jack javascriptjpeg jpeg jpeg2k lame lcms ldap libnotify libtirpc lm-sensors lzo mad mng mp3 mp4 mpeg mplayer mtp multilib musepack ncurses nls nptl nsplugin ogg opengl openmp pam pango pcmcia pcre pdf png policykit ppds qt5 readline sdl seccomp spell split-usr ssl startup-notification svg symlink syslog systemdszip tcpd tiff truetype trust udev udisks unicode upower usb v4lvdpau vorbis wxwidgets x264 xattr xcb xcomposite xml xv xvid zip zlib" ABI_X86="64" ADA_TARGET="gnat_2018" 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="karbon sheets words" 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 greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6 pypy" RUBY_TARGETS="ruby24 ruby25" USERLAND="GNU" VIDEO_CARDS="vesa nouveau" 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_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Pasted 35 seconds ago — Expires in 7 days
Comment 2 Chiitoo gentoo-dev 2020-01-30 22:41:48 UTC
I asked for some tips at freenode/qt-labs, and for now, building with '-no-feature-rdrnd' might work as a quick workaround.

To further help them help us, we need the command-line that was used for compiling the 'qrandom.cpp' file (it should be in the 'qtcore' build log).
Comment 3 Andreas Sturmlechner gentoo-dev 2020-02-09 10:08:14 UTC
*** Bug 708792 has been marked as a duplicate of this bug. ***
Comment 4 Ian.au 2020-05-27 04:13:21 UTC
Created attachment 641986 [details]
Build Log

Built with -no-feature-rdrnd
Comment 5 Ian.au 2020-05-27 04:18:53 UTC
lw3 /etc/portage # emerge --info
Portage 2.3.99 (python 3.7.7-final-0, default/linux/amd64/17.0/desktop/gnome/systemd, gcc-9.2.0, glibc-2.30-r8, 5.4.38-gentoo x86_64)
=================================================================
System uname: Linux-5.4.38-gentoo-x86_64-Intel-R-_Core-TM-_i3-3240_CPU_@_3.40GHz-with-gentoo-2.6
KiB Mem:     8029668 total,   4214828 free
KiB Swap:    4718584 total,   4718584 free
Timestamp of repository gentoo: Tue, 26 May 2020 01:00:01 +0000
Head commit of repository gentoo: 9db1a647c1f77224b2191d858075c6d7c970c0b7
Head commit of repository brother-overlay: 9ccba5d7c9fde9fdcb08e17695d25c3737089b71

sh bash 5.0_p17
ld GNU ld (Gentoo 2.33.1 p2) 2.33.1
distcc 3.3.3 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          5.0_p17::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.30.1::gentoo
dev-lang/python:          2.7.18::gentoo, 3.6.10-r2::gentoo, 3.7.7-r2::gentoo, 3.8.2-r2::gentoo
dev-util/cmake:           3.16.5::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.13.4-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.33.1-r1::gentoo
sys-devel/gcc:            9.2.0-r2::gentoo, 9.3.0::gentoo
sys-devel/gcc-config:     2.2.1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.4-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.30-r8::gentoo
Repositories:

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

IansOverlay
    location: /usr/local/portage
    masters: gentoo

localrepo
    location: /var/db/repos/localrepo
    masters: gentoo

crossdev
    location: /usr/local/portage-crossdev
    masters: gentoo
    priority: 10

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

brother-overlay
    location: /usr/local/portage/brother-overlay
    sync-type: git
    sync-uri: https://github.com/stefan-langenmaier/brother-overlay.git
    masters: gentoo
    priority: 9999

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=ivybridge -O2 -pipe -mno-rdrnd -mno-aes"
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/php/apache2-php7.4/ext-active/ /etc/php/cgi-php7.4/ext-active/ 
/etc/php/cli-php7.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=ivybridge -O2 -pipe -mno-rdrnd -mno-aes"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs 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 use
rsync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://ftp.swin.edu.au/gentoo ftp://ftp.swin.edu.au/gentoo"
LANG="en_AU.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en"
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 --e
xclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli colord crypt cups dbus dri dts dvd dvdr eds emboss encode evo exif flac fortran gdbm gif gnome gnome-key
ring gnome-online-accounts gpm gstreamer gtk iconv icu introspection ipv6 jpeg lcms ldap libnotify libsecret libtirpc mad mng mp3 mp4 mpeg multilib nautilus ncurses networkmanager nls nptl o
gg opengl openmp pam pango pcre pdf png policykit ppds pulseaudio qt5 readline sdl seccomp spell split-usr ssl startup-notification svg systemd tcpd tiff tracker truetype udev udisks unicode
 upower usb vorbis wxwidgets x264 xattr xcb xml xv xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2018" 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 vh
ost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 avx f16c pclmul popcnt sse3 sse4_1 s
se4_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 r
tcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" L10N="en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 m
txorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SI
NGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" RUBY_TARGETS="ruby24 ruby25" SANE_BACKENDS="net" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan lengt
h2 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_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 6 Ian.au 2020-05-28 01:36:13 UTC
Okay, this did build in the end with '-no-feature-rdrnd'added to src_config and then: emerge -1 qtcore qtgui -a


>>> Installing (2 of 2) dev-qt/qtgui-5.14.2-r1::localrepo
 * Regenerating gentoo-qconfig.h
 * Updating QT_CONFIG in qconfig.pri
 * Updating QT.global_private in qmodule.pri
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.
Comment 7 Daniel Robbins 2021-07-08 03:31:49 UTC
So the reason why this is happening is interesting.

Qt has its own internal code to determine CPU capabilities of the Qt compiler and the system. These CPU capability checks are sort of a parallel implementation of what is done by the kernel and what populates /proc/cpuinfo.

Qt is determining that your system has the rdrand instruction, so it is using it. However, your CPU is not advertising rdrand support in /proc/cpuinfo.

This confirms my suspicion that Qt's detection of CPU features isn't as reliable or thorough as what is in the Linux kernel. We are running into a similar issue in Funtoo with AMD excavator CPUs -- which are also not advertising rdrand -- but it's sort of the reverse problem -- rdrand instruction *is* available but not 'advertised' by the kernel due to a hardware bug mitigation in the kernel. If you are interested in following that wild goose chase, the Funtoo bug is https://bugs.funtoo.org/browse/FL-8598 .

A good fix for this is probably to directly check for the CPU feature rdrand in CPU_FLAGS_X86 -- and if it's not enabled there -- then explicitly set '-no-feature-rdrnd' to explicitly disable rdrand.

This probably also indicates that some investigation should be paid to Qt's discovery of CPU features and whether they align with CPU_FLAGS_* in Gentoo/Funtoo -- as if the kernel/distro/qt are getting different interpretations of settings or reading from different places -- in particular looking at the *current CPU* rather than *what CPU features Portage is telling Qt to use* then this can easily result in other bad bugs.
Comment 8 Daniel Robbins 2021-07-08 03:50:05 UTC
It's also interesting that you are explicitly specifying -mno-rdrnd in CXXFLAGS and qt is still using this instruction that you are trying to tell the compiler to explicitly not use. I think this is because Qt has its own preprocessor and compiler and mechanism to determine CPU features, and direct CXXFLAGS may never propagate to the actual build, at the very least those related to CPU features. This raises additional concern about Qt not respecting /proc/cpuinfo or CPU_FLAGS_* variables.
Comment 9 honeymak 2022-02-04 06:17:06 UTC
have you tried gcc-11?
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-03-18 02:50:29 UTC
I think we should probably handle this like bug 648004 (at the same time) - add CPU_FLAGS_RDRND to IUSE, if it's off, pass -no-feature-*.

It's not ideal given the flag will get added to some packages which might not(?) use it but it is what it is.
Comment 11 Vit 2022-04-17 06:32:43 UTC
Same problem.
As said in comment:
(In reply to Daniel Robbins from comment #7)

Problem with detected -march because CFLAGS, CXXFLAGS or LDFLAGS was lost.

Here is my make.conf:
- COMMON_FLAGS="-O2 -pipe -march=ivybridge"

gcc -v . 2>&1  | grep mar:
- COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64' '-dumpdir' 'a.'

Maybe problem is here? grep -Rin CXX /var/tmp/portage/dev-qt/qtgui-5.15.2-r16 | grep -v temp/build.log:
- temp/environment:2521:        : ${BUILD_CXXFLAGS:=-O1 -pipe};
- temp/environment:2526:        : ${BUILD_CXXFLAGS:=${CXXFLAGS}};
- temp/environment:2530:    export BUILD_{C,CXX,CPP,LD}FLAGS;
Comment 12 Vit 2022-04-17 07:30:13 UTC
make.conf:
- CPU_FLAGS_X86="avx f16c mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3"

Build.log:
- test config.qtbase_gui.libraries.x11sm succeeded
- Done running configuration tests.
- 
- Configure summary:
- 
- Build type: linux-g++ (x86_64, CPU features: avx cx16 f16c fsgsbase mmx pclmul - popcnt rdrnd sse sse2 sse3 ssse3 sse4.1 sse4.2 sse4)
- Compiler: gcc 11.2.
Comment 13 Vit 2022-04-18 06:02:43 UTC
Solved with:

I add to /etc/portage/make.conf:
- COMMON_FLAGS="-O2 -pipe -mno-rdrdnd -mno-aes -march=ivybridge"

emerge --ask --oneshot qtcore qtgui
Comment 14 Andreas Sturmlechner gentoo-dev 2023-11-11 17:11:50 UTC
Please test the changes in my linked upstream MR and report back.
Comment 15 Andreas Sturmlechner gentoo-dev 2023-11-11 17:49:40 UTC
(the patch is for dev-qt/qtcore)
Comment 16 Larry the Git Cow gentoo-dev 2024-01-01 18:50:01 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/qt.git/commit/?id=64901fffffb2e1c54e908e6fd4bec693796a9d2c

commit 64901fffffb2e1c54e908e6fd4bec693796a9d2c
Author:     Andreas Sturmlechner <asturm@gentoo.org>
AuthorDate: 2024-01-01 18:36:37 +0000
Commit:     Andreas Sturmlechner <asturm@gentoo.org>
CommitDate: 2024-01-01 18:44:50 +0000

    qt5-build.eclass: qtbase: Bump _QT5_GENTOOPATCHSET_REV=5 for 5.15.12
    
    New patches since _QT5_GENTOOPATCHSET_REV=4:
    
    Allan Sandfeld Jensen (3):
          Match deadcode elimination with cpu feature check
          Sync qt_scale_image_argb32_on_argb32_sse2 and qt_scale_image_32bit
          Avoid SSE2 punning
    
    Thiago Macieira (1):
          qsimd: Don't force RDRND on if __AVX2__
    
    Ulf Hermann (1):
          Gui: Always declare qt_memfill{32|64} as function pointers on x86
    
    See also:
    https://invent.kde.org/qt/qt/qtbase/-/merge_requests/295
    https://invent.kde.org/qt/qt/qtbase/-/merge_requests/297
    https://invent.kde.org/qt/qt/qtbase/-/merge_requests/298
    
    Bug: https://bugs.gentoo.org/704392
    Bug: https://bugs.gentoo.org/707390
    Bug: https://bugs.gentoo.org/777480
    Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>

 dev-qt/qtconcurrent/Manifest   | 2 +-
 dev-qt/qtcore/Manifest         | 2 +-
 dev-qt/qtdbus/Manifest         | 2 +-
 dev-qt/qtgui/Manifest          | 2 +-
 dev-qt/qtnetwork/Manifest      | 2 +-
 dev-qt/qtopengl/Manifest       | 2 +-
 dev-qt/qtprintsupport/Manifest | 2 +-
 dev-qt/qtsql/Manifest          | 2 +-
 dev-qt/qttest/Manifest         | 2 +-
 dev-qt/qtwidgets/Manifest      | 2 +-
 dev-qt/qtxml/Manifest          | 2 +-
 eclass/qt5-build.eclass        | 6 +++---
 12 files changed, 14 insertions(+), 14 deletions(-)
Comment 17 Larry the Git Cow gentoo-dev 2024-01-01 21:14:04 UTC
The bug has been referenced in the following commit(s):

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

commit d44f11ea9871c91e111047e4ad5e2d00151e1fb9
Author:     Andreas Sturmlechner <asturm@gentoo.org>
AuthorDate: 2024-01-01 18:36:37 +0000
Commit:     Andreas Sturmlechner <asturm@gentoo.org>
CommitDate: 2024-01-01 21:01:17 +0000

    qt5-build.eclass: qtbase: Bump _QT5_GENTOOPATCHSET_REV=5 for 5.15.12
    
    New patches since _QT5_GENTOOPATCHSET_REV=4:
    
    Allan Sandfeld Jensen (3):
          Match deadcode elimination with cpu feature check
          Sync qt_scale_image_argb32_on_argb32_sse2 and qt_scale_image_32bit
          Avoid SSE2 punning
    
    Thiago Macieira (1):
          qsimd: Don't force RDRND on if __AVX2__
    
    Ulf Hermann (1):
          Gui: Always declare qt_memfill{32|64} as function pointers on x86
    
    See also:
    https://invent.kde.org/qt/qt/qtbase/-/merge_requests/295
    https://invent.kde.org/qt/qt/qtbase/-/merge_requests/297
    https://invent.kde.org/qt/qt/qtbase/-/merge_requests/298
    
    Bug: https://bugs.gentoo.org/704392
    Bug: https://bugs.gentoo.org/707390
    Bug: https://bugs.gentoo.org/777480
    Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>

 eclass/qt5-build.eclass | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Comment 18 ernsteiswuerfel archtester 2024-01-31 23:09:52 UTC
Created attachment 883879 [details]
build.log.xz (amd64 musl/clang, 5.15.12)

My ThinkPad A275 (AMD PRO A12-8830B) is still affected (musl/clang system).

Build fails with "-Os -march=bdver4 -pipe", builds ok with "-Os -march=bdver3 -pipe".

bdver4 encompasses AVX2 whereas bdver3 does not. Both cpu architectures got no rdrand instruction.

 # lscpu 
Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         48 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  4
  On-line CPU(s) list:   0-3
Vendor ID:               AuthenticAMD
  BIOS Vendor ID:        AMD
  Model name:            AMD PRO A12-8830B R7, 10 COMPUTE CORES 4C+6G
    BIOS Model name:     AMD PRO A12-8830B R7, 10 COMPUTE CORES 4C+6G     CPU @ 2.5GHz
    BIOS CPU family:     72
    CPU family:          21
    Model:               101
    Thread(s) per core:  2
    Core(s) per socket:  2
    Socket(s):           1
    Stepping:            1
    Frequency boost:     enabled
    CPU(s) scaling MHz:  86%
    CPU max MHz:         2500.0000
    CPU min MHz:         1300.0000
    BogoMIPS:            4992.59
    Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr ss
                         e sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good acc_power nopl
                          nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_
                         2 movbe popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misal
                         ignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_co
                         re perfctr_nb bpext ptsc mwaitx cpb hw_pstate ssbd ibpb vmmcall fsgsbase bmi1 avx2 smep bmi
                         2 xsaveopt arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists 
                         pausefilter pfthreshold avic vgif overflow_recov
Virtualization features: 
  Virtualization:        AMD-V
Caches (sum of all):     
  L1d:                   128 KiB (4 instances)
  L1i:                   192 KiB (2 instances)
  L2:                    2 MiB (2 instances)
Vulnerabilities:         
  Gather data sampling:  Not affected
  Itlb multihit:         Not affected
  L1tf:                  Not affected
  Mds:                   Not affected
  Meltdown:              Not affected
  Mmio stale data:       Not affected
  Retbleed:              Mitigation; untrained return thunk; SMT vulnerable
  Spec rstack overflow:  Not affected
  Spec store bypass:     Mitigation; Speculative Store Bypass disabled via prctl
  Spectre v1:            Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:            Mitigation; Retpolines, IBPB conditional, STIBP disabled, RSB filling, PBRSB-eIBRS Not affe
                         cted
  Srbds:                 Not affected
  Tsx async abort:       Not affected
Comment 19 ernsteiswuerfel archtester 2024-01-31 23:10:55 UTC
Created attachment 883880 [details]
emerge --info (amd64 musl/clang)