Skip to contentSkip to conversation

package/qt5base: fix input_event related compile failure

PATCH New Peter Seiderer 3 participants 7 messages May 4, 2020 – May 11, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/qt5base: fix input_event related compile failure

Fixes:

- http://autobuild.buildroot.net/results/af76190876656252eb6f60220cdb1d627a03b7c3

evdevkeyboard/qevdevkeyboardhandler.cpp: In member function ?void QEvdevKeyboardHandler::switchLed(int, bool)?:
evdevkeyboard/qevdevkeyboardhandler.cpp:153:28: error: ?struct input_event? has no member named ?time?; did you mean ?type??

       ::gettimeofday(&led_ie.time, 0);
                              ^~~~
                              type

evdevtouch/qevdevtouchhandler.cpp: In member function ?void QEvdevTouchScreenData::processInputEvent(input_event*)?:
evdevtouch/qevdevtouchhandler.cpp:579:29: error: ?struct input_event? has no member named ?time?; did you mean ?type??

           m_timeStamp = data->time.tv_sec + data->time.tv_usec / 1000000.0;
                               ^~~~
                               type
  evdevtouch/qevdevtouchhandler.cpp:579:49: error: ?struct input_event? has no member named ?time?; did you mean ?type??
           m_timeStamp = data->time.tv_sec + data->time.tv_usec / 1000000.0;
                                                   ^~~~
                                                   type
---
 ...fix-input_event-time-related-compile.patch | 56 +++++++++++++++++++
 ...fix-input_event-time-related-compile.patch | 56 +++++++++++++++++++
 2 files changed, 112 insertions(+)
 create mode 100644 package/qt5/qt5base/0005-evdevkeyboard-fix-input_event-time-related-compile.patch
 create mode 100644 package/qt5/qt5base/0006-evdevtouch-fix-input_event-time-related-compile.patch
