[oe-commits] [openembedded-core] 15/37: mtdev: Fix build when using 64bit time_t on 32bit machines

git at git.openembedded.org git at git.openembedded.org
Mon Nov 25 22:09:21 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit bfff2c66330849c45e75b1ca89a948ebf7d1432e
Author: Khem Raj <raj.khem at gmail.com>
AuthorDate: Mon Nov 25 00:44:49 2019 -0800

    mtdev: Fix build when using 64bit time_t on 32bit machines
    
    Signed-off-by: Khem Raj <raj.khem at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 ...-for-64bit-time_t-for-32bit-architectures.patch | 77 ++++++++++++++++++++++
 meta/recipes-graphics/wayland/mtdev_1.1.5.bb       |  4 +-
 2 files changed, 80 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-graphics/wayland/mtdev/0001-adjust-for-64bit-time_t-for-32bit-architectures.patch b/meta/recipes-graphics/wayland/mtdev/0001-adjust-for-64bit-time_t-for-32bit-architectures.patch
new file mode 100644
index 0000000..a0cebe5
--- /dev/null
+++ b/meta/recipes-graphics/wayland/mtdev/0001-adjust-for-64bit-time_t-for-32bit-architectures.patch
@@ -0,0 +1,77 @@
+From af75e8ee3d12a493b758421b2feed0351fdcbbf0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem at gmail.com>
+Date: Sat, 23 Nov 2019 13:44:32 -0800
+Subject: [PATCH] adjust for 64bit time_t for 32bit architectures
+
+libc that has support for 32 bit applications to use 64 bit
+time_t supplies __USE_TIME_BITS64 define [1]
+
+[1] https://sourceware.org/glibc/wiki/Y2038ProofnessDesign
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem at gmail.com>
+---
+ src/core.c        |  8 +++++++-
+ test/mtdev-test.c | 10 ++++++++--
+ 2 files changed, 15 insertions(+), 3 deletions(-)
+
+diff --git a/src/core.c b/src/core.c
+index 87ef420..0d91c0b 100644
+--- a/src/core.c
++++ b/src/core.c
+@@ -31,6 +31,11 @@
+ #include "evbuf.h"
+ #include "match.h"
+ 
++#ifndef input_event_sec
++#define input_event_sec time.tv_sec
++#define input_event_usec time.tv_usec
++#endif
++
+ static inline int istouch(const struct mtdev_slot *data,
+ 			  const struct mtdev *dev)
+ {
+@@ -251,7 +256,8 @@ static void push_slot_changes(struct mtdev_state *state,
+ 			count++;
+ 	if (!count)
+ 		return;
+-	ev.time = syn->time;
++	ev.input_event_sec = syn->input_event_sec;
++	ev.input_event_usec = syn->input_event_usec;
+ 	ev.type = EV_ABS;
+ 	ev.code = ABS_MT_SLOT;
+ 	ev.value = slot;
+diff --git a/test/mtdev-test.c b/test/mtdev-test.c
+index 1b3e4f2..773f86a 100644
+--- a/test/mtdev-test.c
++++ b/test/mtdev-test.c
+@@ -30,9 +30,15 @@
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <fcntl.h>
++#include <stdint.h>
++
++#ifndef input_event_sec
++#define input_event_sec time.tv_sec
++#define input_event_usec time.tv_usec
++#endif
+ 
+ /* year-proof millisecond event time */
+-typedef __u64 mstime_t;
++typedef uint64_t mstime_t;
+ 
+ static int use_event(const struct input_event *ev)
+ {
+@@ -47,7 +53,7 @@ static void print_event(const struct input_event *ev)
+ {
+ 	static const mstime_t ms = 1000;
+ 	static int slot;
+-	mstime_t evtime = ev->time.tv_usec / ms + ev->time.tv_sec * ms;
++	mstime_t evtime = ev->input_event_usec / ms + ev->input_event_sec * ms;
+ 	if (ev->type == EV_ABS && ev->code == ABS_MT_SLOT)
+ 		slot = ev->value;
+ 	fprintf(stderr, "%012llx %02d %01d %04x %d\n",
+-- 
+2.24.0
+
diff --git a/meta/recipes-graphics/wayland/mtdev_1.1.5.bb b/meta/recipes-graphics/wayland/mtdev_1.1.5.bb
index ccd0ebb..aa8bb69 100644
--- a/meta/recipes-graphics/wayland/mtdev_1.1.5.bb
+++ b/meta/recipes-graphics/wayland/mtdev_1.1.5.bb
@@ -11,7 +11,9 @@ SECTION = "libs"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://COPYING;md5=ea6bd0268bb0fcd6b27698616ceee5d6"
 
-SRC_URI = "http://bitmath.org/code/${BPN}/${BP}.tar.bz2"
+SRC_URI = "http://bitmath.org/code/${BPN}/${BP}.tar.bz2 \
+           file://0001-adjust-for-64bit-time_t-for-32bit-architectures.patch \
+"
 SRC_URI[md5sum] = "52c9610b6002f71d1642dc1a1cca5ec1"
 SRC_URI[sha256sum] = "6677d5708a7948840de734d8b4675d5980d4561171c5a8e89e54adf7a13eba7f"
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list