Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 775650 - dev-qt/qt5[core, gui, svg, widgets] fails to build and run on non-SSE2 hardware
Summary: dev-qt/qt5[core, gui, svg, widgets] fails to build and run on non-SSE2 hardware
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2021-03-12 16:25 UTC by unlord
Modified: 2024-07-02 17:50 UTC (History)
2 users (show)

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


Attachments
qt5-build.eclass_no-sse2.patch (qt5-build.eclass-no_sse2.patch,560 bytes, patch)
2021-03-12 16:27 UTC, unlord
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description unlord 2021-03-12 16:25:09 UTC
Qt5 has supports building and running on older hardware. The qt5-build.eclass does not check for the presence of SSE2 and disable these instructions with the -no-sse2 configuration flag. This leads to illegal instruction errors like the one below when building on a Pentium III (Coppermine):

 * Running emake in src/gui
make -j1 
/var/tmp/portage/dev-qt/qtgui-5.15.2-r1/work/qtbase-everywhere-src-5.15.2_build/src/gui/qvkgen_wrapper.sh /var/tmp/portage/dev-qt/qtgui-5.15.2-r1/work/qtbase-everywhere-src-5.15.2/src/gui/vulkan/vk.xml /var/tmp/portage/dev-qt/qtgui-5.15.2-r1/work/qtbase-everywhere-src-5.15.2/header.LGPL vulkan/qvulkanfunctions
make: *** [Makefile:1664: vulkan/qvulkanfunctions.h] Illegal instruction
 * ERROR: dev-qt/qtgui-5.15.2-r1::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=dev-qt/qtgui-5.15.2-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-qt/qtgui-5.15.2-r1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-qt/qtgui-5.15.2-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-qt/qtgui-5.15.2-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-qt/qtgui-5.15.2-r1/work/qtbase-everywhere-src-5.15.2_build/src/gui'
 * S: '/var/tmp/portage/dev-qt/qtgui-5.15.2-r1/work/qtbase-everywhere-src-5.15.2'

>>> Failed to emerge dev-qt/qtgui-5.15.2-r1, Log file:

>>>  '/var/tmp/portage/dev-qt/qtgui-5.15.2-r1/temp/build.log'

 * Messages for package dev-qt/qtcore-5.15.2-r2:

 * Generated gentoo-qconfig.h is empty

 * Messages for package dev-qt/qtgui-5.15.2-r1:

 * ERROR: dev-qt/qtgui-5.15.2-r1::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=dev-qt/qtgui-5.15.2-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-qt/qtgui-5.15.2-r1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-qt/qtgui-5.15.2-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-qt/qtgui-5.15.2-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-qt/qtgui-5.15.2-r1/work/qtbase-everywhere-src-5.15.2_build/src/gui'
 * S: '/var/tmp/portage/dev-qt/qtgui-5.15.2-r1/work/qtbase-everywhere-src-5.15.2'

Reproducible: Always

Steps to Reproduce:
1. Install gentoo on hardware without SSE2
2. emerge vlc
3. get 'Illegal instruction error'



See debian configuration for building on hardware without SSE2:

https://salsa.debian.org/qt-kde-team/qt/qtbase/-/blob/master/debian/rules#L48
Comment 1 unlord 2021-03-12 16:27:58 UTC
Created attachment 690999 [details, diff]
qt5-build.eclass_no-sse2.patch

Add support for CPU_FLAGS_X86=-sse2 to qt5-build.eclass
Comment 2 unlord 2021-03-14 15:55:34 UTC
I can confirm that rebuilding all of Qt5 and VLC with this patch fixed the build errors.
Comment 3 Larry the Git Cow gentoo-dev 2024-07-02 17:49:32 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b597cc4cb8832fcc447ae998d4dac6677e0b2918

commit b597cc4cb8832fcc447ae998d4dac6677e0b2918
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-07-02 17:48:36 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-07-02 17:48:36 +0000

    qt5-build.eclass: try to avoid SSE2 where unavailable
    
    Rather overdue, but we got there eventually.
    
    Closes: https://bugs.gentoo.org/773199
    Bug: https://bugs.gentoo.org/552942
    Bug: https://bugs.gentoo.org/648004
    Bug: https://bugs.gentoo.org/775650
    Signed-off-by: Sam James <sam@gentoo.org>

 eclass/qt5-build.eclass | 3 +++
 1 file changed, 3 insertions(+)