package/qt5/qt5base/0005-evdevkeyboard-fix-input_event-time-related-compile.patch new file +56 -0
new file mode 100644
index 0000000000..b1f64660eb
@@ -0,0 +1,56 @@
+From e3821efb37d64d599760b82beac024804188b824 Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <[email protected]>
+Date: Mon, 4 May 2020 23:17:45 +0200
+Subject: [PATCH 5/6] evdevkeyboard: fix input_event time related compile
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes:
+
+  evdevkeyboard/qevdevkeyboardhandler.cpp: In member function ?void QEvdevKeyboardHandler::switchLed(int, bool)?:
+  evdevkeyboard/qevdevkeyboardhandler.cpp:153:28: error: ?struct input_event? has no member named ?time?; did you mean ?type??
+       ::gettimeofday(&led_ie.time, 0);
+                              ^~~~
+                              type
+
+Signed-off-by: Peter Seiderer <[email protected]>
+---
+ .../input/evdevkeyboard/qevdevkeyboardhandler.cpp   | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
+index 3555763b..de37f5e2 100644
+--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
++++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
+@@ -58,6 +58,14 @@
+ #include <linux/input.h>
+ #endif
+ 
++#ifndef input_event_sec
++#define input_event_sec time.tv_sec
++#endif
++
++#ifndef input_event_usec
++#define input_event_usec time.tv_usec
++#endif
++
+ QT_BEGIN_NAMESPACE
+ 
+ Q_LOGGING_CATEGORY(qLcEvdevKey, "qt.qpa.input")
+@@ -149,8 +157,11 @@ void QEvdevKeyboardHandler::switchLed(int led, bool state)
+ {
+     qCDebug(qLcEvdevKey, "switchLed %d %d", led, int(state));
+ 
++    struct timeval tv;
++    ::gettimeofday(&tv, 0);
+     struct ::input_event led_ie;
+-    ::gettimeofday(&led_ie.time, 0);
++    led_ie.input_event_sec = tv.tv_sec;
++    led_ie.input_event_usec = tv.tv_usec;
+     led_ie.type = EV_LED;
+     led_ie.code = led;
+     led_ie.value = state;
+-- 
+2.26.2
+
package/qt5/qt5base/0006-evdevtouch-fix-input_event-time-related-compile.patch new file +56 -0

56 lines not on this page · raw message

Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/1 package/qt5base: fix input_event related compile failure

Quoted 40 lines · Peter Seiderer

Fixes:

- http://autobuild.buildroot.net/results/af76190876656252eb6f60220cdb1d627a03b7c3

evdevkeyboard/qevdevkeyboardhandler.cpp: In member function ?void QEvdevKeyboardHandler::switchLed(int, bool)?:
evdevkeyboard/qevdevkeyboardhandler.cpp:153:28: error: ?struct input_event? has no member named ?time?; did you mean ?type??

       ::gettimeofday(&led_ie.time, 0);
                              ^~~~
                              type

evdevtouch/qevdevtouchhandler.cpp: In member function ?void QEvdevTouchScreenData::processInputEvent(input_event*)?:
evdevtouch/qevdevtouchhandler.cpp:579:29: error: ?struct input_event? has no member named ?time?; did you mean ?type??

           m_timeStamp = data->time.tv_sec + data->time.tv_usec / 1000000.0;
                               ^~~~
                               type
  evdevtouch/qevdevtouchhandler.cpp:579:49: error: ?struct input_event? has no member named ?time?; did you mean ?type??
           m_timeStamp = data->time.tv_sec + data->time.tv_usec / 1000000.0;
                                                   ^~~~
                                                   type
---
 ...fix-input_event-time-related-compile.patch | 56 +++++++++++++++++++
 ...fix-input_event-time-related-compile.patch | 56 +++++++++++++++++++
 2 files changed, 112 insertions(+)
 create mode 100644 package/qt5/qt5base/0005-evdevkeyboard-fix-input_event-time-related-compile.patch
 create mode 100644 package/qt5/qt5base/0006-evdevtouch-fix-input_event-time-related-compile.patch
package/qt5/qt5base/0005-evdevkeyboard-fix-input_event-time-related-compile.patch new file +6 -0
new file mode 100644
index 0000000000..b1f64660eb
@@ -0,0 +1,56 @@
+From e3821efb37d64d599760b82beac024804188b824 Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <[email protected]>
+Date: Mon, 4 May 2020 23:17:45 +0200
+Subject: [PATCH 5/6] evdevkeyboard: fix input_event time related compile
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8

package/qt5/qt5base/0005-evdevkeyboard-fix-input_event-time-related-compile.patch line 16

Quoted 10 lines
package/qt5/qt5base/0005-evdevkeyboard-fix-input_event-time-related-compile.patch new file +10 -0
+Content-Transfer-Encoding: 8bit
+
+Fixes:
+
+  evdevkeyboard/qevdevkeyboardhandler.cpp: In member function ?void QEvdevKeyboardHandler::switchLed(int, bool)?:
+  evdevkeyboard/qevdevkeyboardhandler.cpp:153:28: error: ?struct input_event? has no member named ?time?; did you mean ?type??
+       ::gettimeofday(&led_ie.time, 0);
+                              ^~~~
+                              type
+

Upstream: https://codereview.qt-project.org/c/qt/qtbase/+/299345

Quoted 56 lines
package/qt5/qt5base/0005-evdevkeyboard-fix-input_event-time-related-compile.patch new file +40 -0
+Signed-off-by: Peter Seiderer <[email protected]>
+---
+ .../input/evdevkeyboard/qevdevkeyboardhandler.cpp   | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
+index 3555763b..de37f5e2 100644
+--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
++++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
+@@ -58,6 +58,14 @@
+ #include <linux/input.h>
+ #endif
+ 
++#ifndef input_event_sec
++#define input_event_sec time.tv_sec
++#endif
++
++#ifndef input_event_usec
++#define input_event_usec time.tv_usec
++#endif
++
+ QT_BEGIN_NAMESPACE
+ 
+ Q_LOGGING_CATEGORY(qLcEvdevKey, "qt.qpa.input")
+@@ -149,8 +157,11 @@ void QEvdevKeyboardHandler::switchLed(int led, bool state)
+ {
+     qCDebug(qLcEvdevKey, "switchLed %d %d", led, int(state));
+ 
++    struct timeval tv;
++    ::gettimeofday(&tv, 0);
+     struct ::input_event led_ie;
+-    ::gettimeofday(&led_ie.time, 0);
++    led_ie.input_event_sec = tv.tv_sec;
++    led_ie.input_event_usec = tv.tv_usec;
+     led_ie.type = EV_LED;
+     led_ie.code = led;
+     led_ie.value = state;
+-- 
+2.26.2
+
package/qt5/qt5base/0006-evdevtouch-fix-input_event-time-related-compile.patch new file +10 -0
new file mode 100644
index 0000000000..8acbb905c5
@@ -0,0 +1,56 @@
+From c9adb999cdb21f991f2c70b1d3b40e16d4fed2c0 Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <[email protected]>
+Date: Mon, 4 May 2020 23:19:25 +0200
+Subject: [PATCH 6/6] evdevtouch: fix input_event time related compile
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes:
+

package/qt5/qt5base/0006-evdevtouch-fix-input_event-time-related-compile.patch line 20

Quoted 10 lines
package/qt5/qt5base/0006-evdevtouch-fix-input_event-time-related-compile.patch new file +10 -0
+  evdevtouch/qevdevtouchhandler.cpp: In member function ?void QEvdevTouchScreenData::processInputEvent(input_event*)?:
+  evdevtouch/qevdevtouchhandler.cpp:579:29: error: ?struct input_event? has no member named ?time?; did you mean ?type??
+           m_timeStamp = data->time.tv_sec + data->time.tv_usec / 1000000.0;
+                               ^~~~
+                               type
+  evdevtouch/qevdevtouchhandler.cpp:579:49: error: ?struct input_event? has no member named ?time?; did you mean ?type??
+           m_timeStamp = data->time.tv_sec + data->time.tv_usec / 1000000.0;
+                                                   ^~~~
+                                                   type
+

Upstream: https://codereview.qt-project.org/c/qt/qtbase/+/299345

Regards,
Peter

Quoted 36 lines
package/qt5/qt5base/0006-evdevtouch-fix-input_event-time-related-compile.patch new file +36 -0
+Signed-off-by: Peter Seiderer <[email protected]>
+---
+ .../input/evdevtouch/qevdevtouchhandler.cpp            | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
+index c51db59e..94a9b103 100644
+--- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
++++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
+@@ -58,6 +58,14 @@
+ #include <linux/input.h>
+ #endif
+ 
++#ifndef input_event_sec
++#define input_event_sec time.tv_sec
++#endif
++
++#ifndef input_event_usec
++#define input_event_usec time.tv_usec
++#endif
++
+ #include <math.h>
+ 
+ #if QT_CONFIG(mtdev)
+@@ -576,7 +584,7 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data)
+ 
+         // update timestamps
+         m_lastTimeStamp = m_timeStamp;
+-        m_timeStamp = data->time.tv_sec + data->time.tv_usec / 1000000.0;
++        m_timeStamp = data->input_event_sec + data->input_event_usec / 1000000.0;
+ 
+         m_lastTouchPoints = m_touchPoints;
+         m_touchPoints.clear();
+-- 
+2.26.2
+
#2 lore raw

PATCH 1/1 package/qt5base: fix input_event related compile failure

In reply to Peter Seiderer
Quoted 20 lines · On Mon, 4 May 2020 23:45:52 +0200 Peter Seiderer <[email protected]> wrote:

Fixes:

- http://autobuild.buildroot.net/results/af76190876656252eb6f60220cdb1d627a03b7c3

evdevkeyboard/qevdevkeyboardhandler.cpp: In member function ?void QEvdevKeyboardHandler::switchLed(int, bool)?:
evdevkeyboard/qevdevkeyboardhandler.cpp:153:28: error: ?struct input_event? has no member named ?time?; did you mean ?type??

       ::gettimeofday(&led_ie.time, 0);
                              ^~~~
                              type

evdevtouch/qevdevtouchhandler.cpp: In member function ?void QEvdevTouchScreenData::processInputEvent(input_event*)?:
evdevtouch/qevdevtouchhandler.cpp:579:29: error: ?struct input_event? has no member named ?time?; did you mean ?type??

           m_timeStamp = data->time.tv_sec + data->time.tv_usec / 1000000.0;
                               ^~~~
                               type
  evdevtouch/qevdevtouchhandler.cpp:579:49: error: ?struct input_event? has no member named ?time?; did you mean ?type??
           m_timeStamp = data->time.tv_sec + data->time.tv_usec / 1000000.0;
                                                   ^~~~
                                                   type
Quoted 7 lines
---
 ...fix-input_event-time-related-compile.patch | 56 +++++++++++++++++++
 ...fix-input_event-time-related-compile.patch | 56 +++++++++++++++++++
 2 files changed, 112 insertions(+)
 create mode 100644 package/qt5/qt5base/0005-evdevkeyboard-fix-input_event-time-related-compile.patch
 create mode 100644 package/qt5/qt5base/0006-evdevtouch-fix-input_event-time-related-compile.patch

I've applied to master, after adding the upstream details of each patch, as they have now been merged upstream (thanks for your work!).

It would however be nice if you could remember to use "git format-patch -N" when generating patches and/or to run "make check-package" which would warn you about this :-)

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH 1/1 package/qt5base: fix input_event related compile failure

