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
Summary: dev-qt/qtgui: emake failed: Illegal instruction
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords:
: 708792 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-01-30 18:54 UTC by Thomas Deutschmann
Modified: 2021-07-08 03:50 UTC (History)
4 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
Details
Build Log (dev-qt:qtgui-5.14.2-r1:20200527-034816.log,178.39 KB, text/x-log)
2020-05-27 04:13 UTC, Ian.au
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Deutschmann gentoo-dev Security 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 gentoo-dev Security 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.