Bug#1066836: libcamera: ftbfs with 64-bit time_t

2024-03-14 Thread Dylan Aïssi

Hi Kieran,

I guess this task is for me ;-)
Yes, I will submit it.

Best,
Dylan


On 3/14/24 13:04, Kieran Bingham wrote:

Hi Steve,

do you also plan to submit this to the libcamera-devel mailing list?

--
Kieran

Quoting Steve Langasek (2024-03-14 05:35:04)

Package: libcamera
Version: 0.2.0-1
Severity: serious
Tags: patch
Justification: ftbfs
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu noble ubuntu-patch

Dear maintainers,

libcamera fails to build from source on 32-bit architectures under 64-bit
time_t, because it has a module that legitimately un-sets _FILE_OFFSET_BITS
for building but this is not allowed without also unsetting _TIME_BITS:

[...]
[267/430] c++ -Isrc/v4l2/v4l2-compat.so.p -Isrc/v4l2 -I../src/v4l2 -Iinclude -I../include -Iinclude/libcamera/ipa 
-Iinclude/libcamera -fdiagnostics-color=always -Wall -Winvalid-pch -Wextra -Werror -std=c++17 -Wno-redundant-move 
-Wno-psabi -Wshadow -include /<>/obj-arm-linux-gnueabihf/config.h -g -O2 
-ffile-prefix-map=/<>=. -fstack-protector-strong -Wformat -Werror=format-security 
-fno-stack-clash-protection -fdebug-prefix-map=/<>=/usr/src/libcamera-0.2.0-1ubuntu3 
-Wno-error -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=3 -fPIC 
-DLIBCAMERA_BASE_PRIVATE -U_FILE_OFFSET_BITS -D_FILE_OFFSET_BITS=32 -D_LARGEFILE64_SOURCE -fvisibility=hidden -MD 
-MQ src/v4l2/v4l2-compat.so.p/v4l2_camera.cpp.o -MF src/v4l2/v4l2-compat.so.p/v4l2_camera.cpp.o.d -o 
src/v4l2/v4l2-compat.so.p/v4l2_camera.cpp.o -c ../src/v4l2/v4l2_camera.cpp
FAILED: src/v4l2/v4l2-compat.so.p/v4l2_camera.cpp.o
c++ -Isrc/v4l2/v4l2-compat.so.p -Isrc/v4l2 -I../src/v4l2 -Iinclude -I../include -Iinclude/libcamera/ipa 
-Iinclude/libcamera -fdiagnostics-color=always -Wall -Winvalid-pch -Wextra -Werror -std=c++17 -Wno-redundant-move 
-Wno-psabi -Wshadow -include /<>/obj-arm-linux-gnueabihf/config.h -g -O2 
-ffile-prefix-map=/<>=. -fstack-protector-strong -Wformat -Werror=format-security 
-fno-stack-clash-protection -fdebug-prefix-map=/<>=/usr/src/libcamera-0.2.0-1ubuntu3 
-Wno-error -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=3 -fPIC 
-DLIBCAMERA_BASE_PRIVATE -U_FILE_OFFSET_BITS -D_FILE_OFFSET_BITS=32 -D_LARGEFILE64_SOURCE -fvisibility=hidden -MD 
-MQ src/v4l2/v4l2-compat.so.p/v4l2_camera.cpp.o -MF src/v4l2/v4l2-compat.so.p/v4l2_camera.cpp.o.d -o 
src/v4l2/v4l2-compat.so.p/v4l2_camera.cpp.o -c ../src/v4l2/v4l2_camera.cpp
In file included from /usr/include/features.h:394,
  from 
/usr/include/arm-linux-gnueabihf/c++/13/bits/os_defines.h:39,
  from 
/usr/include/arm-linux-gnueabihf/c++/13/bits/c++config.h:679,
  from /usr/include/c++/13/bits/requires_hosted.h:31,
  from /usr/include/c++/13/deque:60,
  from ../src/v4l2/v4l2_camera.h:10,
  from ../src/v4l2/v4l2_camera.cpp:8:
/usr/include/features-time64.h:26:5: error: #error "_TIME_BITS=64 is allowed only 
with _FILE_OFFSET_BITS=64"
26 | #   error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
   | ^
[...]

   
(https://launchpad.net/ubuntu/+source/libcamera/0.2.0-1ubuntu3/+build/27902670)

Since this is a legitimate un-setting of _FILE_OFFSET_BITS in order to get
access to the necessary libc6 prototypes and macros, and since the functions
being intercepted are not sensitive to time_t, the simplest solution is to
also unset _TIME_BITS.

Please see the attached patch, which has been uploaded to Ubuntu to fix this
build failure.

Thanks for considering,
--
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
Ubuntu Developer   https://www.debian.org/
slanga...@ubuntu.com vor...@debian.org


--
Dylan Aïssi
Software Engineer

Collabora Ltd.
Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK
Registered in England & Wales, no. 5513718



Bug#1066836: libcamera: ftbfs with 64-bit time_t

2024-03-14 Thread Kieran Bingham
Hi Steve,

do you also plan to submit this to the libcamera-devel mailing list?

--
Kieran

Quoting Steve Langasek (2024-03-14 05:35:04)
> Package: libcamera
> Version: 0.2.0-1
> Severity: serious
> Tags: patch
> Justification: ftbfs
> User: ubuntu-de...@lists.ubuntu.com
> Usertags: origin-ubuntu noble ubuntu-patch
> 
> Dear maintainers,
> 
> libcamera fails to build from source on 32-bit architectures under 64-bit
> time_t, because it has a module that legitimately un-sets _FILE_OFFSET_BITS
> for building but this is not allowed without also unsetting _TIME_BITS:
> 
> [...]
> [267/430] c++ -Isrc/v4l2/v4l2-compat.so.p -Isrc/v4l2 -I../src/v4l2 -Iinclude 
> -I../include -Iinclude/libcamera/ipa -Iinclude/libcamera 
> -fdiagnostics-color=always -Wall -Winvalid-pch -Wextra -Werror -std=c++17 
> -Wno-redundant-move -Wno-psabi -Wshadow -include 
> /<>/obj-arm-linux-gnueabihf/config.h -g -O2 
> -ffile-prefix-map=/<>=. -fstack-protector-strong -Wformat 
> -Werror=format-security -fno-stack-clash-protection 
> -fdebug-prefix-map=/<>=/usr/src/libcamera-0.2.0-1ubuntu3 
> -Wno-error -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 
> -Wdate-time -D_FORTIFY_SOURCE=3 -fPIC -DLIBCAMERA_BASE_PRIVATE 
> -U_FILE_OFFSET_BITS -D_FILE_OFFSET_BITS=32 -D_LARGEFILE64_SOURCE 
> -fvisibility=hidden -MD -MQ src/v4l2/v4l2-compat.so.p/v4l2_camera.cpp.o -MF 
> src/v4l2/v4l2-compat.so.p/v4l2_camera.cpp.o.d -o 
> src/v4l2/v4l2-compat.so.p/v4l2_camera.cpp.o -c ../src/v4l2/v4l2_camera.cpp
> FAILED: src/v4l2/v4l2-compat.so.p/v4l2_camera.cpp.o 
> c++ -Isrc/v4l2/v4l2-compat.so.p -Isrc/v4l2 -I../src/v4l2 -Iinclude 
> -I../include -Iinclude/libcamera/ipa -Iinclude/libcamera 
> -fdiagnostics-color=always -Wall -Winvalid-pch -Wextra -Werror -std=c++17 
> -Wno-redundant-move -Wno-psabi -Wshadow -include 
> /<>/obj-arm-linux-gnueabihf/config.h -g -O2 
> -ffile-prefix-map=/<>=. -fstack-protector-strong -Wformat 
> -Werror=format-security -fno-stack-clash-protection 
> -fdebug-prefix-map=/<>=/usr/src/libcamera-0.2.0-1ubuntu3 
> -Wno-error -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 
> -Wdate-time -D_FORTIFY_SOURCE=3 -fPIC -DLIBCAMERA_BASE_PRIVATE 
> -U_FILE_OFFSET_BITS -D_FILE_OFFSET_BITS=32 -D_LARGEFILE64_SOURCE 
> -fvisibility=hidden -MD -MQ src/v4l2/v4l2-compat.so.p/v4l2_camera.cpp.o -MF 
> src/v4l2/v4l2-compat.so.p/v4l2_camera.cpp.o.d -o 
> src/v4l2/v4l2-compat.so.p/v4l2_camera.cpp.o -c ../src/v4l2/v4l2_camera.cpp
> In file included from /usr/include/features.h:394,
>  from 
> /usr/include/arm-linux-gnueabihf/c++/13/bits/os_defines.h:39,
>  from 
> /usr/include/arm-linux-gnueabihf/c++/13/bits/c++config.h:679,
>  from /usr/include/c++/13/bits/requires_hosted.h:31,
>  from /usr/include/c++/13/deque:60,
>  from ../src/v4l2/v4l2_camera.h:10,
>  from ../src/v4l2/v4l2_camera.cpp:8:
> /usr/include/features-time64.h:26:5: error: #error "_TIME_BITS=64 is allowed 
> only with _FILE_OFFSET_BITS=64"
>26 | #   error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
>   | ^
> [...]
> 
>   
> (https://launchpad.net/ubuntu/+source/libcamera/0.2.0-1ubuntu3/+build/27902670)
> 
> Since this is a legitimate un-setting of _FILE_OFFSET_BITS in order to get
> access to the necessary libc6 prototypes and macros, and since the functions
> being intercepted are not sensitive to time_t, the simplest solution is to
> also unset _TIME_BITS.
> 
> Please see the attached patch, which has been uploaded to Ubuntu to fix this
> build failure.
> 
> Thanks for considering,
> -- 
> Steve Langasek   Give me a lever long enough and a Free OS
> Debian Developer   to set it on, and I can move the world.
> Ubuntu Developer   https://www.debian.org/
> slanga...@ubuntu.com vor...@debian.org



Bug#1066836: libcamera: ftbfs with 64-bit time_t

2024-03-13 Thread Steve Langasek
Package: libcamera
Version: 0.2.0-1
Severity: serious
Tags: patch
Justification: ftbfs
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu noble ubuntu-patch

Dear maintainers,

libcamera fails to build from source on 32-bit architectures under 64-bit
time_t, because it has a module that legitimately un-sets _FILE_OFFSET_BITS
for building but this is not allowed without also unsetting _TIME_BITS:

[...]
[267/430] c++ -Isrc/v4l2/v4l2-compat.so.p -Isrc/v4l2 -I../src/v4l2 -Iinclude 
-I../include -Iinclude/libcamera/ipa -Iinclude/libcamera 
-fdiagnostics-color=always -Wall -Winvalid-pch -Wextra -Werror -std=c++17 
-Wno-redundant-move -Wno-psabi -Wshadow -include 
/<>/obj-arm-linux-gnueabihf/config.h -g -O2 
-ffile-prefix-map=/<>=. -fstack-protector-strong -Wformat 
-Werror=format-security -fno-stack-clash-protection 
-fdebug-prefix-map=/<>=/usr/src/libcamera-0.2.0-1ubuntu3 
-Wno-error -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 
-Wdate-time -D_FORTIFY_SOURCE=3 -fPIC -DLIBCAMERA_BASE_PRIVATE 
-U_FILE_OFFSET_BITS -D_FILE_OFFSET_BITS=32 -D_LARGEFILE64_SOURCE 
-fvisibility=hidden -MD -MQ src/v4l2/v4l2-compat.so.p/v4l2_camera.cpp.o -MF 
src/v4l2/v4l2-compat.so.p/v4l2_camera.cpp.o.d -o 
src/v4l2/v4l2-compat.so.p/v4l2_camera.cpp.o -c ../src/v4l2/v4l2_camera.cpp
FAILED: src/v4l2/v4l2-compat.so.p/v4l2_camera.cpp.o 
c++ -Isrc/v4l2/v4l2-compat.so.p -Isrc/v4l2 -I../src/v4l2 -Iinclude -I../include 
-Iinclude/libcamera/ipa -Iinclude/libcamera -fdiagnostics-color=always -Wall 
-Winvalid-pch -Wextra -Werror -std=c++17 -Wno-redundant-move -Wno-psabi 
-Wshadow -include /<>/obj-arm-linux-gnueabihf/config.h -g -O2 
-ffile-prefix-map=/<>=. -fstack-protector-strong -Wformat 
-Werror=format-security -fno-stack-clash-protection 
-fdebug-prefix-map=/<>=/usr/src/libcamera-0.2.0-1ubuntu3 
-Wno-error -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 
-Wdate-time -D_FORTIFY_SOURCE=3 -fPIC -DLIBCAMERA_BASE_PRIVATE 
-U_FILE_OFFSET_BITS -D_FILE_OFFSET_BITS=32 -D_LARGEFILE64_SOURCE 
-fvisibility=hidden -MD -MQ src/v4l2/v4l2-compat.so.p/v4l2_camera.cpp.o -MF 
src/v4l2/v4l2-compat.so.p/v4l2_camera.cpp.o.d -o 
src/v4l2/v4l2-compat.so.p/v4l2_camera.cpp.o -c ../src/v4l2/v4l2_camera.cpp
In file included from /usr/include/features.h:394,
 from 
/usr/include/arm-linux-gnueabihf/c++/13/bits/os_defines.h:39,
 from 
/usr/include/arm-linux-gnueabihf/c++/13/bits/c++config.h:679,
 from /usr/include/c++/13/bits/requires_hosted.h:31,
 from /usr/include/c++/13/deque:60,
 from ../src/v4l2/v4l2_camera.h:10,
 from ../src/v4l2/v4l2_camera.cpp:8:
/usr/include/features-time64.h:26:5: error: #error "_TIME_BITS=64 is allowed 
only with _FILE_OFFSET_BITS=64"
   26 | #   error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
  | ^
[...]

  
(https://launchpad.net/ubuntu/+source/libcamera/0.2.0-1ubuntu3/+build/27902670)

Since this is a legitimate un-setting of _FILE_OFFSET_BITS in order to get
access to the necessary libc6 prototypes and macros, and since the functions
being intercepted are not sensitive to time_t, the simplest solution is to
also unset _TIME_BITS.

Please see the attached patch, which has been uploaded to Ubuntu to fix this
build failure.

Thanks for considering,
-- 
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
Ubuntu Developer   https://www.debian.org/
slanga...@ubuntu.com vor...@debian.org
diff -Nru libcamera-0.2.0/debian/control libcamera-0.2.0/debian/control
--- libcamera-0.2.0/debian/control  2024-01-17 13:27:50.0 -0800
+++ libcamera-0.2.0/debian/control  2024-03-13 22:27:39.0 -0700
@@ -1,7 +1,6 @@
 Source: libcamera
 Priority: optional
-Maintainer: Ubuntu Developers 
-XSBC-Original-Maintainer: Debian Multimedia Maintainers 

+Maintainer: Debian Multimedia Maintainers 
 Uploaders: Emmanuel Arias ,
IOhannes m zmölnig (Debian/GNU) ,
Andrej Shadura ,
diff -Nru libcamera-0.2.0/debian/patches/64-bit-time-t-compat.patch 
libcamera-0.2.0/debian/patches/64-bit-time-t-compat.patch
--- libcamera-0.2.0/debian/patches/64-bit-time-t-compat.patch   1969-12-31 
16:00:00.0 -0800
+++ libcamera-0.2.0/debian/patches/64-bit-time-t-compat.patch   2024-03-13 
22:27:33.0 -0700
@@ -0,0 +1,21 @@
+Description: 64-bit time_t compatibility for v4l2 module
+ The v4l2 build unsets _FILE_OFFSET_BITS, which is not allowed when setting
+ _TIME_BITS=64.  Having verified that nothing in this module is sensitive to
+ 64-bit time_t (none of the functions it intercepts handle time), we also
+ unset _TIME_BITS to allow this to build as before.
+Author: Steve Langasek 
+Forwarded: no
+Last-Update: 2024-03-13
+
+Index: libcamera-0.2.0/src/v4l2/meson.build