Hello Thomas,

Quoted 31 lines · Thomas Petazzoni
Quoted 20 lines · On Mon, 4 May 2020 23:45:52 +0200 Peter Seiderer <[email protected]> wrote:

Fixes:

- http://autobuild.buildroot.net/results/af76190876656252eb6f60220cdb1d627a03b7c3

evdevkeyboard/qevdevkeyboardhandler.cpp: In member function ?void QEvdevKeyboardHandler::switchLed(int, bool)?:
evdevkeyboard/qevdevkeyboardhandler.cpp:153:28: error: ?struct input_event? has no member named ?time?; did you mean ?type??

       ::gettimeofday(&led_ie.time, 0);
                              ^~~~
                              type

evdevtouch/qevdevtouchhandler.cpp: In member function ?void QEvdevTouchScreenData::processInputEvent(input_event*)?:
evdevtouch/qevdevtouchhandler.cpp:579:29: error: ?struct input_event? has no member named ?time?; did you mean ?type??

           m_timeStamp = data->time.tv_sec + data->time.tv_usec / 1000000.0;
                               ^~~~
                               type
  evdevtouch/qevdevtouchhandler.cpp:579:49: error: ?struct input_event? has no member named ?time?; did you mean ?type??
           m_timeStamp = data->time.tv_sec + data->time.tv_usec / 1000000.0;
                                                   ^~~~
                                                   type
