kumquat-buildroot/package/qt6/qt6base/0001-src-corelib-global-qsimd_p.h-fix-build-on-ARM-v7-due.patch
Thomas Petazzoni 9522dde070 package/qt6/qt6base: new package
This commit proposes a very minimal package for qt6base. It only
supports building QtCore, so it *really* is minimal. But that's a
starting point, which we can progressively build on top. It is based
on initial work from Peter Seiderer.

This minimal QtCore build is however sufficient to build and run
simple non-graphical Qt applications.

A number of comments:

 - Even though there's only qt6base for now, many other qt6 modules
   will come later on, which is why we're using the same structure as
   for qt5, with a subdir for package/qt6/

 - Qt6 is mutually exclusive with Qt5. Even though the library names
   on the target and the location of the header files are distinct,
   the host tools (qmake, moc and al.) have the same name, so at least
   for now, we make them mutually exclusive.

 - We've chosen to use non-bundled libraries for zlib, bb2,
   double-conversion and pcre2, for both the target and the host
   qt6base packages.

 - Contrary to qt5 where the target package was building the host
   tools, now we have a host qt6base package building the host tools,
   and which is needed as a dependency for the target qt6base package.

 - qt6base is using CMake. However, it strongly recommends to use
   Ninja as a backend instead of make, a recommendation that we follow
   in this commit. Since we don't have support for Ninja in the
   cmake-package infrastructure (yet), we do this manually in
   qt6base.mk itself, by passing -Gninja to CMake at configure time,
   and then by using cmake --build at build time and cmake --install
   at install time, using explicitly provided build and install
   commands. Hopefully these can go away once we have support for
   Ninja directly in cmake-package.

 - We disable a number of features or external libraries using FEATURE
   options. However, because there are over 400 FEATURE options in
   qt6base, we didn't go all the way to explicitly disabling *all* of
   them (which would be needed for both the host and target
   packages). We expect that this list of explicit FEATURE options
   disabling will need to grow based on the feedback of users and
   issues encountered.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-07-26 22:54:38 +02:00

50 lines
2.0 KiB
Diff

From d69db2ba3ce47f6eded0a8843c413a67d26e6375 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Date: Sun, 24 Jul 2022 20:37:51 +0200
Subject: [PATCH] src/corelib/global/qsimd_p.h: fix build on ARM < v7 due to
yield instruction
On ARM < v7 with gcc, the build fails with:
/tmp/ccRlrCQi.s: Assembler messages:
/tmp/ccRlrCQi.s:3858: Error: selected processor does not support `yield' in ARM mode
/tmp/ccRlrCQi.s:3875: Error: selected processor does not support `yield' in ARM mode
/tmp/ccRlrCQi.s:4606: Error: selected processor does not support `yield' in ARM mode
/tmp/ccRlrCQi.s:4853: Error: selected processor does not support `yield' in ARM mode
/tmp/ccRlrCQi.s:5268: Error: selected processor does not support `yield' in ARM mode
while building src/corelib/thread/qfutureinterface.cpp.
This is due to the fact that the qYieldCpu() macro on ARM, assumes
that if the compiler is gcc, we can do asm volatile("yield"). However,
this instruction is only guaranteed to exist on ARMv7+ cores. It
doesn't exist on ARMv5, and only some (but not all) ARMv6 cores have
it. If it's not available, we just fallback to the default behavior of
qYieldCpu(), which is to do nothing.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Upstream bug: https://bugreports.qt.io/browse/QTBUG-105162
---
src/corelib/global/qsimd_p.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/corelib/global/qsimd_p.h b/src/corelib/global/qsimd_p.h
index d270d09f2f..b84b257e54 100644
--- a/src/corelib/global/qsimd_p.h
+++ b/src/corelib/global/qsimd_p.h
@@ -428,7 +428,10 @@ static inline void qYieldCpu()
https://stackoverflow.com/a/70076751/134841
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105416
*/
- asm volatile("yield"); /* this works everywhere */
+# if defined(Q_PROCESSOR_ARM_V7)
+ /* The yield instruction appeared in ARMv7 */
+ asm volatile("yield");
+# endif
# else
__yield(); /* this is what should work everywhere */
# endif
--
2.37.1