diff options
author | Khem Raj <raj.khem@gmail.com> | 2019-11-25 00:44:49 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-11-27 13:25:18 +0000 |
commit | cd06e458ad6246c65cf4e91874b4fbf2fbd30113 (patch) | |
tree | c2142514162de67250a5ebbd5c973e6c691b50e0 /meta | |
parent | 9f88035bb861d977aff136eeaec0a2ff7892331f (diff) | |
download | poky-cd06e458ad6246c65cf4e91874b4fbf2fbd30113.tar.gz |
mtdev: Fix build when using 64bit time_t on 32bit machines
(From OE-Core rev: 274c89a14214fd00ec8babffc6b223f41cdeba84)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-graphics/wayland/mtdev/0001-adjust-for-64bit-time_t-for-32bit-architectures.patch | 77 | ||||
-rw-r--r-- | meta/recipes-graphics/wayland/mtdev_1.1.5.bb | 4 |
2 files changed, 80 insertions, 1 deletions
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 0000000000..a0cebe5283 --- /dev/null +++ b/meta/recipes-graphics/wayland/mtdev/0001-adjust-for-64bit-time_t-for-32bit-architectures.patch | |||
@@ -0,0 +1,77 @@ | |||
1 | From af75e8ee3d12a493b758421b2feed0351fdcbbf0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 23 Nov 2019 13:44:32 -0800 | ||
4 | Subject: [PATCH] adjust for 64bit time_t for 32bit architectures | ||
5 | |||
6 | libc that has support for 32 bit applications to use 64 bit | ||
7 | time_t supplies __USE_TIME_BITS64 define [1] | ||
8 | |||
9 | [1] https://sourceware.org/glibc/wiki/Y2038ProofnessDesign | ||
10 | |||
11 | Upstream-Status: Pending | ||
12 | |||
13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
14 | --- | ||
15 | src/core.c | 8 +++++++- | ||
16 | test/mtdev-test.c | 10 ++++++++-- | ||
17 | 2 files changed, 15 insertions(+), 3 deletions(-) | ||
18 | |||
19 | diff --git a/src/core.c b/src/core.c | ||
20 | index 87ef420..0d91c0b 100644 | ||
21 | --- a/src/core.c | ||
22 | +++ b/src/core.c | ||
23 | @@ -31,6 +31,11 @@ | ||
24 | #include "evbuf.h" | ||
25 | #include "match.h" | ||
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 | static inline int istouch(const struct mtdev_slot *data, | ||
33 | const struct mtdev *dev) | ||
34 | { | ||
35 | @@ -251,7 +256,8 @@ static void push_slot_changes(struct mtdev_state *state, | ||
36 | count++; | ||
37 | if (!count) | ||
38 | return; | ||
39 | - ev.time = syn->time; | ||
40 | + ev.input_event_sec = syn->input_event_sec; | ||
41 | + ev.input_event_usec = syn->input_event_usec; | ||
42 | ev.type = EV_ABS; | ||
43 | ev.code = ABS_MT_SLOT; | ||
44 | ev.value = slot; | ||
45 | diff --git a/test/mtdev-test.c b/test/mtdev-test.c | ||
46 | index 1b3e4f2..773f86a 100644 | ||
47 | --- a/test/mtdev-test.c | ||
48 | +++ b/test/mtdev-test.c | ||
49 | @@ -30,9 +30,15 @@ | ||
50 | #include <stdio.h> | ||
51 | #include <unistd.h> | ||
52 | #include <fcntl.h> | ||
53 | +#include <stdint.h> | ||
54 | + | ||
55 | +#ifndef input_event_sec | ||
56 | +#define input_event_sec time.tv_sec | ||
57 | +#define input_event_usec time.tv_usec | ||
58 | +#endif | ||
59 | |||
60 | /* year-proof millisecond event time */ | ||
61 | -typedef __u64 mstime_t; | ||
62 | +typedef uint64_t mstime_t; | ||
63 | |||
64 | static int use_event(const struct input_event *ev) | ||
65 | { | ||
66 | @@ -47,7 +53,7 @@ static void print_event(const struct input_event *ev) | ||
67 | { | ||
68 | static const mstime_t ms = 1000; | ||
69 | static int slot; | ||
70 | - mstime_t evtime = ev->time.tv_usec / ms + ev->time.tv_sec * ms; | ||
71 | + mstime_t evtime = ev->input_event_usec / ms + ev->input_event_sec * ms; | ||
72 | if (ev->type == EV_ABS && ev->code == ABS_MT_SLOT) | ||
73 | slot = ev->value; | ||
74 | fprintf(stderr, "%012llx %02d %01d %04x %d\n", | ||
75 | -- | ||
76 | 2.24.0 | ||
77 | |||
diff --git a/meta/recipes-graphics/wayland/mtdev_1.1.5.bb b/meta/recipes-graphics/wayland/mtdev_1.1.5.bb index ccd0ebbfce..aa8bb69966 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" | |||
11 | LICENSE = "MIT" | 11 | LICENSE = "MIT" |
12 | LIC_FILES_CHKSUM = "file://COPYING;md5=ea6bd0268bb0fcd6b27698616ceee5d6" | 12 | LIC_FILES_CHKSUM = "file://COPYING;md5=ea6bd0268bb0fcd6b27698616ceee5d6" |
13 | 13 | ||
14 | SRC_URI = "http://bitmath.org/code/${BPN}/${BP}.tar.bz2" | 14 | SRC_URI = "http://bitmath.org/code/${BPN}/${BP}.tar.bz2 \ |
15 | file://0001-adjust-for-64bit-time_t-for-32bit-architectures.patch \ | ||
16 | " | ||
15 | SRC_URI[md5sum] = "52c9610b6002f71d1642dc1a1cca5ec1" | 17 | SRC_URI[md5sum] = "52c9610b6002f71d1642dc1a1cca5ec1" |
16 | SRC_URI[sha256sum] = "6677d5708a7948840de734d8b4675d5980d4561171c5a8e89e54adf7a13eba7f" | 18 | SRC_URI[sha256sum] = "6677d5708a7948840de734d8b4675d5980d4561171c5a8e89e54adf7a13eba7f" |
17 | 19 | ||