Summary: | qt5-build.eclass does not check for SSE2 availability | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Felix Tiede <info> |
Component: | Eclasses | Assignee: | Qt Bug Alias <qt> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | bugzilla, chesguy, david, jason, mmogilvi+gnto, rbergen, sam, Xeha |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: |
https://bugs.gentoo.org/show_bug.cgi?id=775650 https://bugs.gentoo.org/show_bug.cgi?id=773199 https://bugs.gentoo.org/show_bug.cgi?id=707390 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
Support EXTRA_ECONF in qt5-build.eclass
Use CPU_FLAGS_X86 for SSE2 decision Use CFLAGS for SSE2 decision build.log for qtgui with illegal instruction error due to not having sse2 build.log for qtwebengine with illegal instruction error Atltenative patch to qt5-build.eclass |
Description
Felix Tiede
2018-02-18 12:35:46 UTC
Created attachment 520020 [details, diff]
Support EXTRA_ECONF in qt5-build.eclass
Quick and dirty patch to support EXTRA_ECONF variable while building dev-qt/*:5 packages.
Could you please attach the qtcore build log? (In reply to Felix Tiede from comment #1) > Created attachment 520020 [details, diff] [details, diff] > Support EXTRA_ECONF in qt5-build.eclass > > Quick and dirty patch to support EXTRA_ECONF variable while building > dev-qt/*:5 packages. I don't think we should honor EXTRA_ECONF. qt5-build.eclass does not use econf. (In reply to Michael Palimaka (kensington) from comment #2) > Could you please attach the qtcore build log? I can, but it will take a while. Which precise log do you want? With or without my change to qt5-build.eclass? (In reply to Felix Tiede from comment #4) > (In reply to Michael Palimaka (kensington) from comment #2) > > Could you please attach the qtcore build log? > > I can, but it will take a while. Which precise log do you want? With or > without my change to qt5-build.eclass? Without the changes. The reason I'm asking is that this seems to be a recurrence of bug #552942, so it'd be helpful to see exactly what's changed. Created attachment 520958 [details, diff] Use CPU_FLAGS_X86 for SSE2 decision qt5-build eclass now relies on CPU_FLAGS_X86 to toggle '-no-sse2' in configure phase, as requested by comment #3. Created attachment 520960 [details, diff]
Use CFLAGS for SSE2 decision
qt5-build eclass relies on '-msse2' in CFLAGS to toggle '-no-sse2' in configure phase.
I do know that relying on CFLAGS is unsafe as not every user will specify it to this extent, thus I provided this patch for completeness sake, I don't think it is of much use.
(In reply to Michael Palimaka (kensington) from comment #5) > (In reply to Felix Tiede from comment #4) > > (In reply to Michael Palimaka (kensington) from comment #2) > > > Could you please attach the qtcore build log? > > > > I can, but it will take a while. Which precise log do you want? With or > > without my change to qt5-build.eclass? > > Without the changes. The reason I'm asking is that this seems to be a > recurrence of bug #552942, so it'd be helpful to see exactly what's changed. Please note: qtcore:5 builds clean, even without -no-sse2 on my AthlonXP, the problem only shows up in qtgui:5, so are you sure you want qtcore build log or is it qtgui build log? (In reply to Felix Tiede from comment #8) > (In reply to Michael Palimaka (kensington) from comment #5) > > (In reply to Felix Tiede from comment #4) > > > (In reply to Michael Palimaka (kensington) from comment #2) > > > > Could you please attach the qtcore build log? > > > > > > I can, but it will take a while. Which precise log do you want? With or > > > without my change to qt5-build.eclass? > > > > Without the changes. The reason I'm asking is that this seems to be a > > recurrence of bug #552942, so it'd be helpful to see exactly what's changed. > > Please note: qtcore:5 builds clean, even without -no-sse2 on my AthlonXP, > the problem only shows up in qtgui:5, so are you sure you want qtcore build > log or is it qtgui build log? Whichever is breaking. The reason I asked qtcore is because that seemed to be what was broken per comment #0. I'm not the original person who filed the but, however, I hit the same issue last night trying to update an older system. /usr/lib/qt5/bin/qdbusxml2cpp -i struct_marshallers_p.h -a deviceeventcontroller_adaptor.h: dbusxml/DeviceEventController.xml make[1]: *** [Makefile:1428: deviceeventcontroller_adaptor.h] Illegal instruction make[1]: Leaving directory '/var/tmp/portage/dev-qt/qtgui-5.9.4-r3/work/qtbase-opensource-src-5.9.4/src/platformsupport/linuxaccessibility' make: *** [Makefile:331: sub-linuxaccessibility-make_first] Error 2 make: *** Waiting for unfinished jobs.... This is also on an older Athlon XP CPU. Will attach my build log. Created attachment 532598 [details]
build.log for qtgui with illegal instruction error due to not having sse2
I tried adding the following from the "Use CFLAGS for SSE2 decision" to a local copy of the qt5-build.eclass file. It doesn't help me any. I also added "-mno-sse2" to the CFLAGS in make.conf and I end up with "-mno-sse2 -msse2" in the compile statements as it tried to build. I also found out that part of my problem seems to be this: ~ # /usr/lib/qt5/bin/qdbusxml2cpp Illegal instruction So I tried to rebuild qtdbus which compiles, but I noticed the same "-mno-sse2 -msse2" during the build and I also noticed this in the configure output: Build type: linux-g++ (i386, CPU features: 3dnow 3dnow-a mmx sse) Configuration: sse2 sse3 ssse3 sse4_1 sse4_2 avx avx2 avx512f avx512bw avx512cd avx512dq avx512er avx512ifma avx512pf avx512vbmi avx512vl enable_new_dtags f16c largefile nostrip shared release c++11 c++14 c++1z concurrent dbus no-gui reduce_exports reduce_relocations stl no-widgets Build options: Mode ................................... release Optimize release build for size ........ no Building shared libraries .............. yes Using C++ standard ..................... C++1z Using ccache ........................... no Using gold linker ...................... no Using new DTAGS ........................ yes Using precompiled headers .............. no Using LTCG ............................. no Target compiler supports: SSE .................................. SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 AVX .................................. AVX AVX2 F16C AVX512 ............................... F ER CD PF DQ BW VL IFMA VBMI The only way I could get qtgui:5 to build for my AMD Athlon family 6 model 10 x686 CPU was by using Felix Tiede's patch to qt5-build.eclass, linked in comment #6. That seems to have done the trick for me! Although, I did have to recompile all the other qt 5.9 packages that had already been merged in order for it to work. I'm now hitting an error with qtwebengine, but that seems to be a different error. Created attachment 533060 [details]
build.log for qtwebengine with illegal instruction error
Well, I thought I was good to go. I have one last QT5 package that isn't compiling.
Trying to manually run the last step gives me the same Illegal instruction error.
~ # /var/tmp/portage/dev-qt/qtwebengine-5.9.4/work/qtwebengine-opensource-src-5.9.4/src/3rdparty/chromium/tools/gn/out/Release/gn gen /var/tmp/portage/dev-qt/qtwebengine-5.9.4/work/qtwebengine-opensource-src-5.9.4/src/core/Release --script-executable=/var/tmp/portage/dev-qt/qtwebengine-5.9.4/temp/python2.7/bin/python2 --args='use_qt=true is_component_build=false is_shared=true enable_media_router=false enable_nacl=false enable_remoting=false enable_web_speech=false use_experimental_allocator_shim=false use_allocator="none" v8_use_external_startup_data=false treat_warnings_as_errors=false enable_basic_printing=true enable_print_preview=true enable_pdf=true enable_plugins=true enable_widevine=true enable_spellcheck=true enable_webrtc=true proprietary_codecs=true ffmpeg_branding="Chrome" symbol_level=0 remove_webcore_debug_symbols=true remove_v8base_debug_symbols=true use_cups=false use_gconf=false use_gio=false use_gnome_keyring=false use_kerberos=false linux_use_bundled_binutils=false use_nss_certs=true use_openssl_certs=false no_delete_null_pointer_checks=true is_clang=false custom_toolchain="/var/tmp/portage/dev-qt/qtwebengine-5.9.4/work/qtwebengine-opensource-src-5.9.4/src/toolchain:target" host_toolchain="/var/tmp/portage/dev-qt/qtwebengine-5.9.4/work/qtwebengine-opensource-src-5.9.4/src/toolchain:host" host_cpu="x86" pkg_config="pkg-config" use_system_zlib=true use_system_minizip=true use_system_libpng=true use_system_libjpeg=true use_system_harfbuzz=true use_pulseaudio=false use_alsa=true use_system_libffi=true use_system_libevent=true use_system_libwebp=true use_system_libxml=true use_system_libxslt=true use_system_opus=true use_system_snappy=true use_system_libvpx=true use_system_icu=true icu_use_data_file=false use_system_ffmpeg=true use_system_re2=true use_sysroot=false enable_session_service=false enable_notifications=false toolkit_views=false use_gold=false is_debug=false qtwebengine_target="/var/tmp/portage/dev-qt/qtwebengine-5.9.4/work/qtwebengine-opensource-src-5.9.4/src/core/Release:QtWebEngineCore"' --root=/var/tmp/portage/dev-qt/qtwebengine-5.9.4/work/qtwebengine-opensource-src-5.9.4/src/3rdparty/chromium
Illegal instruction
*** Bug 654076 has been marked as a duplicate of this bug. *** The problem is that qtcore is forcing sse2 so long as the compiler supports it. It builds clean but fails with illegal instruction because there are no runtime checks for the CPU feature. This is why failures first appear when building other packages linked against libQt5Core. More details in bug #654076, which I have just marked as a duplicate of this one. Since this is an upstream decision impacting older 32 bit processors that dont have SSE2 support, Felix patch to the eclass linked from comment 6 is probably the cleanest way to fix this for those of us still using older processors. It would be easier if we could pass EXTRA_ECONF, but these packages ignore it. *** Bug 699496 has been marked as a duplicate of this bug. *** Confirming that the eclass patch from comment #6 allows me to build qtcore qtdbus and qtgui 5.12.3 on a Pentium 3. This was a blocker for emerging xfce4 for me. Created attachment 597512 [details, diff] Atltenative patch to qt5-build.eclass I'm attaching an alternative patch to the one referenced in comment #6. This one follows X86_CPU_FLAGS instead of CFLAGS, in the sense that it adds -no-sse2 to Qt5 config when sse2 is *not* set in X86_CPU_FLAGS. Acknowledging that one could call it a matter of personal preference, I personally think this approach is more "Gentoo". In general, Gentoo packages use X86_CPU_FLAGS to determine what instruction sets to compile for, and the variable is easier to set on a per-package basis. Furthermore, I have written a post-sync script for the gentoo repo to apply the patch after every sync. The script can easily be used for either patch attached to this bug. Instructions for its use can be found here: https://forums.gentoo.org/viewtopic-t-1104574.html (The patch obviously follows CPU_FLAGS_X86, instead of X86_CPU_FLAGS. Apologies for the consistent typo in my previous comment.) It was pointed out to me in the forums that bug #552942 seems to cover this issue as well. In the context of that bug a workaround was implemented by the Gentoo devs in qt5-build.eclass, which was later reverted due to it causing build errors. Ok, I just realized that the patch I uploaded earlier today is in fact the comment #6 patch, but with updated offsets to match the current version of qt5-build.eclass. I diffed my own version of the patch in the process of creating the post-sync repo workaround that I mentioned, and totally forgot I pulled the original version from this very bug. While we're at it, my comments concerning the comment #6 patch actually apply to the patch referred to in comment #7 (in other words, I agree with what Felix Tiede had already stated). My sincere apologies for the noise caused by this, I feel appropriately stupid for it. I can confirm the same issue on an old x86 machine without the SSE2 instruction set. Im affected as well. |