Quoted 7 lines
---
 ...fix-input_event-time-related-compile.patch | 56 +++++++++++++++++++
 ...fix-input_event-time-related-compile.patch | 56 +++++++++++++++++++
 2 files changed, 112 insertions(+)
 create mode 100644 package/qt5/qt5base/0005-evdevkeyboard-fix-input_event-time-related-compile.patch
 create mode 100644 package/qt5/qt5base/0006-evdevtouch-fix-input_event-time-related-compile.patch  
Quoted 6 lines

I've applied to master, after adding the upstream details of each patch, as they have now been merged upstream (thanks for your work!).

It would however be nice if you could remember to use "git format-patch -N" when generating patches and/or to run "make check-package" which would warn you about this :-)

Ups, thanks for fixing it....will try to work more accurate ;-)

Regards,
Peter

Quoted 4 lines

Thanks!

Thomas

#4 lore raw

PATCH 1/1 package/qt5base: fix input_event related compile failure

In reply to Peter Seiderer
Quoted 13 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Peter" == Peter Seiderer <[email protected]> writes:

Fixes:
- http://autobuild.buildroot.net/results/af76190876656252eb6f60220cdb1d627a03b7c3

evdevkeyboard/qevdevkeyboardhandler.cpp: In member function ?void QEvdevKeyboardHandler::switchLed(int, bool)?:
evdevkeyboard/qevdevkeyboardhandler.cpp:153:28: error: ?struct input_event? has no member named ?time?; did you mean ?type??

       ::gettimeofday(&led_ie.time, 0);
                              ^~~~
                              type

evdevtouch/qevdevtouchhandler.cpp: In member function ?void QEvdevTouchScreenData::processInputEvent(input_event*)?:
evdevtouch/qevdevtouchhandler.cpp:579:29: error: ?struct input_event? has no member named ?time?; did you mean ?type??

Quoted 7 lines
           m_timeStamp = data->time.tv_sec + data->time.tv_usec / 1000000.0;
                               ^~~~
                               type
  evdevtouch/qevdevtouchhandler.cpp:579:49: error: ?struct input_event? has no member named ?time?; did you mean ?type??
           m_timeStamp = data->time.tv_sec + data->time.tv_usec / 1000000.0;
                                                   ^~~~
                                                   type

