[packages/qt6] - do not enable sse2 just because compiler supports it - qtwebengine aka chromium builds only on x86

baggins baggins at pld-linux.org
Mon Aug 1 12:43:57 CEST 2022


commit e6a2ba9ebdd7a149d80592ea7a541dbcae5c173f
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Mon Aug 1 12:43:12 2022 +0200

    - do not enable sse2 just because compiler supports it
    - qtwebengine aka chromium builds only on x8664

 no-implicit-sse2.patch | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++
 qt6.spec               |  9 +++++++-
 2 files changed, 69 insertions(+), 1 deletion(-)
---
diff --git a/qt6.spec b/qt6.spec
index ac9e2d6..5e8e5da 100644
--- a/qt6.spec
+++ b/qt6.spec
@@ -7,6 +7,7 @@
 # Conditional build:
 # -- build targets
 %bcond_without	doc		# Documentation
+%bcond_without	webengine	# Qt WebEngine
 # -- features
 %bcond_without	cups		# CUPS printing support
 %bcond_with	directfb	# DirectFB platform support
@@ -54,6 +55,9 @@
 %ifnarch %{arm} aarch64
 %define		with_red_reloc	1
 %endif
+%ifarch %{ix86} x32
+%undefine	with_webengine
+%endif
 
 %define		icu_abi		71
 %define		next_icu_abi	%(echo $((%{icu_abi} + 1)))
@@ -70,6 +74,7 @@ Source0:	https://download.qt.io/official_releases/qt/6.3/%{version}/single/qt-ev
 Patch0:		system-cacerts.patch
 Patch1:		ninja-program.patch
 Patch2:		%{name}-gn.patch
+Patch3:		no-implicit-sse2.patch
 URL:		https://www.qt.io/
 %{?with_directfb:BuildRequires:	DirectFB-devel}
 BuildRequires:	EGL-devel
@@ -116,7 +121,7 @@ BuildRequires:	libxml2-devel
 BuildRequires:	minizip-devel
 BuildRequires:	mtdev-devel
 %{?with_mysql:BuildRequires:	mysql-devel}
-BuildRequires:	nodejs
+%{?with_webengine:BuildRequires:	nodejs}
 BuildRequires:	openssl-devel >= 1.1.1
 BuildRequires:	opus-devel
 %{?with_oci:BuildRequires:	oracle-instantclient-devel}
@@ -1331,6 +1336,7 @@ Generator plików makefile dla aplikacji Qt6.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 %{__sed} -i -e 's,usr/X11R6/,usr/,g' qtbase/mkspecs/linux-g++-64/qmake.conf
 
@@ -1379,6 +1385,7 @@ mkdir -p build
 cd build
 %cmake ../ \
 	-GNinja \
+	%{cmake_on_off webengine BUILD_qtwebengine} \
 	-DCMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/samu \
 	-DNinja_EXECUTABLE:FILEPATH=/usr/bin/samu \
 	-DCMAKE_INSTALL_PREFIX=%{_prefix} \
diff --git a/no-implicit-sse2.patch b/no-implicit-sse2.patch
new file mode 100644
index 0000000..b0ac6f8
--- /dev/null
+++ b/no-implicit-sse2.patch
@@ -0,0 +1,61 @@
+--- qt-everywhere-src-6.3.1/qtbase/cmake/QtInternalTargets.cmake~	2022-05-25 10:58:52.000000000 +0200
++++ qt-everywhere-src-6.3.1/qtbase/cmake/QtInternalTargets.cmake	2022-08-01 09:55:49.012682536 +0200
+@@ -315,47 +315,6 @@
+     target_link_options(PlatformCommonInternal INTERFACE "-Wl,--enable-new-dtags")
+ endif()
+ 
+-function(qt_get_implicit_sse2_genex_condition out_var)
+-    set(is_shared_lib "$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>")
+-    set(is_static_lib "$<STREQUAL:$<TARGET_PROPERTY:TYPE>,STATIC_LIBRARY>")
+-    set(is_static_qt_build "$<NOT:$<BOOL:${QT_BUILD_SHARED_LIBS}>>")
+-    set(is_staitc_lib_during_static_qt_build "$<AND:${is_static_qt_build},${is_static_lib}>")
+-    set(enable_sse2_condition "$<OR:${is_shared_lib},${is_staitc_lib_during_static_qt_build}>")
+-    set(${out_var} "${enable_sse2_condition}" PARENT_SCOPE)
+-endfunction()
+-
+-function(qt_auto_detect_implicit_sse2)
+-    # sse2 configuration adjustment in qt_module.prf
+-    # If the compiler supports SSE2, enable it unconditionally in all of Qt shared libraries
+-    # (and only the libraries). This is not expected to be a problem because:
+-    # - on Windows, sharing of libraries is uncommon
+-    # - on Mac OS X, all x86 CPUs already have SSE2 support (we won't even reach here)
+-    # - on Linux, the dynamic loader can find the libraries on LIBDIR/sse2/
+-    # The last guarantee does not apply to executables and plugins, so we can't enable for them.
+-    set(__implicit_sse2_for_qt_modules_enabled FALSE PARENT_SCOPE)
+-    if(TEST_subarch_sse2 AND NOT TEST_arch_${TEST_architecture_arch}_subarch_sse2)
+-        qt_get_implicit_sse2_genex_condition(enable_sse2_condition)
+-        set(enable_sse2_genex "$<${enable_sse2_condition}:${QT_CFLAGS_SSE2}>")
+-        target_compile_options(PlatformModuleInternal INTERFACE ${enable_sse2_genex})
+-        set(__implicit_sse2_for_qt_modules_enabled TRUE PARENT_SCOPE)
+-    endif()
+-endfunction()
+-qt_auto_detect_implicit_sse2()
+-
+-function(qt_auto_detect_fpmath)
+-    # fpmath configuration adjustment in qt_module.prf
+-    set(fpmath_supported FALSE)
+-    if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang|GNU|IntelLLVM")
+-        set(fpmath_supported TRUE)
+-    endif()
+-    if(fpmath_supported AND TEST_architecture_arch STREQUAL "i386" AND __implicit_sse2_for_qt_modules_enabled)
+-        qt_get_implicit_sse2_genex_condition(enable_sse2_condition)
+-        set(enable_fpmath_genex "$<${enable_sse2_condition}:-mfpmath=sse>")
+-        target_compile_options(PlatformModuleInternal INTERFACE ${enable_fpmath_genex})
+-    endif()
+-endfunction()
+-qt_auto_detect_fpmath()
+-
+ function(qt_handle_apple_app_extension_api_only)
+     if(APPLE)
+         # Build Qt libraries with -fapplication-extension. Needed to avoid linker warnings
+--- qtbase/src/gui/painting/qdrawhelper_p.h~	2022-05-25 10:58:52.000000000 +0200
++++ qtbase/src/gui/painting/qdrawhelper_p.h	2022-08-01 10:05:33.794191916 +0200
+@@ -71,7 +71,7 @@
+ 
+ #if defined(Q_CC_GNU)
+ #  define Q_DECL_RESTRICT __restrict__
+-#  if defined(Q_PROCESSOR_X86_32) && defined(Q_CC_GNU) && !defined(Q_CC_CLANG) && !defined(Q_CC_INTEL)
++#  if defined(Q_PROCESSOR_X86_32) && defined(Q_CC_GNU) && !defined(Q_CC_CLANG) && !defined(Q_CC_INTEL) && defined(__SSE2__)
+ #    define Q_DECL_VECTORCALL __attribute__((sseregparm,regparm(3)))
+ #  else
+ #    define Q_DECL_VECTORCALL
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list