[packages/qt6] upstream fix to adapt half precision fp support detection for gcc 14; rel 3

atler atler at pld-linux.org
Tue Aug 6 16:04:43 CEST 2024


commit 454511a596667b182f52fdec6aa99b6e7c782954
Author: Jan Palus <atler at pld-linux.org>
Date:   Tue Aug 6 16:01:03 2024 +0200

    upstream fix to adapt half precision fp support detection for gcc 14; rel 3
    
    see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116122

 gcc14.patch | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 qt6.spec    |  4 +++-
 2 files changed, 61 insertions(+), 1 deletion(-)
---
diff --git a/qt6.spec b/qt6.spec
index 54dc011..f64f86c 100644
--- a/qt6.spec
+++ b/qt6.spec
@@ -113,7 +113,7 @@ Summary:	Qt6 Library
 Summary(pl.UTF-8):	Biblioteka Qt6
 Name:		qt6
 Version:	6.7.2
-Release:	2
+Release:	3
 License:	LGPL v3 or GPL v2 or GPL v3 or commercial
 Group:		X11/Libraries
 Source0:	https://download.qt.io/official_releases/qt/6.7/%{version}/single/qt-everywhere-src-%{version}.tar.xz
@@ -125,6 +125,7 @@ Patch3:		no-implicit-sse2.patch
 Patch4:		x32.patch
 Patch5:		qtwebengine-cmake-build-type.patch
 Patch6:		CVE-2024-39936-qtbase-6.7.patch
+Patch7:		gcc14.patch
 URL:		https://www.qt.io/
 %{?with_directfb:BuildRequires:	DirectFB-devel}
 BuildRequires:	EGL-devel
@@ -3695,6 +3696,7 @@ narzędzia.
 %patch4 -p1
 %patch5 -p1
 %patch6 -p1 -d qtbase
+%patch7 -p1 -d qtbase
 
 %{__sed} -i -e 's,usr/X11R6/,usr/,g' qtbase/mkspecs/linux-g++-64/qmake.conf
 
diff --git a/gcc14.patch b/gcc14.patch
new file mode 100644
index 0000000..d5bd600
--- /dev/null
+++ b/gcc14.patch
@@ -0,0 +1,58 @@
+From 39fa7e7bef90be2940c5f736935f963e3969e0bd Mon Sep 17 00:00:00 2001
+From: Dmitry Shachnev <mitya57 at gmail.com>
+Date: Sat, 27 Jul 2024 23:03:07 +0300
+Subject: 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
+
+Pick-to: 6.8 6.7 6.5
+Change-Id: I393ee83eb8e8888f5fc9e3b349dc8b063eef6f5a
+Reviewed-by: Thiago Macieira <thiago.macieira at intel.com>
+Reviewed-by: Edward Welbourne <edward.welbourne at qt.io>
+---
+ src/corelib/global/qtypes.h | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+(limited to 'src/corelib/global/qtypes.h')
+
+diff --git a/src/corelib/global/qtypes.h b/src/corelib/global/qtypes.h
+index db9ba38e4c..28458f63c2 100644
+--- a/src/corelib/global/qtypes.h
++++ b/src/corelib/global/qtypes.h
+@@ -263,13 +263,12 @@ using NativeFloat16Type = std::float16_t;
+ // disabled due to https://github.com/llvm/llvm-project/issues/56963
+ #  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
+ using NativeFloat16Type = void;
+-- 
+cgit v1.2.3
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/qt6.git/commitdiff/454511a596667b182f52fdec6aa99b6e7c782954



More information about the pld-cvs-commit mailing list