Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 910419 - dev-qt/qtbase-6.5.1-r1 emerge fail on AVX512-enabled Alder Lake CPU with march=native
Summary: dev-qt/qtbase-6.5.1-r1 emerge fail on AVX512-enabled Alder Lake CPU with marc...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-16 07:22 UTC by znjameswu
Modified: 2023-07-29 22:29 UTC (History)
0 users

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


Attachments
lscpu (file_910419.txt,2.86 KB, text/plain)
2023-07-16 07:23 UTC, znjameswu
Details
emerge --info (file_910419.txt,18.72 KB, text/plain)
2023-07-16 07:24 UTC, znjameswu
Details
build.log (build.log,201.48 KB, text/x-log)
2023-07-16 07:28 UTC, znjameswu
Details
environment (environment,132.72 KB, text/plain)
2023-07-16 07:29 UTC, znjameswu
Details
gcc -march=native -Q --help=target (file_910419.txt,11.37 KB, text/plain)
2023-07-16 07:31 UTC, znjameswu
Details
emerge --info '=dev-qt/qtbase-6.5.1-r1::gentoo' (file_910419.txt,7.87 KB, text/plain)
2023-07-16 07:32 UTC, znjameswu
Details

Note You need to log in before you can comment on or make changes to this bug.
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>
#endif
```
Somehow QT_COMPILER_SUPPORTS_F16C is undef on my machine. When commented out, the manual build turns out successful


Background: 
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]
lscpu
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]
build.log
Comment 4 znjameswu 2023-07-16 07:29:06 UTC
Created attachment 865568 [details]
environment
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.