paddlaren Tux's lil' helper
Joined: 23 Nov 2005 Posts: 127 Location: Hörby, Sweden
|
Posted: Sat Oct 19, 2024 9:28 am Post subject: Trouble building dev-qt/qtbase with Ryzen 9 9950x CC_FLAGS |
|
|
I just got an upgrade from Ryzen9 7950x to 9950x and naturally I enable all flags possible. The upgrade (not empty tree though) wen mostly smooth but there was a strange problem with dev-qt/qtbase
My settings in make.conf was derived from resolve-march-native that reported:
Code: | -march=znver4 -mavx512vp2intersect -mavxvnni -mmovdir64b -mmovdiri -mshstk --param=l1-cache-line-size=64 --param=l1-cache-size=48 --param=l2-cache-size=1024 |
Thus COMMON_FLAGS in make.conf was:
Code: | CFLAGS="-march=znver4 -mavx512vp2intersect -mavxvnni -mmovdir64b -mmovdiri -mshstk --param=l1-cache-line-size=64 --param=l1-cache-size=48 --param=l2-cache-size=1024 -O2 -pipe" |
(Without the -O2 -pipe media-libs/libvpx-1.14.1 failed to build, which might seem strange as -O2 should be enabled by default from what I read).
GCC is the default:
Code: | gcc (Gentoo 13.3.1_p20240614 p17) 13.3.1 20240614 |
When I built dev-qt/qtbase-6.7.2-r5 I got the following strange errors:
Code: | /usr/bin/x86_64-pc-linux-gnu-g++ -DENABLE_PIXMAN_DRAWHELPERS -DGui_EXPORTS -DMD4C_USE_UTF8 -DQT_ASCII_CAST_WARNINGS -DQT_BUILDING_QT -DQT_BUILD_GUI_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_UP_TO=0x050000 -DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH -DQT_LEAN_HEADERS=1 -DQT_MOC_COMPAT -DQT_NO_AS_CONST -DQT_NO_CAST_TO_ASCII -DQT_NO_CONTEXTLESS_CONNECT -DQT_NO_DEBUG -DQT_NO_EXCEPTIONS -DQT_NO_FOREACH -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_QEXCHANGE -DQT_NO_USING_NAMESPACE -DQT_QPA_DEFAULT_PLATFORM_NAME=\"xcb\" -DQT_USE_QSTRINGBUILDER -DQT_WARN_DEPRECATED_UP_TO=0x070000 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I/var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2_build/src/gui/Gui_autogen/include -I/var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2_build/include -I/var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2_build/include/QtGui -I/var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2/src/gui -I/var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2_build/src/gui -I/var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2/src/gui/../3rdparty/VulkanMemoryAllocator -I/var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2/src/gui/../3rdparty/D3D12MemoryAllocator -I/var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2_build/include/QtGui/6.7.2 -I/var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2_build/include/QtGui/6.7.2/QtGui -I/var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2/src/gui/../3rdparty/md4c -I/var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2_build/include/QtCore -I/var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2/mkspecs/linux-g++ -I/var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2_build/src/corelib -I/var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2_build/include/QtCore/6.7.2 -I/var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2_build/include/QtCore/6.7.2/QtCore -I/var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2_build/include/QtDBus -isystem /usr/include/harfbuzz -isystem /usr/include/freetype2 -isystem /usr/include/glib-2.0 -isystem /usr/lib64/glib-2.0/include -march=znver4 -mavx512vp2intersect -mavxvnni -mmovdir64b -mmovdiri -mshstk --param=l1-cache-line-size=64 --param=l1-cache-size=48 --param=l2-cache-size=1024 -O2 -pipe -std=c++17 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -fno-exceptions -fPIC -Wsuggest-override -fcf-protection=full -march=haswell -MD -MT src/gui/CMakeFiles/Gui.dir/painting/qdrawhelper_avx2.cpp.o -MF src/gui/CMakeFiles/Gui.dir/painting/qdrawhelper_avx2.cpp.o.d -o src/gui/CMakeFiles/Gui.dir/painting/qdrawhelper_avx2.cpp.o -c /var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2/src/gui/painting/qdrawhelper_avx2.cpp
In file included from /var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2_build/include/QtCore/6.7.2/QtCore/private/qsimd_p.h:1,
from /var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2/src/gui/painting/qdrawhelper_p.h:30,
from /var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2/src/gui/painting/qdrawhelper_avx2.cpp:5:
/var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2/src/corelib/global/qsimd_p.h:250:8: error: #error "Please enable all x86-64-v4 extensions; you probably want to use -march=skylake-avx512 or -march=x86-64-v4 instead of -mavx512f"
250 | # error "Please enable all x86-64-v4 extensions; you probably want to use -march=skylake-avx512 or -march=x86-64-v4 instead of -mavx512f"
| ^~~~~
/var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2/src/corelib/global/qsimd_p.h:247:52: error: ‘__AVX512BW__’ was not declared in this scope
247 | # define ARCH_SKX_MACROS (__AVX512F__ + __AVX512BW__ + __AVX512CD__ + __AVX512DQ__ + __AVX512VL__)
| ^~~~~~~~~~~~
/var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2/src/corelib/global/qsimd_p.h:252:15: note: in expansion of macro ‘ARCH_SKX_MACROS’
252 | static_assert(ARCH_SKX_MACROS, "Undeclared identifiers indicate which features are missing.");
| ^~~~~~~~~~~~~~~
/var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2/src/corelib/global/qsimd_p.h:247:67: error: ‘__AVX512CD__’ was not declared in this scope
247 | # define ARCH_SKX_MACROS (__AVX512F__ + __AVX512BW__ + __AVX512CD__ + __AVX512DQ__ + __AVX512VL__)
| ^~~~~~~~~~~~
/var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2/src/corelib/global/qsimd_p.h:252:15: note: in expansion of macro ‘ARCH_SKX_MACROS’
252 | static_assert(ARCH_SKX_MACROS, "Undeclared identifiers indicate which features are missing.");
| ^~~~~~~~~~~~~~~
/var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2/src/corelib/global/qsimd_p.h:247:97: error: ‘__AVX512VL__’ was not declared in this scope
247 | # define ARCH_SKX_MACROS (__AVX512F__ + __AVX512BW__ + __AVX512CD__ + __AVX512DQ__ + __AVX512VL__)
| ^~~~~~~~~~~~
/var/tmp/portage/dev-qt/qtbase-6.7.2-r5/work/qtbase-everywhere-src-6.7.2/src/corelib/global/qsimd_p.h:252:15: note: in expansion of macro ‘ARCH_SKX_MACROS’
252 | static_assert(ARCH_SKX_MACROS, "Undeclared identifiers indicate which features are missing.");
| ^~~~~~~~~~~~~~~ |
I had just no idea where to begin so I verified that those requested flags was compatible with my CPU by checking the CPU-flags from lscpu (lscpu | grep -i AVX512F etc) and it was.
So I tried by chanse to add those specifically to the COMMON_FLAGS:
Code: | CFLAGS="-march=znver4 -mavx512vp2intersect -mavx512f -mavx512bw -mavx512cd -mavx512dq -mavx512vl -mavxvnni -mmovdir64b -mmovdiri -mshstk --param=l1-cache-line-size=64 --param=l1-cache-size=48 --param=l2-cache-size=1024 -O2 -pipe" |
and qtbase compile just fine.
According to GCC documentation for version 13.3 the problematic flags should be enabled by the -march=znver4:
Quote: | AMD Family 19h core based CPUs with x86-64 instruction set support. (This supersets BMI, BMI2, CLWB, F16C, FMA, FSGSBASE, AVX, AVX2, ADCX, RDSEED, MWAITX, SHA, CLZERO, AES, PCLMUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM, XSAVEC, XSAVES, CLFLUSHOPT, POPCNT, RDPID, WBNOINVD, PKU, VPCLMULQDQ, VAES, AVX512F, AVX512DQ, AVX512IFMA, AVX512CD, AVX512BW, AVX512VL, AVX512BF16, AVX512VBMI, AVX512VBMI2, AVX512VNNI, AVX512BITALG, AVX512VPOPCNTDQ, GFNI and 64-bit instruction set extensions.) |
What is going on here? Why did I need to add those flags specifically? Aren't gcc and macros picking up those flags automatically with -march=znver4?
This problem is new since the CPU upgrade.
BR
Erik |
|