Package: libcamera
Version: 0~git20211108+1b30992b623e-4
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu kinetic ubuntu-patch

Dear Maintainer,

libcamera currently fails to build from source on the ppc64el architecture.

The latest snapshot (i.e., git20211108+1b30992b623e) contains long
double expressions that GCC fails to determine at compile time on
ppc64el. These expressions were not present in the previous snapshot.

Tweaking the "guilty" expressions was enough to make the package build.
This was the recommended solution on RHEL in a similar issue for a
different package:
https://bugzilla.redhat.com/show_bug.cgi?id=1538817#c6

Another option is to build with the -mlong-double-64 flag.

In Ubuntu, the attached patch was applied to achieve the following:

  * Fix FTBFS on ppc64el with GCC (LP: #1992331)

Thanks for considering the patch.

-- System Information:
Debian Release: bookworm/sid
  APT prefers jammy-updates
  APT policy: (500, 'jammy-updates'), (500, 'jammy-security'), (500, 'jammy'), 
(100, 'jammy-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.15.0-48-generic (SMP w/8 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff -Nru 
libcamera-0~git20211108+1b30992b623e/debian/patches/ppc64el-fix-ftbfs-gcc.patch 
libcamera-0~git20211108+1b30992b623e/debian/patches/ppc64el-fix-ftbfs-gcc.patch
--- 
libcamera-0~git20211108+1b30992b623e/debian/patches/ppc64el-fix-ftbfs-gcc.patch 
    1970-01-01 01:00:00.000000000 +0100
+++ 
libcamera-0~git20211108+1b30992b623e/debian/patches/ppc64el-fix-ftbfs-gcc.patch 
    2022-10-10 10:23:29.000000000 +0200
@@ -0,0 +1,34 @@
+Description: fix expressions not considered constant on ppc64el with GCC
+ On ppc64el, GCC seems to be unable to determine the result of some long double
+ expressions at compile time. This makes libcamera fail to build from source on
+ ppc64el.
+ Make sure we only use constexpr on expressions that are considered constant on
+ all architectures.
+Author: Olivier Gayot <olivier.ga...@canonical.com>
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libcamera/+bug/1992331
+Forwarded: no
+Last-Update: 2022-10-10
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: libcamera-0~git20211108+1b30992b623e/src/ipa/raspberrypi/raspberrypi.cpp
+===================================================================
+--- 
libcamera-0~git20211108+1b30992b623e.orig/src/ipa/raspberrypi/raspberrypi.cpp   
   2022-10-10 08:24:22.091329072 +0000
++++ libcamera-0~git20211108+1b30992b623e/src/ipa/raspberrypi/raspberrypi.cpp   
2022-10-10 08:45:31.686454143 +0000
+@@ -61,7 +61,7 @@
+ /* Configure the sensor with these values initially. */
+ constexpr double defaultAnalogueGain = 1.0;
+ constexpr Duration defaultExposureTime = 20.0ms;
+-constexpr Duration defaultMinFrameDuration = 1.0s / 30.0;
++constexpr Duration defaultMinFrameDuration = 1s / 30.0;
+ constexpr Duration defaultMaxFrameDuration = 250.0s;
+ 
+ /*
+@@ -70,7 +70,7 @@
+  * we rate-limit the controller Prepare() and Process() calls to lower than or
+  * equal to this rate.
+  */
+-constexpr Duration controllerMinFrameDuration = 1.0s / 60.0;
++constexpr Duration controllerMinFrameDuration = 1s / 60.0;
+ 
+ LOG_DEFINE_CATEGORY(IPARPI)
+ 
diff -Nru libcamera-0~git20211108+1b30992b623e/debian/patches/series 
libcamera-0~git20211108+1b30992b623e/debian/patches/series
--- libcamera-0~git20211108+1b30992b623e/debian/patches/series  1970-01-01 
01:00:00.000000000 +0100
+++ libcamera-0~git20211108+1b30992b623e/debian/patches/series  2022-10-10 
10:23:29.000000000 +0200
@@ -0,0 +1 @@
+ppc64el-fix-ftbfs-gcc.patch

Reply via email to