diff options
author | Khem Raj <raj.khem@gmail.com> | 2019-10-05 17:23:11 -0700 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2019-10-08 20:02:46 +0000 |
commit | 6b5122ef14cb8c5ba5a9f790d824e92667e88783 (patch) | |
tree | 90eb737cd8e90d11646e85a205f3884e797b1279 | |
parent | 6442c54d10750016083b06a8bc22b9bffc5e26a2 (diff) | |
download | meta-qt5-6b5122ef14cb8c5ba5a9f790d824e92667e88783.tar.gz |
qtbase: Fix build when fp16 is used
Conversions between float and half are only available when the
taraget has the half-precision extension. Guard these intrinsics
accordingly
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | recipes-qt/qt5/nativesdk-qtbase_git.bb | 1 | ||||
-rw-r--r-- | recipes-qt/qt5/qtbase-native_git.bb | 1 | ||||
-rw-r--r-- | recipes-qt/qt5/qtbase/0001-qfloat16-check-for-__ARM_FP-2.patch | 37 | ||||
-rw-r--r-- | recipes-qt/qt5/qtbase_git.bb | 1 |
4 files changed, 40 insertions, 0 deletions
diff --git a/recipes-qt/qt5/nativesdk-qtbase_git.bb b/recipes-qt/qt5/nativesdk-qtbase_git.bb index 1727fbb9..3de1ef0f 100644 --- a/recipes-qt/qt5/nativesdk-qtbase_git.bb +++ b/recipes-qt/qt5/nativesdk-qtbase_git.bb | |||
@@ -41,6 +41,7 @@ SRC_URI += "\ | |||
41 | file://0014-Qt5GuiConfigExtras.cmake.in-cope-with-variable-path-.patch \ | 41 | file://0014-Qt5GuiConfigExtras.cmake.in-cope-with-variable-path-.patch \ |
42 | file://0015-corelib-Include-sys-types.h-for-uint32_t.patch \ | 42 | file://0015-corelib-Include-sys-types.h-for-uint32_t.patch \ |
43 | file://0016-Define-QMAKE_CXX.COMPILER_MACROS-for-clang-on-linux.patch \ | 43 | file://0016-Define-QMAKE_CXX.COMPILER_MACROS-for-clang-on-linux.patch \ |
44 | file://0001-qfloat16-check-for-__ARM_FP-2.patch \ | ||
44 | " | 45 | " |
45 | 46 | ||
46 | # common for qtbase-native and nativesdk-qtbase | 47 | # common for qtbase-native and nativesdk-qtbase |
diff --git a/recipes-qt/qt5/qtbase-native_git.bb b/recipes-qt/qt5/qtbase-native_git.bb index 19181b69..f38bcffa 100644 --- a/recipes-qt/qt5/qtbase-native_git.bb +++ b/recipes-qt/qt5/qtbase-native_git.bb | |||
@@ -36,6 +36,7 @@ SRC_URI += "\ | |||
36 | file://0014-Qt5GuiConfigExtras.cmake.in-cope-with-variable-path-.patch \ | 36 | file://0014-Qt5GuiConfigExtras.cmake.in-cope-with-variable-path-.patch \ |
37 | file://0015-corelib-Include-sys-types.h-for-uint32_t.patch \ | 37 | file://0015-corelib-Include-sys-types.h-for-uint32_t.patch \ |
38 | file://0016-Define-QMAKE_CXX.COMPILER_MACROS-for-clang-on-linux.patch \ | 38 | file://0016-Define-QMAKE_CXX.COMPILER_MACROS-for-clang-on-linux.patch \ |
39 | file://0001-qfloat16-check-for-__ARM_FP-2.patch \ | ||
39 | " | 40 | " |
40 | 41 | ||
41 | # common for qtbase-native and nativesdk-qtbase | 42 | # common for qtbase-native and nativesdk-qtbase |
diff --git a/recipes-qt/qt5/qtbase/0001-qfloat16-check-for-__ARM_FP-2.patch b/recipes-qt/qt5/qtbase/0001-qfloat16-check-for-__ARM_FP-2.patch new file mode 100644 index 00000000..fdcb0cfa --- /dev/null +++ b/recipes-qt/qt5/qtbase/0001-qfloat16-check-for-__ARM_FP-2.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | From 89ec5b0cdd8663ec2602dec3e151388bab2b4594 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 5 Oct 2019 16:21:08 -0700 | ||
4 | Subject: [PATCH] qfloat16: check for __ARM_FP & 2 | ||
5 | |||
6 | Clang hides vcvt_f16_f32() and vcvt_f32_f16() behind (__ARM_FP & 2) where 2 refers to -mfpu=fp-armv8. | ||
7 | However, GCC would only build this code if -march=armv8.2-a+fp16 is passed as well. | ||
8 | |||
9 | global/qfloat16.cpp:149:31: error: use of undeclared identifier 'vcvt_f16_f32' | ||
10 | vst1_f16(out_f16 + i, vcvt_f16_f32(vld1q_f32(in + i))); | ||
11 | ^ | ||
12 | global/qfloat16.cpp:159:28: error: use of undeclared identifier 'vcvt_f32_f16' | ||
13 | vst1q_f32(out + i, vcvt_f32_f16(vld1_f16(in_f16 + i))); | ||
14 | ^ | ||
15 | |||
16 | Upstream-Status: Pending | ||
17 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
18 | --- | ||
19 | src/corelib/global/qfloat16.cpp | 2 +- | ||
20 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
21 | |||
22 | diff --git a/src/corelib/global/qfloat16.cpp b/src/corelib/global/qfloat16.cpp | ||
23 | index fd608efe55..604a8a9cd8 100644 | ||
24 | --- a/src/corelib/global/qfloat16.cpp | ||
25 | +++ b/src/corelib/global/qfloat16.cpp | ||
26 | @@ -135,7 +135,7 @@ f16cextern void qFloatFromFloat16_fast(float *out, const quint16 *in, qsizetype | ||
27 | #undef f16cextern | ||
28 | } | ||
29 | |||
30 | -#elif defined(__ARM_FP16_FORMAT_IEEE) && defined(__ARM_NEON__) | ||
31 | +#elif defined(__ARM_FP16_FORMAT_IEEE) && defined(__ARM_NEON__) && (__ARM_FP & 2) | ||
32 | static inline bool hasFastF16() | ||
33 | { | ||
34 | return true; | ||
35 | -- | ||
36 | 2.23.0 | ||
37 | |||
diff --git a/recipes-qt/qt5/qtbase_git.bb b/recipes-qt/qt5/qtbase_git.bb index b4ccca86..90096026 100644 --- a/recipes-qt/qt5/qtbase_git.bb +++ b/recipes-qt/qt5/qtbase_git.bb | |||
@@ -32,6 +32,7 @@ SRC_URI += "\ | |||
32 | file://0014-Qt5GuiConfigExtras.cmake.in-cope-with-variable-path-.patch \ | 32 | file://0014-Qt5GuiConfigExtras.cmake.in-cope-with-variable-path-.patch \ |
33 | file://0015-corelib-Include-sys-types.h-for-uint32_t.patch \ | 33 | file://0015-corelib-Include-sys-types.h-for-uint32_t.patch \ |
34 | file://0016-Define-QMAKE_CXX.COMPILER_MACROS-for-clang-on-linux.patch \ | 34 | file://0016-Define-QMAKE_CXX.COMPILER_MACROS-for-clang-on-linux.patch \ |
35 | file://0001-qfloat16-check-for-__ARM_FP-2.patch \ | ||
35 | " | 36 | " |
36 | 37 | ||
37 | # for syncqt | 38 | # for syncqt |