From 894a4a66da764b8b6c8c910a09f9d96d2a9dd69b Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Tue, 19 Jul 2022 11:50:50 +0000 Subject: [PATCH 01/10] config/arch.arm: build with -D_TIME_BITS=64 to support 64-bit time on legacy ABIs --- config/arch.arm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/arch.arm b/config/arch.arm index 1d9da591a3..509f50cedd 100644 --- a/config/arch.arm +++ b/config/arch.arm @@ -69,7 +69,8 @@ fi # setup ARCH specific *FLAGS - TARGET_CFLAGS="-march=$TARGET_VARIANT -mtune=$TARGET_CPU -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated" + TARGET_CFLAGS="-march=$TARGET_VARIANT -mtune=$TARGET_CPU -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64" [ -n "$TARGET_FPU" ] && TARGET_CFLAGS="$TARGET_CFLAGS $TARGET_FPU_FLAGS" TARGET_LDFLAGS="-march=$TARGET_VARIANT -mtune=$TARGET_CPU" TARGET_ARCH_GCC_OPTS="--with-abi=aapcs-linux --with-arch=$TARGET_SUBARCH --with-float=$TARGET_FLOAT --with-fpu=$TARGET_FPU" + TARGET_CXXFLAGS="-D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64" From ddd8e1e3366f93e6621df619e80c87ebc3175ff6 Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Wed, 20 Jul 2022 09:57:26 +0000 Subject: [PATCH 02/10] glibc: dont build target with _TIME_BITS or _FILE_OFFSET_BITS for arm32 userland builds --- packages/devel/glibc/package.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/devel/glibc/package.mk b/packages/devel/glibc/package.mk index 666bf71015..1cbac45f9a 100644 --- a/packages/devel/glibc/package.mk +++ b/packages/devel/glibc/package.mk @@ -89,6 +89,14 @@ EOF # binaries to install into target GLIBC_INCLUDE_BIN="getent ldd locale localedef" + + # glibc does not need / nor build successfully with _FILE_OFFSET_BITS or _TIME_BITS set + if [ "${TARGET_ARCH}" = "arm" ]; then + export CFLAGS=$(echo ${CFLAGS} | sed -e "s|-D_FILE_OFFSET_BITS=64||g") + export CFLAGS=$(echo ${CFLAGS} | sed -e "s|-D_TIME_BITS=64||g") + export CXXFLAGS=$(echo ${CXXFLAGS} | sed -e "s|-D_FILE_OFFSET_BITS=64||g") + export CXXFLAGS=$(echo ${CXXFLAGS} | sed -e "s|-D_TIME_BITS=64||g") + fi } post_makeinstall_target() { From d27138adfb92c7ad1d42cc424dad06bbfcc4387d Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Tue, 19 Jul 2022 13:48:34 +0000 Subject: [PATCH 03/10] eventlircd: support -D_TIME_BITS=64 for 64-bit time --- .../eventlircd-01-support-time-bits-64.patch | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 packages/sysutils/eventlircd/patches/eventlircd-01-support-time-bits-64.patch diff --git a/packages/sysutils/eventlircd/patches/eventlircd-01-support-time-bits-64.patch b/packages/sysutils/eventlircd/patches/eventlircd-01-support-time-bits-64.patch new file mode 100644 index 0000000000..337ce86849 --- /dev/null +++ b/packages/sysutils/eventlircd/patches/eventlircd-01-support-time-bits-64.patch @@ -0,0 +1,23 @@ +--- a/src/input.c 2018-01-23 17:39:35.000000000 +0000 ++++ b/src/input.c 2022-07-19 13:44:12.924701772 +0000 +@@ -1100,8 +1100,8 @@ + if (device->repeat_filter == true) + { + if (evkey_type[device->current.event_out.code] == EVENTLIRCD_EVKEY_TYPE_KEY) { +- time_delta = 1000000 * (device->current.event_out.time.tv_sec - previous->event_out.time.tv_sec ) + +- (device->current.event_out.time.tv_usec - previous->event_out.time.tv_usec); ++ time_delta = 1000000 * (device->current.event_out.input_event_sec - previous->event_out.input_event_sec ) + ++ (device->current.event_out.input_event_usec - previous->event_out.input_event_usec); + if (((previous->repeat_count == 0) && (time_delta < 900000)) || + ((previous->repeat_count == 1) && (time_delta < 500000)) || + ((previous->repeat_count == 2) && (time_delta < 300000)) || +@@ -1116,7 +1116,8 @@ + } + } + previous->repeat_count++; +- previous->event_out.time = device->current.event_out.time; ++ previous->event_out.input_event_sec = device->current.event_out.input_event_sec; ++ previous->event_out.input_event_usec = device->current.event_out.input_event_usec; + device->current.repeat_count = previous->repeat_count; + break; + /* From 2da3f0e9edbd0d2c82f69bf852e8be8e9ebaab19 Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Tue, 19 Jul 2022 14:03:35 +0000 Subject: [PATCH 04/10] lirc: support -D_TIME_BITS=64 for 64-bit time --- .../lirc/patches/lirc-0102-support-time-bits-64.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 packages/sysutils/lirc/patches/lirc-0102-support-time-bits-64.patch diff --git a/packages/sysutils/lirc/patches/lirc-0102-support-time-bits-64.patch b/packages/sysutils/lirc/patches/lirc-0102-support-time-bits-64.patch new file mode 100644 index 0000000000..46a826a88f --- /dev/null +++ b/packages/sysutils/lirc/patches/lirc-0102-support-time-bits-64.patch @@ -0,0 +1,11 @@ +--- a/plugins/devinput.c 2017-09-10 08:52:19.000000000 +0000 ++++ b/plugins/devinput.c 2022-07-19 13:59:01.653286222 +0000 +@@ -459,7 +459,7 @@ + return 0; + } + +- log_trace("time %ld.%06ld type %d code %d value %d", event.time.tv_sec, event.time.tv_usec, event.type, ++ log_trace("time %ld.%06ld type %d code %d value %d", event.input_event_sec, event.input_event_usec, event.type, + event.code, event.value); + + value = (unsigned)event.value; From 6b43d18f17e32cd4fbe88db466155f0e7a39f602 Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Wed, 20 Jul 2022 09:02:17 +0000 Subject: [PATCH 05/10] zlib: support -D_TIME_BITS=64 for 64-bit time --- .../zlib/patches/zlib-01-support-time-bits-64.patch | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 packages/compress/zlib/patches/zlib-01-support-time-bits-64.patch diff --git a/packages/compress/zlib/patches/zlib-01-support-time-bits-64.patch b/packages/compress/zlib/patches/zlib-01-support-time-bits-64.patch new file mode 100644 index 0000000000..57e148095c --- /dev/null +++ b/packages/compress/zlib/patches/zlib-01-support-time-bits-64.patch @@ -0,0 +1,10 @@ +--- a/gzguts.h ++++ b/gzguts.h +@@ -9,6 +9,7 @@ + # endif + # ifdef _FILE_OFFSET_BITS + # undef _FILE_OFFSET_BITS ++# undef _TIME_BITS + # endif + #endif + From 6e1b03f68855388eb415917985bc37ea1c3deb27 Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Wed, 20 Jul 2022 12:39:01 +0000 Subject: [PATCH 06/10] dvb-apps: support-time-bits-64.patch --- .../patches/dvb-apps-60-support-time-bits-64.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 packages/addons/addon-depends/dvb-tools-depends/dvb-apps/patches/dvb-apps-60-support-time-bits-64.patch diff --git a/packages/addons/addon-depends/dvb-tools-depends/dvb-apps/patches/dvb-apps-60-support-time-bits-64.patch b/packages/addons/addon-depends/dvb-tools-depends/dvb-apps/patches/dvb-apps-60-support-time-bits-64.patch new file mode 100644 index 0000000000..73922452f7 --- /dev/null +++ b/packages/addons/addon-depends/dvb-tools-depends/dvb-apps/patches/dvb-apps-60-support-time-bits-64.patch @@ -0,0 +1,11 @@ +--- a/test/evtest.c 2014-03-21 19:26:36.000000000 +0000 ++++ b/test/evtest.c 2022-07-20 12:35:25.235888860 +0000 +@@ -241,7 +241,7 @@ + + for (i = 0; i < rd / (int) sizeof(struct input_event); i++) + printf("Event: time %ld.%06ld, type %d (%s), code %d (%s), value %d\n", +- ev[i].time.tv_sec, ev[i].time.tv_usec, ev[i].type, ++ ev[i].input_event_sec, ev[i].input_event_usec, ev[i].type, + events[ev[i].type] ? events[ev[i].type] : "?", + ev[i].code, + names[ev[i].type] ? (names[ev[i].type][ev[i].code] ? names[ev[i].type][ev[i].code] : "?") : "?", From 7f2a73ad1aa6d5ca86b374900726da40cb474ff7 Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Fri, 22 Jul 2022 01:35:32 +0000 Subject: [PATCH 07/10] tslib: support -D_TIME_BITS=64 for 64-bit time --- .../tslib-30-support-time-bits-64.patch | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 packages/addons/addon-depends/tslib/patches/tslib-30-support-time-bits-64.patch diff --git a/packages/addons/addon-depends/tslib/patches/tslib-30-support-time-bits-64.patch b/packages/addons/addon-depends/tslib/patches/tslib-30-support-time-bits-64.patch new file mode 100644 index 0000000000..bc8bb0262f --- /dev/null +++ b/packages/addons/addon-depends/tslib/patches/tslib-30-support-time-bits-64.patch @@ -0,0 +1,56 @@ +--- a/plugins/galax-raw.c 2022-07-21 15:46:14.666220340 +0000 ++++ b/plugins/galax-raw.c 2022-07-22 01:11:26.708402821 +0000 +@@ -198,7 +198,8 @@ + samp->x = i->current_x; + samp->y = i->current_y; + samp->pressure = i->current_p; +- samp->tv = ev.time; ++ samp->tv.tv_sec = ev.input_event_sec; ++ samp->tv.tv_usec = ev.input_event_usec; + samp++; + total++; + break; +--- a/plugins/input-raw.c 2013-08-08 00:23:04.000000000 +0000 ++++ b/plugins/input-raw.c 2022-07-22 01:30:41.417546206 +0000 +@@ -179,7 +179,8 @@ + samp->y = i->current_y; + samp->pressure = i->current_p; + } +- samp->tv = ev.time; ++ samp->tv.tv_sec = ev.input_event_sec; ++ samp->tv.tv_usec = ev.input_event_usec; + #ifdef DEBUG + fprintf(stderr, "RAW---------------------> %d %d %d %d.%d\n", + samp->x, samp->y, samp->pressure, samp->tv.tv_sec, +@@ -262,7 +263,8 @@ + samp->pressure = i->current_p = ev.value; + break; + } +- samp->tv = ev.time; ++ samp->tv.tv_sec = ev.input_event_sec; ++ samp->tv.tv_usec = ev.input_event_usec; + #ifdef DEBUG + fprintf(stderr, "RAW---------------------------> %d %d %d\n", + samp->x, samp->y, samp->pressure); +@@ -278,7 +280,8 @@ + samp->x = 0; + samp->y = 0; + samp->pressure = 0; +- samp->tv = ev.time; ++ samp->tv.tv_sec = ev.input_event_sec; ++ samp->tv.tv_usec = ev.input_event_usec; + samp++; + total++; + } +--- a/plugins/st1232-raw.c 2022-07-22 01:31:02.757483058 +0000 ++++ b/plugins/st1232-raw.c 2022-07-22 01:27:40.174757983 +0000 +@@ -162,7 +162,8 @@ + samp->x = i->current_x; + samp->y = i->current_y; + samp->pressure = i->current_p; /* is 0 on finger released */ +- samp->tv = ev.time; ++ samp->tv.tv_sec = ev.input_event_sec; ++ samp->tv.tv_usec = ev.input_event_usec; + + i->current_p = 0; /* will be set again when getting xy cordinate */ + samp++; From e80603557c6f497ffe4b794cb13597faf16ec308 Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Thu, 21 Jul 2022 10:37:47 +0000 Subject: [PATCH 08/10] libretro-fbneo: dont build target with _TIME_BITS or _FILE_OFFSET_BITS for arm32 userland builds --- packages/emulation/libretro-fbneo/package.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/emulation/libretro-fbneo/package.mk b/packages/emulation/libretro-fbneo/package.mk index a45cbb6c1c..5b59974647 100644 --- a/packages/emulation/libretro-fbneo/package.mk +++ b/packages/emulation/libretro-fbneo/package.mk @@ -27,6 +27,14 @@ pre_configure_target() { PKG_MAKE_OPTS_TARGET+="-neon" fi fi + + # libretro-fbneo does not need / nor build successfully with _FILE_OFFSET_BITS or _TIME_BITS set + if [ "${TARGET_ARCH}" = "arm" ]; then + export CFLAGS=$(echo ${CFLAGS} | sed -e "s|-D_FILE_OFFSET_BITS=64||g") + export CFLAGS=$(echo ${CFLAGS} | sed -e "s|-D_TIME_BITS=64||g") + export CXXFLAGS=$(echo ${CXXFLAGS} | sed -e "s|-D_FILE_OFFSET_BITS=64||g") + export CXXFLAGS=$(echo ${CXXFLAGS} | sed -e "s|-D_TIME_BITS=64||g") + fi } makeinstall_target() { From 79791faf430a8e9b0bdad49dd4f4c448b0b2137c Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Thu, 21 Jul 2022 10:56:28 +0000 Subject: [PATCH 09/10] mariadb: dont build target with _TIME_BITS or _FILE_OFFSET_BITS for arm32 userland builds The TIMESTAMP field in Mariadb is not Y2038 safe. Refer: https://mariadb.com/kb/en/timestamp/ https://jira.mariadb.org/browse/MDEV-341 --- packages/addons/service/mariadb/package.mk | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/addons/service/mariadb/package.mk b/packages/addons/service/mariadb/package.mk index 1dbeb1d6bf..1486e64596 100644 --- a/packages/addons/service/mariadb/package.mk +++ b/packages/addons/service/mariadb/package.mk @@ -20,6 +20,16 @@ PKG_SECTION="service" PKG_ADDON_NAME="MariaDB SQL database server" PKG_ADDON_TYPE="xbmc.service" +pre_configure_target() { + # mariadb does not need / nor build successfully with _FILE_OFFSET_BITS or _TIME_BITS set + if [ "${TARGET_ARCH}" = "arm" ]; then + export CFLAGS=$(echo ${CFLAGS} | sed -e "s|-D_FILE_OFFSET_BITS=64||g") + export CFLAGS=$(echo ${CFLAGS} | sed -e "s|-D_TIME_BITS=64||g") + export CXXFLAGS=$(echo ${CXXFLAGS} | sed -e "s|-D_FILE_OFFSET_BITS=64||g") + export CXXFLAGS=$(echo ${CXXFLAGS} | sed -e "s|-D_TIME_BITS=64||g") + fi +} + configure_package() { PKG_CMAKE_OPTS_HOST=" \ -DCMAKE_INSTALL_MESSAGE=NEVER \ From 9d2176bd54072aca9e32249dfa0e70913b7c27c1 Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Fri, 22 Jul 2022 13:39:26 +0000 Subject: [PATCH 10/10] distro: bump ADDON_VERSION to 10.80.7 --- distributions/LibreELEC/version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distributions/LibreELEC/version b/distributions/LibreELEC/version index 4435ee16dd..8c6c8e8825 100644 --- a/distributions/LibreELEC/version +++ b/distributions/LibreELEC/version @@ -5,4 +5,4 @@ OS_VERSION="11.0" # ADDON_VERSION: Addon version - ADDON_VERSION="10.80.6" + ADDON_VERSION="10.80.7"