Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 910419

Summary: dev-qt/qtbase-6.5.1-r1 emerge fail on AVX512-enabled Alder Lake CPU with march=native
Product: Gentoo Linux Reporter: znjameswu
Component: Current packagesAssignee: Qt Bug Alias <qt>
Status: UNCONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also:
Package list:
Runtime testing required: ---
Attachments: lscpu
emerge --info
gcc -march=native -Q --help=target
emerge --info '=dev-qt/qtbase-6.5.1-r1::gentoo'

Description znjameswu 2023-07-16 07:22:07 UTC
Selected part of the error log:
/var/tmp/portage/dev-qt/qtbase-6.5.1-r1/work/qtbase-everywhere-src-6.5.1_build/include/QtCore/../../../qtbase-everywhere-src-6.5.1/src/corelib/global/qfloat16.h: In function ‘qfloat16 qSqrt(qfloat16)’:
/var/tmp/portage/dev-qt/qtbase-6.5.1-r1/work/qtbase-everywhere-src-6.5.1_build/include/QtCore/../../../qtbase-everywhere-src-6.5.1/src/corelib/global/qfloat16.h:266:9: error: ‘__m128h’ was not declared in this scope
  266 |         __m128h v = _mm_set_sh(f);
      |         ^~~~~~~
/var/tmp/portage/dev-qt/qtbase-6.5.1-r1/work/qtbase-everywhere-src-6.5.1_build/include/QtCore/../../../qtbase-everywhere-src-6.5.1/src/corelib/global/qfloat16.h:267:9: error: ‘v’ was not declared in this scope
  267 |         v = _mm_sqrt_sh(v, v);
      |         ^
/var/tmp/portage/dev-qt/qtbase-6.5.1-r1/work/qtbase-everywhere-src-6.5.1_build/include/QtCore/../../../qtbase-everywhere-src-6.5.1/src/corelib/global/qfloat16.h:267:13: error: ‘_mm_sqrt_sh’ was not declared in this scope
  267 |         v = _mm_sqrt_sh(v, v);
      |             ^~~~~~~~~~~
/var/tmp/portage/dev-qt/qtbase-6.5.1-r1/work/qtbase-everywhere-src-6.5.1_build/include/QtCore/../../../qtbase-everywhere-src-6.5.1/src/corelib/global/qfloat16.h:268:16: error: ‘_mm_cvtsh_h’ was not declared in this scope
  268 |         return _mm_cvtsh_h(v);
      |                ^~~~~~~~~~~

Reproducible: Always

Steps to Reproduce:
1. Use an AVX512-enabled Intel Alder Lake (12th gen Core) machine
2. Set "march=native" in gcc flags
Actual Results:  
Emerge failed

Suspected Cause:
in qtbase-6.5.1-r1/work/qtbase-everywhere-src-6.5.1/src/corelib/global/qfloat16.h:29: 
#if defined(QT_COMPILER_SUPPORTS_F16C) && defined(__F16C__)
#include <immintrin.h>
Somehow QT_COMPILER_SUPPORTS_F16C is undef on my machine. When commented out, the manual build turns out successful

Alder Lake CPUs (or Intel 12th gen Core) do not officially support AVX512. However, a CooperLake-equivalent AVX512 support can be enabled on those CPUs by specific firmwares. Hence a very niche configuration.
Comment 1 znjameswu 2023-07-16 07:23:36 UTC
Created attachment 865565 [details]
Comment 2 znjameswu 2023-07-16 07:24:29 UTC
Created attachment 865566 [details]
emerge --info
Comment 3 znjameswu 2023-07-16 07:28:51 UTC
Created attachment 865567 [details]
Comment 4 znjameswu 2023-07-16 07:29:06 UTC
Created attachment 865568 [details]
Comment 5 znjameswu 2023-07-16 07:31:08 UTC
Created attachment 865569 [details]
gcc -march=native -Q --help=target
Comment 6 znjameswu 2023-07-16 07:32:54 UTC
Created attachment 865570 [details]
emerge --info '=dev-qt/qtbase-6.5.1-r1::gentoo'
Comment 7 znjameswu 2023-07-16 07:34:30 UTC
Supplementary Info: I'm not using any
Comment 8 znjameswu 2023-07-16 07:37:22 UTC
(In reply to znjameswu from comment #7)
Supplementary Info: I'm not using VirtualBox. The installation is on bare metal.
Comment 9 Mike Gilbert gentoo-dev 2023-07-29 22:29:24 UTC
Please file a bug upstream.