A similar fix is presumably also needed for 2020.02.x? Care to send a patch?

Signature · 1 line
Bye, Peter Korsgaard
#5 lore raw

PATCH 1/1 package/qt5base: fix input_event related compile failure

Quoted 22 lines
Quoted 12 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

"Peter" == Peter Korsgaard <[email protected]> writes:

"Peter" == Peter Seiderer <[email protected]> writes:

Fixes:
- http://autobuild.buildroot.net/results/af76190876656252eb6f60220cdb1d627a03b7c3

evdevkeyboard/qevdevkeyboardhandler.cpp: In member function ?void QEvdevKeyboardHandler::switchLed(int, bool)?:
evdevkeyboard/qevdevkeyboardhandler.cpp:153:28: error: ?struct input_event? has no member named ?time?; did you mean ?type?? ::gettimeofday(&led_ie.time, 0);
^~~~
type

Quoted 9 lines

evdevtouch/qevdevtouchhandler.cpp: In member function ?void QEvdevTouchScreenData::processInputEvent(input_event*)?:
evdevtouch/qevdevtouchhandler.cpp:579:29: error: ?struct input_event? has no member named ?time?; did you mean ?type?? m_timeStamp = data->time.tv_sec + data->time.tv_usec / 1000000.0;
^~~~
type
evdevtouch/qevdevtouchhandler.cpp:579:49: error: ?struct input_event? has no member named ?time?; did you mean ?type?? m_timeStamp = data->time.tv_sec + data->time.tv_usec / 1000000.0;
^~~~
type

Quoted 2 lines

A similar fix is presumably also needed for 2020.02.x? Care to send a patch?

Or perhaps not? This only triggers with musl 1.2.0+ on 32bit OS'es (which we don't have in 2020.02.x), right?

Signature · 1 line
Bye, Peter Korsgaard
#6 lore raw

PATCH 1/1 package/qt5base: fix input_event related compile failure

Hello Peter,

Quoted 22 lines · Peter Korsgaard
Quoted 21 lines
Quoted 21 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

"Peter" == Peter Korsgaard <[email protected]> writes:

"Peter" == Peter Seiderer <[email protected]> writes:

Fixes:
- http://autobuild.buildroot.net/results/af76190876656252eb6f60220cdb1d627a03b7c3

evdevkeyboard/qevdevkeyboardhandler.cpp: In member function ?void QEvdevKeyboardHandler::switchLed(int, bool)?:
evdevkeyboard/qevdevkeyboardhandler.cpp:153:28: error: ?struct input_event? has no member named ?time?; did you mean ?type?? ::gettimeofday(&led_ie.time, 0);
^~~~
type

evdevtouch/qevdevtouchhandler.cpp: In member function ?void QEvdevTouchScreenData::processInputEvent(input_event*)?:
evdevtouch/qevdevtouchhandler.cpp:579:29: error: ?struct input_event? has no member named ?time?; did you mean ?type?? m_timeStamp = data->time.tv_sec + data->time.tv_usec / 1000000.0;
^~~~
type
evdevtouch/qevdevtouchhandler.cpp:579:49: error: ?struct input_event? has no member named ?time?; did you mean ?type?? m_timeStamp = data->time.tv_sec + data->time.tv_usec / 1000000.0;
^~~~
type

Quoted 6 lines
Quoted 2 lines

A similar fix is presumably also needed for 2020.02.x? Care to send a patch?

Or perhaps not? This only triggers with musl 1.2.0+ on 32bit OS'es (which we don't have in 2020.02.x), right?

Yes, I believe your analysis is right, the musl 'package/musl: bump to version 1.2.0' commit ([1]) - only available on master - is stating:

This release moves all 32-bit archs to 64-bit time_t, enabling them to represent times beyond January of 2038.

There are no new requirements on kernel version, and this is not a hard ABI break, but the type changes do impact compatibility between code built against previous versions of musl and code built against musl 1.2. Users upgrading 32-bit systems should read the detailed time64 release notes [2]. 64-bit systems are not affected.

Which is exactly the failure cause (and autobuild configuration)...

Regards,
Peter

[1] https://git.buildroot.net/buildroot/commit/?id=c3012c3cc28a6686bb47f2489a218b90e557f0b8