diff mbox series

[meta-oe,walnascar] v4l-utils: Fix QA and build errors related to _TIME_BITS on 32-bit

Message ID 20250728141401.3522091-1-jiaying.song.cn@windriver.com
State Accepted
Headers show
Series [meta-oe,walnascar] v4l-utils: Fix QA and build errors related to _TIME_BITS on 32-bit | expand

Commit Message

Song, Jiaying (CN) July 28, 2025, 2:14 p.m. UTC
From: Jiaying Song <jiaying.song.cn@windriver.com>

* Remove GLIBC_64BIT_TIME_FLAGS="" to enable _TIME_BITS=64 by default,
  which avoids the following QA issue during builds on 32-bit systems:

  WARNING: lib32-v4l-utils-1.24.1+git-r0 do_package_qa: QA Issue: /usr/bin/cec-compliance uses 32-bit api 'time'

* Undefine _TIME_BITS to fix the build error:

  /usr/include/features-time64.h:26:5: error: #error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"

Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
---
 ...on.build-fix-arm-_TIME_BITS-64-error.patch | 38 +++++++++++++++++++
 .../v4l2apps/v4l-utils_1.28.1.bb              |  5 +--
 2 files changed, 39 insertions(+), 4 deletions(-)
 create mode 100644 meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0003-meson.build-fix-arm-_TIME_BITS-64-error.patch

Comments

Khem Raj July 28, 2025, 5:57 p.m. UTC | #1
This is needed on the master branch as well. I have picked it for master-next

On Mon, Jul 28, 2025 at 7:14 AM Song, Jiaying (CN) via
lists.openembedded.org
<Jiaying.Song.CN=windriver.com@lists.openembedded.org> wrote:
>
> From: Jiaying Song <jiaying.song.cn@windriver.com>
>
> * Remove GLIBC_64BIT_TIME_FLAGS="" to enable _TIME_BITS=64 by default,
>   which avoids the following QA issue during builds on 32-bit systems:
>
>   WARNING: lib32-v4l-utils-1.24.1+git-r0 do_package_qa: QA Issue: /usr/bin/cec-compliance uses 32-bit api 'time'
>
> * Undefine _TIME_BITS to fix the build error:
>
>   /usr/include/features-time64.h:26:5: error: #error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
>
> Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
> ---
>  ...on.build-fix-arm-_TIME_BITS-64-error.patch | 38 +++++++++++++++++++
>  .../v4l2apps/v4l-utils_1.28.1.bb              |  5 +--
>  2 files changed, 39 insertions(+), 4 deletions(-)
>  create mode 100644 meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0003-meson.build-fix-arm-_TIME_BITS-64-error.patch
>
> diff --git a/meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0003-meson.build-fix-arm-_TIME_BITS-64-error.patch b/meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0003-meson.build-fix-arm-_TIME_BITS-64-error.patch
> new file mode 100644
> index 0000000000..f41dde0e16
> --- /dev/null
> +++ b/meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0003-meson.build-fix-arm-_TIME_BITS-64-error.patch
> @@ -0,0 +1,38 @@
> +From 5aabd01e415374fc97eebe80d4635c3bae728f81 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"
> +
> +Upstream-Status: Backport [https://github.com/gjasny/v4l-utils/commit/d517cfdcdc16533ab7e06e97c07ca089cf261aef]
> +
> +Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
> +Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.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.34.1
> +
> diff --git a/meta-oe/recipes-multimedia/v4l2apps/v4l-utils_1.28.1.bb b/meta-oe/recipes-multimedia/v4l2apps/v4l-utils_1.28.1.bb
> index afe217e1f3..5d21df04af 100644
> --- a/meta-oe/recipes-multimedia/v4l2apps/v4l-utils_1.28.1.bb
> +++ b/meta-oe/recipes-multimedia/v4l2apps/v4l-utils_1.28.1.bb
> @@ -13,10 +13,6 @@ DEPENDS = "jpeg \
>  DEPENDS:append:libc-musl = " argp-standalone"
>  DEPENDS:append:class-target = " udev"
>  LDFLAGS:append = " -pthread"
> -# v4l2 explicitly sets _FILE_OFFSET_BITS=32 to get access to
> -# both 32 and 64 bit file APIs.  But it does not handle the time side?
> -# Needs further investigation
> -GLIBC_64BIT_TIME_FLAGS = ""
>
>  inherit meson gettext pkgconfig
>
> @@ -29,6 +25,7 @@ SRC_URI = "\
>      git://git.linuxtv.org/v4l-utils.git;protocol=https;branch=stable-1.28 \
>      file://0001-media-ctl-Install-media-ctl-header-and-library-files.patch \
>      file://0002-media-ctl-Install-media-ctl-pkg-config-files.patch \
> +    file://0003-meson.build-fix-arm-_TIME_BITS-64-error.patch \
>  "
>
>  SRCREV = "fc15e229d9d337e46d730f00647821adbbd58548"
> --
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#118746): https://lists.openembedded.org/g/openembedded-devel/message/118746
> Mute This Topic: https://lists.openembedded.org/mt/114413900/1997914
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0003-meson.build-fix-arm-_TIME_BITS-64-error.patch b/meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0003-meson.build-fix-arm-_TIME_BITS-64-error.patch
new file mode 100644
index 0000000000..f41dde0e16
--- /dev/null
+++ b/meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0003-meson.build-fix-arm-_TIME_BITS-64-error.patch
@@ -0,0 +1,38 @@ 
+From 5aabd01e415374fc97eebe80d4635c3bae728f81 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"
+
+Upstream-Status: Backport [https://github.com/gjasny/v4l-utils/commit/d517cfdcdc16533ab7e06e97c07ca089cf261aef]
+
+Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
+Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.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.34.1
+
diff --git a/meta-oe/recipes-multimedia/v4l2apps/v4l-utils_1.28.1.bb b/meta-oe/recipes-multimedia/v4l2apps/v4l-utils_1.28.1.bb
index afe217e1f3..5d21df04af 100644
--- a/meta-oe/recipes-multimedia/v4l2apps/v4l-utils_1.28.1.bb
+++ b/meta-oe/recipes-multimedia/v4l2apps/v4l-utils_1.28.1.bb
@@ -13,10 +13,6 @@  DEPENDS = "jpeg \
 DEPENDS:append:libc-musl = " argp-standalone"
 DEPENDS:append:class-target = " udev"
 LDFLAGS:append = " -pthread"
-# v4l2 explicitly sets _FILE_OFFSET_BITS=32 to get access to
-# both 32 and 64 bit file APIs.  But it does not handle the time side?
-# Needs further investigation
-GLIBC_64BIT_TIME_FLAGS = ""
 
 inherit meson gettext pkgconfig
 
@@ -29,6 +25,7 @@  SRC_URI = "\
     git://git.linuxtv.org/v4l-utils.git;protocol=https;branch=stable-1.28 \
     file://0001-media-ctl-Install-media-ctl-header-and-library-files.patch \
     file://0002-media-ctl-Install-media-ctl-pkg-config-files.patch \
+    file://0003-meson.build-fix-arm-_TIME_BITS-64-error.patch \
 "
 
 SRCREV = "fc15e229d9d337e46d730f00647821adbbd58548"