zaurusd: fix build with kernels < 4.16 and newer libc headers
PATCH 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
--- .../zaurusd/zaurusd/add_64bit_time_t.patch | 43 +++++++++++++++++++ recipes-bsp/zaurusd/zaurusd_git.bb | 3 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 recipes-bsp/zaurusd/zaurusd/add_64bit_time_t.patch
recipes-bsp/zaurusd/zaurusd/add_64bit_time_t.patch new file +43 -0
@@ -0,0 +1,43 @@ +From d15b20fd9e8927db5dc4303f2e6c11cfa8d6fe95 Mon Sep 17 00:00:00 2001 +From: Andrea Adami <[email protected]> +Date: Mon, 20 Apr 2020 16:21:22 +0200 +Subject: [PATCH] tskeys.c: add support for 64bit time_t + +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..36e3bfd 100644 +--- a/apps/tskeys/tskeys.c ++++ b/apps/tskeys/tskeys.c +@@ -138,8 +138,13 @@ void press_key(int fd, int key, int pressed) + struct input_event ev; + int r; + ++#if !defined(__USE_TIME_BITS64) + ev.time.tv_sec = time(0); + ev.time.tv_usec = 0; ++#else ++ ev.input_event_sec = time(0); ++ ev.input_event_usec = 0; ++#endif + ev.type = EV_KEY; + ev.code = key; + ev.value = pressed; +-- +2.17.1 +
recipes-bsp/zaurusd/zaurusd_git.bb +2 -1
@@ -24,7 +24,8 @@ 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://add_64bit_time_t.patch" S = "${WORKDIR}/git"
Signature · 1 line
2.17.1
PATCH 2/4 layer.conf: set compatibility for warrior
--- conf/layer.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
conf/layer.conf +1 -1
@@ -18,5 +18,5 @@ BBFILE_PRIORITY_meta-handheld = "7" LAYERDEPENDS_meta-handheld = "core meta-initramfs openembedded-layer" -LAYERSERIES_COMPAT_meta-handheld = "sumo thud" +LAYERSERIES_COMPAT_meta-handheld = "sumo thud warrior"
Signature · 1 line
2.17.1
PATCH 3/4 layer.conf: set compatibility for zeus
In reply to Andrea Adami--- conf/layer.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
conf/layer.conf +1 -1
@@ -18,5 +18,5 @@ BBFILE_PRIORITY_meta-handheld = "7" LAYERDEPENDS_meta-handheld = "core meta-initramfs openembedded-layer" -LAYERSERIES_COMPAT_meta-handheld = "sumo thud warrior" +LAYERSERIES_COMPAT_meta-handheld = "sumo thud warrior zeus"
Signature · 1 line
2.17.1
PATCH 4/4 layer.conf: set compatibility for dunfell
In reply to Andrea Adami--- conf/layer.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
conf/layer.conf +1 -1
@@ -18,5 +18,5 @@ BBFILE_PRIORITY_meta-handheld = "7" LAYERDEPENDS_meta-handheld = "core meta-initramfs openembedded-layer" -LAYERSERIES_COMPAT_meta-handheld = "sumo thud warrior zeus" +LAYERSERIES_COMPAT_meta-handheld = "sumo thud warrior zeus dunfell"
Signature · 1 line
2.17.1
Quoted 46 lines · Andrea Adami
The Y2038 changes broke the build for older 32bit devices using older kernels.
As seen on: https://sourceware.org/glibc/wiki/Y2038ProofnessDesign
Signed-off-by Andrea Adami <[email protected]>--- .../zaurusd/zaurusd/add_64bit_time_t.patch | 43 +++++++++++++++++++ recipes-bsp/zaurusd/zaurusd_git.bb | 3 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 recipes-bsp/zaurusd/zaurusd/add_64bit_time_t.patchrecipes-bsp/zaurusd/zaurusd/add_64bit_time_t.patch new file +27
-0@@ -0,0 +1,43 @@ +From d15b20fd9e8927db5dc4303f2e6c11cfa8d6fe95 Mon Sep 17 00:00:00 2001 +From: Andrea Adami <[email protected]> +Date: Mon, 20 Apr 2020 16:21:22 +0200 +Subject: [PATCH] tskeys.c: add support for 64bit time_t + +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..36e3bfd 100644 +--- a/apps/tskeys/tskeys.c ++++ b/apps/tskeys/tskeys.c +@@ -138,8 +138,13 @@ void press_key(int fd, int key, int pressed)
recipes-bsp/zaurusd/zaurusd/add_64bit_time_t.patch line 37
Quoted 10 lines
recipes-bsp/zaurusd/zaurusd/add_64bit_time_t.patch new file +10
-0+ struct input_event ev; + int r; + ++#if !defined(__USE_TIME_BITS64) + ev.time.tv_sec = time(0); + ev.time.tv_usec = 0; ++#else ++ ev.input_event_sec = time(0); ++ ev.input_event_usec = 0; ++#endif
does this work with musl ?
Quoted 24 lines
recipes-bsp/zaurusd/zaurusd/add_64bit_time_t.patch new file +6
-0+ ev.type = EV_KEY; + ev.code = key; + ev.value = pressed; +-- +2.17.1 +recipes-bsp/zaurusd/zaurusd_git.bb +2
-2@@ -24,7 +24,8 @@ 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://add_64bit_time_t.patch" S = "${WORKDIR}/git" --2.17.1
Quoted 52 lines · Khem Raj
Quoted 50 lines · Andrea Adami
The Y2038 changes broke the build for older 32bit devices using older kernels.
As seen on: https://sourceware.org/glibc/wiki/Y2038ProofnessDesign
Signed-off-by Andrea Adami <[email protected]>--- .../zaurusd/zaurusd/add_64bit_time_t.patch | 43 +++++++++++++++++++ recipes-bsp/zaurusd/zaurusd_git.bb | 3 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 recipes-bsp/zaurusd/zaurusd/add_64bit_time_t.patchrecipes-bsp/zaurusd/zaurusd/add_64bit_time_t.patch new file +31
-0@@ -0,0 +1,43 @@ +From d15b20fd9e8927db5dc4303f2e6c11cfa8d6fe95 Mon Sep 17 00:00:00 2001 +From: Andrea Adami <[email protected]> +Date: Mon, 20 Apr 2020 16:21:22 +0200 +Subject: [PATCH] tskeys.c: add support for 64bit time_t + +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..36e3bfd 100644 +--- a/apps/tskeys/tskeys.c ++++ b/apps/tskeys/tskeys.c +@@ -138,8 +138,13 @@ void press_key(int fd, int key, int pressed) + struct input_event ev; + int r; + ++#if !defined(__USE_TIME_BITS64)
Quoted 9 lines
recipes-bsp/zaurusd/zaurusd/add_64bit_time_t.patch line 37
Quoted 6 lines
recipes-bsp/zaurusd/zaurusd/add_64bit_time_t.patch new file +6
-0+ ev.time.tv_sec = time(0); + ev.time.tv_usec = 0; ++#else ++ ev.input_event_sec = time(0); ++ ev.input_event_usec = 0; ++#endifdoes this work with musl ?
Yes, actually I tested it on musl first.
Build Configuration:
BB_VERSION = "1.46.0" BUILD_SYS = "x86_64-linux" NATIVELSBSTRING = "ubuntu-18.04" TARGET_SYS = "arm-oe-linux-musleabi" MACHINE = "spitz" DISTRO = "nodistro" DISTRO_VERSION = "nodistro.0" TUNE_FEATURES = "arm armv5 thumb dsp" TARGET_FPU = "soft" meta = "master-next:b450b0a2f5df27c4ea903ae9c5f6f5b96b9ddfc3" meta-oe = "master-next:205440e40f9a2d37a4f48391b03673a4aa042982" meta-handheld = "master:a876aaa33317d388aa2e865f665fe6cc58d500a7"
Quoted 24 lines
Quoted 24 lines
recipes-bsp/zaurusd/zaurusd/add_64bit_time_t.patch new file +6
-0+ ev.type = EV_KEY; + ev.code = key; + ev.value = pressed; +-- +2.17.1 +recipes-bsp/zaurusd/zaurusd_git.bb +2
-2@@ -24,7 +24,8 @@ 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://add_64bit_time_t.patch" S = "${WORKDIR}/git" --2.17.1
Thanks!
Quoted 117 lines · Andrea Adami
Quoted 2 lines · Khem Raj
On Mon, Apr 20, 2020 at 10:07 AM Andrea Adami <[email protected]>
Quoted 6 lines · wrote:
Quoted 6 lines
The Y2038 changes broke the build for older 32bit devices using older kernels.
As seen on: https://sourceware.org/glibc/wiki/Y2038ProofnessDesign
Quoted 8 lines
Review
Quoted 8 lines
Signed-off-by Andrea Adami <[email protected]>--- .../zaurusd/zaurusd/add_64bit_time_t.patch | 43 +++++++++++++++++++ recipes-bsp/zaurusd/zaurusd_git.bb | 3 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 recipes-bsp/zaurusd/zaurusd/add_64bit_time_t.patch(quoted diff) +0
-0
b/recipes-bsp/zaurusd/zaurusd/add_64bit_time_t.patchQuoted 11 lines
recipes-bsp/zaurusd/zaurusd/add_64bit_time_t.patch line 6
Quoted 11 lines
new file mode 100644
index 0000000..5f9587arecipes-bsp/zaurusd/zaurusd/add_64bit_time_t.patch new file +6
-0@@ -0,0 +1,43 @@ +From d15b20fd9e8927db5dc4303f2e6c11cfa8d6fe95 Mon Sep 17 00:00:00 2001 +From: Andrea Adami <[email protected]> +Date: Mon, 20 Apr 2020 16:21:22 +0200 +Subject: [PATCH] tskeys.c: add support for 64bit time_t + +Upgrade the recipe to cope with the 64-bit time changes introduced in4.16
Quoted 5 lines
recipes-bsp/zaurusd/zaurusd/add_64bit_time_t.patch
Quoted 5 lines
recipes-bsp/zaurusd/zaurusd/add_64bit_time_t.patch new file +5
-0+ +Fix: + +| tskeys.c: In function 'press_key': +| tskeys.c:141:4: error: 'struct input_event' has no member named'time'
Quoted 3 lines
recipes-bsp/zaurusd/zaurusd/add_64bit_time_t.patch
Quoted 3 lines
recipes-bsp/zaurusd/zaurusd/add_64bit_time_t.patch new file +3
-0+| 141 | ev.time.tv_sec = time(0); +| | ^ +| tskeys.c:142:4: error: 'struct input_event' has no member named'time'
Quoted 17 lines
Quoted 17 lines
recipes-bsp/zaurusd/zaurusd/add_64bit_time_t.patch new file +17
-0+| 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..36e3bfd 100644 +--- a/apps/tskeys/tskeys.c ++++ b/apps/tskeys/tskeys.c +@@ -138,8 +138,13 @@ void press_key(int fd, int key, int pressed) + struct input_event ev; + int r; + ++#if !defined(__USE_TIME_BITS64)Quoted 9 lines
recipes-bsp/zaurusd/zaurusd/add_64bit_time_t.patch line 37
Quoted 6 lines
recipes-bsp/zaurusd/zaurusd/add_64bit_time_t.patch new file +6
-0+ ev.time.tv_sec = time(0); + ev.time.tv_usec = 0; ++#else ++ ev.input_event_sec = time(0); ++ ev.input_event_usec = 0; ++#endifdoes this work with musl ?
Yes, actually I tested it on musl first.
Build Configuration:
BB_VERSION = "1.46.0" BUILD_SYS = "x86_64-linux" NATIVELSBSTRING = "ubuntu-18.04" TARGET_SYS = "arm-oe-linux-musleabi" MACHINE = "spitz" DISTRO = "nodistro" DISTRO_VERSION = "nodistro.0" TUNE_FEATURES = "arm armv5 thumb dsp" TARGET_FPU = "soft" meta ="master-next:b450b0a2f5df27c4ea903ae9c5f6f5b96b9ddfc3"
meta-oe =
"master-next:205440e40f9a2d37a4f48391b03673a4aa042982"
meta-handheld = "master:a876aaa33317d388aa2e865f665fe6cc58d500a7"Quoted 7 lines
recipes-bsp/zaurusd/
Quoted 7 lines
recipes-bsp/zaurusd/zaurusd/add_64bit_time_t.patch new file +6
-0+ ev.type = EV_KEY; + ev.code = key; + ev.value = pressed; +-- +2.17.1 +recipes-bsp/zaurusd/ renamed from recipes-bsp/zaurusd/zaurusd_git.bb +0
-0zaurusd_git.bb
Quoted 4 lines
recipes-bsp/zaurusd/zaurusd_git.bb SRC_URI = "git://git.yoctoproject.org/${BPN}
Quoted 4 lines
index d69805b..1f8e40b 100644
recipes-bsp/zaurusd/zaurusd_git.bb +0
-0@@ -24,7 +24,8 @@ SRC_URI = "git://git.yoctoproject.org/${BPN}<http://git.yoctoproject.org/$%7BBPN%7D> \
Quoted 13 lines
Quoted 13 lines
recipes-bsp/zaurusd/zaurusd_git.bb +2
-2file://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://add_64bit_time_t.patch" S = "${WORKDIR}/git" --2.17.1