diff options
author | Khem Raj <raj.khem@gmail.com> | 2019-11-25 09:15:38 -0800 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2019-11-27 10:45:51 +0100 |
commit | f6ad80f95ae9951fc8830dcf2cdec6430fb2d910 (patch) | |
tree | 83a0fc0ce0ea2955d7e1bff5062f441117415fca | |
parent | b7f4bd209c03c4f765cec84f4aa247819a6bb2f3 (diff) | |
download | meta-qt5-f6ad80f95ae9951fc8830dcf2cdec6430fb2d910.tar.gz |
qtbase: Fix build on 32bit arches with 64bit time_t
time element is deprecated on new input_event structure in kernel's
input.h
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/0018-input-Make-use-of-timeval-portable-for-64bit-time_t.patch | 62 | ||||
-rw-r--r-- | recipes-qt/qt5/qtbase_git.bb | 1 |
4 files changed, 65 insertions, 0 deletions
diff --git a/recipes-qt/qt5/nativesdk-qtbase_git.bb b/recipes-qt/qt5/nativesdk-qtbase_git.bb index 8a4b471b..1b18f7c2 100644 --- a/recipes-qt/qt5/nativesdk-qtbase_git.bb +++ b/recipes-qt/qt5/nativesdk-qtbase_git.bb | |||
@@ -42,6 +42,7 @@ SRC_URI += "\ | |||
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://0017-qfloat16-check-for-__ARM_FP-2.patch \ | 44 | file://0017-qfloat16-check-for-__ARM_FP-2.patch \ |
45 | file://0018-input-Make-use-of-timeval-portable-for-64bit-time_t.patch \ | ||
45 | " | 46 | " |
46 | 47 | ||
47 | # common for qtbase-native and nativesdk-qtbase | 48 | # 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 4af7f8c0..083e5306 100644 --- a/recipes-qt/qt5/qtbase-native_git.bb +++ b/recipes-qt/qt5/qtbase-native_git.bb | |||
@@ -37,6 +37,7 @@ SRC_URI += "\ | |||
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://0017-qfloat16-check-for-__ARM_FP-2.patch \ | 39 | file://0017-qfloat16-check-for-__ARM_FP-2.patch \ |
40 | file://0018-input-Make-use-of-timeval-portable-for-64bit-time_t.patch \ | ||
40 | " | 41 | " |
41 | 42 | ||
42 | # common for qtbase-native and nativesdk-qtbase | 43 | # common for qtbase-native and nativesdk-qtbase |
diff --git a/recipes-qt/qt5/qtbase/0018-input-Make-use-of-timeval-portable-for-64bit-time_t.patch b/recipes-qt/qt5/qtbase/0018-input-Make-use-of-timeval-portable-for-64bit-time_t.patch new file mode 100644 index 00000000..76b4671c --- /dev/null +++ b/recipes-qt/qt5/qtbase/0018-input-Make-use-of-timeval-portable-for-64bit-time_t.patch | |||
@@ -0,0 +1,62 @@ | |||
1 | From e06ac2e26c8490a7b8702e9462d1f38244ac3f0f Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Mon, 25 Nov 2019 08:27:39 -0800 | ||
4 | Subject: [PATCH] input: Make use of timeval portable for 64bit time_t | ||
5 | |||
6 | This patch avoids using time field of input_event structure which is not available | ||
7 | on 32bit arches supporting 64bit time_t structs, Patch makes it compatible with new | ||
8 | and keeps old input.h implementation functional as well. | ||
9 | |||
10 | See https://sourceware.org/glibc/wiki/Y2038ProofnessDesign | ||
11 | |||
12 | Upstream-Status: Submitted [https://codereview.qt-project.org/c/qt/qtbase/+/282610] | ||
13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
14 | --- | ||
15 | .../input/evdevkeyboard/qevdevkeyboardhandler.cpp | 10 +++++++++- | ||
16 | .../input/evdevtouch/qevdevtouchhandler.cpp | 2 +- | ||
17 | 2 files changed, 10 insertions(+), 2 deletions(-) | ||
18 | |||
19 | diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp | ||
20 | index 666613f09d..0e3e0ea0de 100644 | ||
21 | --- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp | ||
22 | +++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp | ||
23 | @@ -58,6 +58,11 @@ | ||
24 | #include <linux/input.h> | ||
25 | #endif | ||
26 | |||
27 | +#ifndef input_event_sec | ||
28 | +#define input_event_sec time.tv_sec | ||
29 | +#define input_event_usec time.tv_usec | ||
30 | +#endif | ||
31 | + | ||
32 | QT_BEGIN_NAMESPACE | ||
33 | |||
34 | Q_LOGGING_CATEGORY(qLcEvdevKey, "qt.qpa.input") | ||
35 | @@ -149,7 +154,10 @@ void QEvdevKeyboardHandler::switchLed(int led, bool state) | ||
36 | qCDebug(qLcEvdevKey) << "switchLed" << led << state; | ||
37 | |||
38 | struct ::input_event led_ie; | ||
39 | - ::gettimeofday(&led_ie.time, 0); | ||
40 | + struct timeval tval; | ||
41 | + ::gettimeofday(&tval, 0); | ||
42 | + led_ie.input_event_sec = tval.tv_sec; | ||
43 | + led_ie.input_event_usec = tval.tv_usec; | ||
44 | led_ie.type = EV_LED; | ||
45 | led_ie.code = led; | ||
46 | led_ie.value = state; | ||
47 | diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp | ||
48 | index f86f80785e..3914698f2a 100644 | ||
49 | --- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp | ||
50 | +++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp | ||
51 | @@ -568,7 +568,7 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data) | ||
52 | |||
53 | // update timestamps | ||
54 | m_lastTimeStamp = m_timeStamp; | ||
55 | - m_timeStamp = data->time.tv_sec + data->time.tv_usec / 1000000.0; | ||
56 | + m_timeStamp = data->input_event_sec + data->input_event_usec / 1000000.0; | ||
57 | |||
58 | m_lastTouchPoints = m_touchPoints; | ||
59 | m_touchPoints.clear(); | ||
60 | -- | ||
61 | 2.24.0 | ||
62 | |||
diff --git a/recipes-qt/qt5/qtbase_git.bb b/recipes-qt/qt5/qtbase_git.bb index 05bc716d..1b9bb0a9 100644 --- a/recipes-qt/qt5/qtbase_git.bb +++ b/recipes-qt/qt5/qtbase_git.bb | |||
@@ -33,6 +33,7 @@ SRC_URI += "\ | |||
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://0017-qfloat16-check-for-__ARM_FP-2.patch \ | 35 | file://0017-qfloat16-check-for-__ARM_FP-2.patch \ |
36 | file://0018-input-Make-use-of-timeval-portable-for-64bit-time_t.patch \ | ||
36 | " | 37 | " |
37 | 38 | ||
38 | # for syncqt | 39 | # for syncqt |