summaryrefslogtreecommitdiff
path: root/dev-qt
diff options
context:
space:
mode:
authorIonen Wolkens <ionen@gentoo.org>2024-08-12 17:22:22 -0400
committerIonen Wolkens <ionen@gentoo.org>2024-08-12 21:25:51 -0400
commitca034bbed6d34c7e87a013a35ac9d72f5f8dc040 (patch)
treeb0e8e625318f85db25bb4876379446f779990126 /dev-qt
parentdev-qt/qtbase: fix build with gcc15, incl. for revdeps (diff)
downloadgentoo-ca034bbed6d34c7e87a013a35ac9d72f5f8dc040.tar.gz
gentoo-ca034bbed6d34c7e87a013a35ac9d72f5f8dc040.tar.bz2
gentoo-ca034bbed6d34c7e87a013a35ac9d72f5f8dc040.zip
dev-qt/qtbase: backport float16 fix for systems without sse2
Needs a revbump but it was done in previous commit at same time for another reason. Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
Diffstat (limited to 'dev-qt')
-rw-r--r--dev-qt/qtbase/files/qtbase-6.7.2-float16-sse2.patch43
-rw-r--r--dev-qt/qtbase/qtbase-6.7.2-r2.ebuild1
2 files changed, 44 insertions, 0 deletions
diff --git a/dev-qt/qtbase/files/qtbase-6.7.2-float16-sse2.patch b/dev-qt/qtbase/files/qtbase-6.7.2-float16-sse2.patch
new file mode 100644
index 000000000000..a54c9daa42b9
--- /dev/null
+++ b/dev-qt/qtbase/files/qtbase-6.7.2-float16-sse2.patch
@@ -0,0 +1,43 @@
+Backport from 6.7.3 as it may cause major problems for x86 sse2-less
+systems using gcc14.
+
+https://github.com/qt/qtbase/commit/39fa7e7bef90be2940c5f736935f963e3969e0bd
+From: Dmitry Shachnev <mitya57@gmail.com>
+Date: Sat, 27 Jul 2024 23:03:07 +0300
+Subject: [PATCH] Use _Float16 only when SSE2 is enabled
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The GCC documentation [1] says: “On x86 targets with SSE2 enabled, GCC
+supports half-precision (16-bit) floating point via the _Float16 type”.
+
+On non-SSE2 x86 (such as Debian i386 baseline [2]), __FLT16_MAX__ is
+defined starting with GCC 14 [3], however any non-trivial use of the
+_Float16 type results in an error:
+
+error: operation not permitted on type ‘_Float16’ without option ‘-msse2’
+
+which makes some packages fail to build on i386 architecture [4].
+
+[1]: https://gcc.gnu.org/onlinedocs/gcc/Half-Precision.html
+[2]: https://wiki.debian.org/ArchitectureSpecificsMemo#i386-1
+[3]: https://gcc.gnu.org/g:9a19fa8b616f83474c35cc5b34a3865073ced829
+[4]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1076986
+--- a/src/corelib/global/qtypes.h
++++ b/src/corelib/global/qtypes.h
+@@ -264,11 +264,10 @@
+ # define QFLOAT16_IS_NATIVE 1
+ using NativeFloat16Type = decltype(__FLT16_MAX__);
+-#elif defined(Q_CC_GNU_ONLY) && defined(__FLT16_MAX__)
++#elif defined(Q_CC_GNU_ONLY) && defined(__FLT16_MAX__) && defined(__ARM_FP16_FORMAT_IEEE)
+ # define QFLOAT16_IS_NATIVE 1
+-# ifdef __ARM_FP16_FORMAT_IEEE
+ using NativeFloat16Type = __fp16;
+-# else
++#elif defined(Q_CC_GNU_ONLY) && defined(__FLT16_MAX__) && defined(__SSE2__)
++# define QFLOAT16_IS_NATIVE 1
+ using NativeFloat16Type = _Float16;
+-# endif
+ #else
+ # define QFLOAT16_IS_NATIVE 0
diff --git a/dev-qt/qtbase/qtbase-6.7.2-r2.ebuild b/dev-qt/qtbase/qtbase-6.7.2-r2.ebuild
index 3b8705b716fd..68a5c8f9e4fa 100644
--- a/dev-qt/qtbase/qtbase-6.7.2-r2.ebuild
+++ b/dev-qt/qtbase/qtbase-6.7.2-r2.ebuild
@@ -147,6 +147,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-6.6.3-gcc14-avx512fp16.patch
"${FILESDIR}"/${PN}-6.7.2-CVE-2024-39936.patch
"${FILESDIR}"/${PN}-6.7.2-gcc15-odr.patch
+ "${FILESDIR}"/${PN}-6.7.2-float16-sse2.patch
)
src_prepare() {