Browse Source

add BR2_TIME_BITS_64 config in buildroot to build Y2038-ready code

huangliang 3 months ago
parent
commit
92ffcb5832

BIN
buildroot-2024.02.11/dl/iproute2/iproute2-6.7.0.tar.xz


BIN
buildroot-2024.02.11/dl/libgpiod/libgpiod-1.6.4.tar.xz


BIN
buildroot-2024.02.11/dl/libv4l/v4l-utils-1.24.1.tar.bz2


BIN
buildroot-2024.02.11/dl/libv4l/v4l-utils-1.28.1.tar.xz


BIN
buildroot-2024.02.11/dl/memtester/memtester-4.5.1.tar.gz


+ 135 - 0
buildroot-2024.02.11/package/directfb/0008-fix-inputevent-time-bits64-compile-err.patch

@@ -0,0 +1,135 @@
+From 2bb39207206f83b7f349cbe0071c8542994c1680 Mon Sep 17 00:00:00 2001
+From: huangliang <huangliang@arkmicro.com>
+Date: Sat, 6 Sep 2025 14:27:00 +0800
+Subject: [PATCH] fix-inputevent-time-bits64-compile-err
+
+---
+ inputdrivers/linux_input/linux_input.c | 38 +++++++++++++++++++-------
+ 1 file changed, 28 insertions(+), 10 deletions(-)
+
+diff --git a/inputdrivers/linux_input/linux_input.c b/inputdrivers/linux_input/linux_input.c
+index 7e9a6ad..0ef7b44 100644
+--- a/inputdrivers/linux_input/linux_input.c
++++ b/inputdrivers/linux_input/linux_input.c
+@@ -754,7 +754,12 @@ translate_event( const LinuxInputData     *data,
+                  DFBInputEvent            *devt )
+ {
+      devt->flags     = DIEF_TIMESTAMP;
++#if _TIME_BITS == 64
++     devt->timestamp.tv_sec = levt->__sec;
++     devt->timestamp.tv_usec = levt->__usec;
++#else
+      devt->timestamp = levt->time;
++#endif
+ 
+      switch (levt->type) {
+           case EV_KEY:
+@@ -2139,7 +2144,12 @@ touchpad_translate( struct touchpad_fsm_state *state,
+      int abs, rel;
+ 
+      devt->flags     = DIEF_TIMESTAMP | (dfb_config->linux_input_touch_abs ? DIEF_AXISABS : DIEF_AXISREL);
++#if _TIME_BITS == 64
++     devt->timestamp.tv_sec = levt->__sec;
++     devt->timestamp.tv_usec = levt->__usec;
++#else
+      devt->timestamp = levt->time;
++#endif
+      devt->type      = DIET_AXISMOTION;
+ 
+      switch (levt->code) {
+@@ -2204,6 +2214,14 @@ touchpad_fsm( struct touchpad_fsm_state *state,
+               DFBInputEvent             *devt )
+ {
+      struct timeval timeout = { 0, 125000 };
++     struct timeval levt_time;
++
++#if _TIME_BITS == 64
++     levt_time.tv_sec = levt->__sec;
++     levt_time.tv_usec = levt->__usec;
++#else
++     levt_time = levt->time;
++#endif
+ 
+      /* select() timeout? */
+      if (!levt) {
+@@ -2233,7 +2251,7 @@ touchpad_fsm( struct touchpad_fsm_state *state,
+ 
+           /* Check if button release is due. */
+           if (state->fsm_state == TOUCHPAD_FSM_DRAG_START &&
+-              timeout_passed( &state->timeout, &levt->time )) {
++              timeout_passed( &state->timeout, &levt_time )) {
+                devt->flags     = DIEF_TIMESTAMP;
+                devt->timestamp = state->timeout; /* timeout of levt->time? */
+                devt->type      = DIET_BUTTONRELEASE;
+@@ -2255,28 +2273,28 @@ touchpad_fsm( struct touchpad_fsm_state *state,
+      case TOUCHPAD_FSM_START:
+           if (touchpad_finger_landing( levt )) {
+                state->fsm_state = TOUCHPAD_FSM_MAIN;
+-               state->timeout = levt->time;
++               state->timeout = levt_time;
+                timeout_add( &state->timeout, &timeout );
+           }
+           return 0;
+ 
+      case TOUCHPAD_FSM_MAIN:
+           if (touchpad_finger_moving( levt )) {
+-               if (1){//timeout_passed( &state->timeout, &levt->time )) {
++               if (1){//timeout_passed( &state->timeout, &levt_time )) {
+                     //timeout_clear( &state->timeout );
+                     return touchpad_translate( state, levt, devt );
+                }
+           }
+           else if (touchpad_finger_leaving( levt )) {
+-               if (!timeout_passed( &state->timeout, &levt->time )) {
++               if (!timeout_passed( &state->timeout, &levt_time )) {
+                     devt->flags     = DIEF_TIMESTAMP;
+-                    devt->timestamp = levt->time;
++                    devt->timestamp = levt_time;
+                     devt->type      = DIET_BUTTONPRESS;
+                     devt->button    = DIBI_FIRST;
+ 
+                     touchpad_fsm_init( state );
+                     state->fsm_state = TOUCHPAD_FSM_DRAG_START;
+-                    state->timeout = levt->time;
++                    state->timeout = levt_time;
+                     timeout_add( &state->timeout, &timeout );
+                     return 1;
+                }
+@@ -2287,7 +2305,7 @@ touchpad_fsm( struct touchpad_fsm_state *state,
+           return 0;
+ 
+      case TOUCHPAD_FSM_DRAG_START:
+-          if (timeout_passed( &state->timeout, &levt->time )){
++          if (timeout_passed( &state->timeout, &levt_time )){
+                devt->flags     = DIEF_TIMESTAMP;
+                devt->timestamp = state->timeout; /* timeout of levt->time? */
+                devt->type      = DIET_BUTTONRELEASE;
+@@ -2299,7 +2317,7 @@ touchpad_fsm( struct touchpad_fsm_state *state,
+           else {
+                if (touchpad_finger_landing( levt )) {
+                     state->fsm_state = TOUCHPAD_FSM_DRAG_MAIN;
+-                    state->timeout = levt->time;
++                    state->timeout = levt_time;
+                     timeout_add( &state->timeout, &timeout );
+                }
+           }
+@@ -2307,14 +2325,14 @@ touchpad_fsm( struct touchpad_fsm_state *state,
+ 
+      case TOUCHPAD_FSM_DRAG_MAIN:
+           if (touchpad_finger_moving( levt )) {
+-               if (1){//timeout_passed( &state->timeout, &levt->time )) {
++               if (1){//timeout_passed( &state->timeout, &levt_time )) {
+                    //timeout_clear( &state->timeout );
+                     return touchpad_translate( state, levt, devt );
+                }
+           }
+           else if (touchpad_finger_leaving( levt )) {
+                devt->flags     = DIEF_TIMESTAMP;
+-               devt->timestamp = levt->time;
++               devt->timestamp = levt_time;
+                devt->type      = DIET_BUTTONRELEASE;
+                devt->button    = DIBI_FIRST;
+ 
+-- 
+2.25.1
+

+ 37 - 0
buildroot-2024.02.11/package/libv4l/0001-meson.build-fix-arm-_TIME_BITS-64-error.patch

@@ -0,0 +1,37 @@
+From 6faf5e963eadeab8b7d47d5b3c14f06e0ae1da01 Mon Sep 17 00:00:00 2001
+From: Hans Verkuil <hverkuil@xs4all.nl>
+Date: Sat, 12 Apr 2025 12:30:13 +0200
+Subject: [PATCH] meson.build: fix arm _TIME_BITS=64 error
+
+Undefine _TIME_BITS to avoid this error on 32-bit arm:
+
+/usr/include/features-time64.h:26:5: error: #error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
+
+Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
+Upstream: https://git.linuxtv.org/v4l-utils.git/commit/?id=d517cfdcdc16533ab7e06e97c07ca089cf261aef
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+---
+ meson.build | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 269a9da7..31927cda 100644
+--- a/meson.build
++++ b/meson.build
+@@ -53,8 +53,12 @@ v4l2_wrapper_args = [
+     # As the library needs to provide both 32-bit and 64-bit versions
+     # of file operations, disable transparent large file support (fixes
+     # 'Error: symbol `open64/mmap64' is already defined' compile failure
+-    # otherwise)
++    # otherwise).
++    #
++    # Also disable _TIME_BITS=64 since this is allowed only with
++    # _FILE_OFFSET_BITS=64, which is now 32.
+     '-U_FILE_OFFSET_BITS',
++    '-U_TIME_BITS',
+     '-D_FILE_OFFSET_BITS=32',
+     '-D_LARGEFILE64_SOURCE',
+ ]
+-- 
+2.49.0
+

+ 83 - 0
buildroot-2024.02.11/package/libv4l/0002-libv4lconvert-fix-jpeg-v9x-gcc-14.x-compile-jpeg_mem.patch

@@ -0,0 +1,83 @@
+From 9f0da8467183f9f647bddc4a5b4f01aad930846a Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <ps.report@gmx.net>
+Date: Mon, 2 Sep 2024 15:59:53 +0200
+Subject: [PATCH] libv4lconvert: fix jpeg-v9x/gcc-14.x compile (jpeg_mem_dest
+ argument mismatch)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+- fix jpeg_mem_dest pointer arument mismatch (long unsigned int vs. size_t)
+  with jpeg-v9x/gcc-14.x 32-bit arm compile
+
+Fixes:
+
+  ../lib/libv4lconvert/jl2005bcd.c: In function ‘v4lconvert_decode_jl2005bcd’:
+  ../lib/libv4lconvert/jl2005bcd.c:94:46: error: passing argument 3 of ‘jpeg_mem_dest’ from incompatible pointer type [-Wincompatible-pointer-types]
+     94 |         jpeg_mem_dest (&cinfo, &jpeg_header, &jpeg_header_size);
+        |                                              ^~~~~~~~~~~~~~~~~
+        |                                              |
+        |                                              long unsigned int *
+  In file included from ../lib/libv4lconvert/libv4lconvert-priv.h:26,
+                   from ../lib/libv4lconvert/jl2005bcd.c:30:
+  .../host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/jpeglib.h:979:28: note: expected ‘size_t *’ {aka ‘unsigned int *’} but argument is of type ‘long unsigned int *’
+    979 | EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo,
+        |                            ^~~
+
+  ../lib/libv4lconvert/jpeg.c: In function ‘init_libjpeg_cinfo’:
+  ../lib/libv4lconvert/jpeg.c:157:45: error: passing argument 3 of ‘jpeg_mem_dest’ from incompatible pointer type [-Wincompatible-pointer-types]
+    157 |         jpeg_mem_dest(&cinfo, &jpeg_header, &jpeg_header_size);
+        |                                             ^~~~~~~~~~~~~~~~~
+        |                                             |
+        |                                             long unsigned int *
+  In file included from ../lib/libv4lconvert/libv4lconvert-priv.h:26,
+                   from ../lib/libv4lconvert/jpeg.c:21:
+  .../host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/jpeglib.h:979:28: note: expected ‘size_t *’ {aka ‘unsigned int *’} but argument is of type ‘long unsigned int *’
+    979 | EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo,
+        |                            ^~~
+
+Signed-off-by: Peter Seiderer <ps.report@gmx.net>
+Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
+Upstream: https://git.linuxtv.org/v4l-utils.git/commit/?id=e11e10ff7c8a4ef69526edd275c0ed92a450fbf3
+[Romain: backport to 1.28.1]
+Signed-off-by: Romain Naour <romain.naour@smile.fr>
+---
+ lib/libv4lconvert/jl2005bcd.c | 4 ++++
+ lib/libv4lconvert/jpeg.c      | 4 ++++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/lib/libv4lconvert/jl2005bcd.c b/lib/libv4lconvert/jl2005bcd.c
+index 707c3205..14b040f3 100644
+--- a/lib/libv4lconvert/jl2005bcd.c
++++ b/lib/libv4lconvert/jl2005bcd.c
+@@ -63,7 +63,11 @@ int v4lconvert_decode_jl2005bcd(struct v4lconvert_data *data,
+ 	struct jpeg_decompress_struct dinfo;
+ 	struct jpeg_error_mgr jcerr, jderr;
+ 	JOCTET *jpeg_header = NULL;
++#if JPEG_LIB_VERSION >= 90
++	size_t jpeg_header_size = 0;
++#else
+ 	unsigned long jpeg_header_size = 0;
++#endif
+ 	int i, x, y, x1, y1, jpeg_data_size, jpeg_data_idx, eoi, size;
+ 
+ 	/* src_size had better be bigger than 16 */
+diff --git a/lib/libv4lconvert/jpeg.c b/lib/libv4lconvert/jpeg.c
+index ebfc8149..450d0967 100644
+--- a/lib/libv4lconvert/jpeg.c
++++ b/lib/libv4lconvert/jpeg.c
+@@ -136,7 +136,11 @@ static void init_libjpeg_cinfo(struct v4lconvert_data *data)
+ {
+ 	struct jpeg_compress_struct cinfo;
+ 	unsigned char *jpeg_header = NULL;
++#if JPEG_LIB_VERSION >= 90
++	size_t jpeg_header_size = 0;
++#else
+ 	unsigned long jpeg_header_size = 0;
++#endif
+ 
+ 	if (data->cinfo_initialized)
+ 		return;
+-- 
+2.50.1
+

+ 2 - 2
buildroot-2024.02.11/package/libv4l/libv4l.hash

@@ -1,7 +1,7 @@
 # Locally calculated after checking signature
-# https://linuxtv.org/downloads/v4l-utils/v4l-utils-1.20.0.tar.bz2.asc
+# https://linuxtv.org/downloads/v4l-utils/v4l-utils-1.28.1.tar.xz.asc
 # with key 05D0169C26E41593418129DF199A64FADFB500FF
-sha256  cbb7fe8a6307f5ce533a05cded70bb93c3ba06395ab9b6d007eb53b75d805f5b  v4l-utils-1.24.1.tar.bz2
+sha256  0fa075ce59b6618847af6ea191b6155565ccaa44de0504581ddfed795a328a82  v4l-utils-1.28.1.tar.xz
 
 # Locally calculated
 sha256  391e4da1c54a422a78d83be7bf84b2dfb8bacdd8ad256fa4374e128655584a8a  COPYING

+ 19 - 29
buildroot-2024.02.11/package/libv4l/libv4l.mk

@@ -4,40 +4,38 @@
 #
 ################################################################################
 
-LIBV4L_VERSION = 1.24.1
-LIBV4L_SOURCE = v4l-utils-$(LIBV4L_VERSION).tar.bz2
+LIBV4L_VERSION = 1.28.1
+LIBV4L_SOURCE = v4l-utils-$(LIBV4L_VERSION).tar.xz
 LIBV4L_SITE = https://linuxtv.org/downloads/v4l-utils
 LIBV4L_INSTALL_STAGING = YES
 LIBV4L_DEPENDENCIES = host-pkgconf
-LIBV4L_CONF_OPTS = --disable-doxygen-doc --disable-qvidcap --disable-v4l2-tracer
-# needed to get utils/qv4l link flags right
-LIBV4L_AUTORECONF = YES
-# add host-gettext for AM_ICONV macro
-LIBV4L_DEPENDENCIES += host-gettext
-
-# fix uclibc-ng configure/compile
-LIBV4L_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99'
+LIBV4L_CONF_OPTS = -Ddoxygen-doc=disabled -Dqvidcap=disabled -Dv4l2-tracer=disabled
+LIBV4L_LDFLAGS = $(TARGET_LDFLAGS)
 
 # v4l-utils components have different licences, see v4l-utils.spec for details
 LIBV4L_LICENSE = GPL-2.0+ (utilities), LGPL-2.1+ (libraries)
 LIBV4L_LICENSE_FILES = COPYING COPYING.libv4l lib/libv4l1/libv4l1-kernelcode-license.txt
 
+ifeq ($(BR2_STATIC_LIBS),y)
+LIBV4L_CONF_OPTS += -Dv4l-plugins=false -Dv4l-wrappers=false
+endif
+
 ifeq ($(BR2_PACKAGE_ALSA_LIB),y)
 LIBV4L_DEPENDENCIES += alsa-lib
 endif
 
 ifeq ($(BR2_PACKAGE_ARGP_STANDALONE),y)
 LIBV4L_DEPENDENCIES += argp-standalone $(TARGET_NLS_DEPENDENCIES)
-LIBV4L_CONF_ENV += LIBS=$(TARGET_NLS_LIBS)
+LIBV4L_LDFLAGS += $(TARGET_NLS_LIBS)
 endif
 
 LIBV4L_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBICONV),libiconv)
 
 ifeq ($(BR2_PACKAGE_JPEG),y)
+LIBV4L_CONF_OPTS += -Djpeg=enabled
 LIBV4L_DEPENDENCIES += jpeg
-LIBV4L_CONF_OPTS += --with-jpeg
 else
-LIBV4L_CONF_OPTS += --without-jpeg
+LIBV4L_CONF_OPTS += -Djpeg=disabled
 endif
 
 ifeq ($(BR2_PACKAGE_HAS_LIBGL),y)
@@ -45,10 +43,10 @@ LIBV4L_DEPENDENCIES += libgl
 endif
 
 ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
-LIBV4L_CONF_OPTS += --with-libudev --with-udevdir=/usr/lib/udev
+LIBV4L_CONF_OPTS += -Dlibdvbv5=enabled -Dudevdir=/usr/lib/udev
 LIBV4L_DEPENDENCIES += udev
 else
-LIBV4L_CONF_OPTS += --without-libudev
+LIBV4L_CONF_OPTS += -Dlibdvbv5=disabled
 endif
 
 ifeq ($(BR2_PACKAGE_LIBGLU),y)
@@ -56,33 +54,25 @@ LIBV4L_DEPENDENCIES += libglu
 endif
 
 ifeq ($(BR2_PACKAGE_LIBV4L_UTILS),y)
-LIBV4L_CONF_OPTS += --enable-v4l-utils
+LIBV4L_CONF_OPTS += -Dv4l-utils=true
 LIBV4L_DEPENDENCIES += $(TARGET_NLS_DEPENDENCIES)
 
-# v4l2-ctl needs c++11, use gnu++11 for typeof support
-LIBV4L_CONF_ENV += CXXFLAGS="$(TARGET_CXXFLAGS) -std=gnu++11"
-
 # IR BPF decoder support needs toolchain with linux-headers >= 3.18
 # libelf and clang support
-LIBV4L_CONF_OPTS += --disable-bpf
+LIBV4L_CONF_OPTS += -Dbpf=disabled
 
 ifeq ($(BR2_PACKAGE_QT5BASE)$(BR2_PACKAGE_QT5BASE_GUI)$(BR2_PACKAGE_QT5BASE_WIDGETS),yyy)
-LIBV4L_CONF_OPTS += --enable-qv4l2
+LIBV4L_CONF_OPTS += -Dqv4l2=enabled
 LIBV4L_DEPENDENCIES += qt5base
-# protect against host version detection of moc-qt5/rcc-qt5/uic-qt5
-LIBV4L_CONF_ENV += \
-	ac_cv_prog_MOC=$(HOST_DIR)/bin/moc \
-	ac_cv_prog_RCC=$(HOST_DIR)/bin/rcc \
-	ac_cv_prog_UIC=$(HOST_DIR)/bin/uic
 else
-LIBV4L_CONF_OPTS += --disable-qv4l2
+LIBV4L_CONF_OPTS += -Dqv4l2=disabled
 endif
 else
-LIBV4L_CONF_OPTS += --disable-v4l-utils
+LIBV4L_CONF_OPTS += -Dv4l-utils=false
 endif
 
 ifeq ($(BR2_PACKAGE_SDL2_IMAGE),y)
 LIBV4L_DEPENDENCIES += sdl2_image
 endif
 
-$(eval $(autotools-package))
+$(eval $(meson-package))

BIN
buildroot-external/board/arkmicro/ark1668ed_devb/rootfs_overlay/usr/lib/directfb-1.7-7/gfxdrivers/libdirectfb_gal.so


BIN
buildroot-external/board/arkmicro/ark1668ed_devb/rootfs_overlay/usr/lib/libGAL.so


BIN
buildroot-external/board/arkmicro/ark1668ed_devb/rootfs_overlay/usr/lib/qt/plugins/platforms/libqdirectfb.so


BIN
buildroot-external/board/arkmicro/ark1668ed_devb_emmc/rootfs_overlay/usr/lib/qt/plugins/platforms/libqdirectfb.so


+ 1 - 0
buildroot-external/configs/ark1668ed_devb_defconfig

@@ -2,6 +2,7 @@ BR2_arm=y
 BR2_cortex_a7=y
 BR2_ARM_FPU_NEON=y
 BR2_TOOLCHAIN_EXTERNAL=y
+BR2_TIME_BITS_64=y
 BR2_TARGET_GENERIC_ROOT_PASSWD="root"
 # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
 BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_ARK_PATH)/board/arkmicro/ark1668ed_devb/rootfs_overlay"

+ 1 - 0
buildroot-external/configs/ark1668ed_devb_emmc_defconfig

@@ -2,6 +2,7 @@ BR2_arm=y
 BR2_cortex_a7=y
 BR2_ARM_FPU_NEON=y
 BR2_TOOLCHAIN_EXTERNAL=y
+BR2_TIME_BITS_64=y
 BR2_TARGET_GENERIC_ROOT_PASSWD="root"
 # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
 BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_ARK_PATH)/board/arkmicro/ark1668ed_devb_emmc/rootfs_overlay"