Skip to contentSkip to conversation

zaurusd: fix build with kernels < 4.16 and newer libc headers

PATCH New Andrea Adami 1 participant 1 message Apr 28, 2020

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/4 zaurusd: fix build with kernels < 4.16 and newer libc headers

The Y2038 changes broke the build for older 32bit devices using older kernels.

As seen on: https://sourceware.org/glibc/wiki/Y2038ProofnessDesign

Re-use the same fix applied for tslib as of commit id 9201611 tslib: Fix build with 4.x kernel headers

---
 .../zaurusd/zaurusd/64bit_time_t.patch        | 46 +++++++++++++++++++
 recipes-bsp/zaurusd/zaurusd_git.bb            |  5 +-
 2 files changed, 49 insertions(+), 2 deletions(-)
 create mode 100644 recipes-bsp/zaurusd/zaurusd/64bit_time_t.patch
recipes-bsp/zaurusd/zaurusd/64bit_time_t.patch new file +46 -0
new file mode 100644
index 0000000..a12c7bb
@@ -0,0 +1,46 @@
+From e5bb568619c22d701e8fcd705563acbf7885f735 Mon Sep 17 00:00:00 2001
+From: Andrea Adami <[email protected]>
+Date: Tue, 28 Apr 2020 21:21:29 +0200
+Subject: [PATCH] tskeys.c: fix build with kernels < 4.16 and newer libc
+ headers
+
+The Y2038 changes broke the build for legacy 32bit devices using
+older kernels.
+
+Upgrade the recipe to cope with the 64-bit time changes introduced in 4.16
+
+Fix:
+
+ tskeys.c: In function 'press_key':
+ tskeys.c:141:4: error: 'struct input_event' has no member named 'time'
+   141 |  ev.time.tv_sec = time(0);
+       |    ^
+ tskeys.c:142:4: error: 'struct input_event' has no member named 'time'
+   142 |  ev.time.tv_usec = 0;
+       |    ^
+
+
+Signed-off-by: Andrea Adami <[email protected]>
+---
+ apps/tskeys/tskeys.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/apps/tskeys/tskeys.c b/apps/tskeys/tskeys.c
+index 264dfb7..0020012 100644
+--- a/apps/tskeys/tskeys.c
++++ b/apps/tskeys/tskeys.c
+@@ -21,6 +21,11 @@
+ 
+ #define MAX_OFFSCREEN_KEYS  20
+ 
++#ifndef input_event_sec
++#define input_event_sec time.tv_sec
++#define input_event_usec time.tv_usec
++#endif
++
+ struct rectangle {
+ 	int16_t x1;
+ 	int16_t y1;
+-- 
+2.17.1
+
recipes-bsp/zaurusd/zaurusd_git.bb +3 -2
index d69805b..663ef1b 100644
@@ -24,8 +24,9 @@ SRC_URI = "git://git.yoctoproject.org/${BPN} \
            file://01-check-toggle-portait \
            file://use-ts-symlink-instead-of-hardcoding.diff \
            file://0001-zaurusd-add-support-for-collie.patch \
-           file://allow-newer-tslib.patch"
-
+           file://allow-newer-tslib.patch \
+           file://64bit_time_t.patch \
+"
 
 S = "${WORKDIR}/git"
 
Signature · 1 line
2.17.1