Source: babeltrace
Version: 1.5.11-4
Tags: patch
User: [email protected]
Usertags: cross-satisfiability ftcbfs
Control: affects 1121810 + src:babeltrace

babeltrace cannot be cross built from source for several reasons.

Upfront it Build-Depends on python3-all-dev. For supporting cross
compilation, this should be libpython3-all-dev and
python3-all-dev:native.

Once fixing this, babeltrace runs into #1121810.

Then, its check for the elfutils version uses AC_RUN_IFELSE. That macro
is known to break cross compilation. In this case, what is being
determined is a compile time constant and that can be obtained using
AC_COMPUTE_INT instead.

I'm attaching a patch for the first and last problem. Please consider
applying it. Also consider forwarding the change to AC_RUN_IFELSE
upstream as it benefits other distributions.

Helmut
diff -Nru babeltrace-1.5.11/debian/changelog babeltrace-1.5.11/debian/changelog
--- babeltrace-1.5.11/debian/changelog  2024-09-09 20:17:17.000000000 +0200
+++ babeltrace-1.5.11/debian/changelog  2025-12-29 16:55:58.000000000 +0100
@@ -1,3 +1,12 @@
+babeltrace (1.5.11-4.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Multiarchify Python Build-Depends.
+    + Implement elfutils version check without AC_RUN_IFELSE.
+
+ -- Helmut Grohne <[email protected]>  Mon, 29 Dec 2025 16:55:58 +0100
+
 babeltrace (1.5.11-4) unstable; urgency=medium
 
   * [db824bb] Add python3-setuptools build-depends (Closes: #1080558)
diff -Nru babeltrace-1.5.11/debian/control babeltrace-1.5.11/debian/control
--- babeltrace-1.5.11/debian/control    2024-09-09 20:16:38.000000000 +0200
+++ babeltrace-1.5.11/debian/control    2025-12-29 16:55:57.000000000 +0100
@@ -9,7 +9,8 @@
  libelf-dev (>= 0.154),
  libglib2.0-dev (>= 2.16),
  libpopt-dev,
- python3-all-dev,
+ libpython3-all-dev,
+ python3-all-dev:native,
  python3-setuptools,
  swig (>= 2.0),
  uuid-dev
diff -Nru babeltrace-1.5.11/debian/patches/cross.patch 
babeltrace-1.5.11/debian/patches/cross.patch
--- babeltrace-1.5.11/debian/patches/cross.patch        1970-01-01 
01:00:00.000000000 +0100
+++ babeltrace-1.5.11/debian/patches/cross.patch        2025-12-29 
16:55:58.000000000 +0100
@@ -0,0 +1,24 @@
+--- babeltrace-1.5.11.orig/m4/bt_lib_elfutils.m4
++++ babeltrace-1.5.11/m4/bt_lib_elfutils.m4
+@@ -38,18 +38,13 @@
+       AC_CACHE_CHECK(
+               [for elfutils version >= major_version.minor_version],
+               [bt_cv_lib_elfutils], [
+-                      AC_RUN_IFELSE([AC_LANG_SOURCE([
+-                              #include <stdlib.h>
++                      
AC_COMPUTE_INT([bt_cv_lib_elfutils],[_ELFUTILS_PREREQ(major_version, 
minor_version)],[[
+                               #include <elfutils/version.h>
+-
+-                              int main(void) {
+-                                      return _ELFUTILS_PREREQ(major_version, 
minor_version) ? EXIT_SUCCESS : EXIT_FAILURE;
+-                              }
+-                      ])], [bt_cv_lib_elfutils=yes], [bt_cv_lib_elfutils=no])
++                      ]])
+               ]
+       )
+ 
+-      AS_IF([test "x$bt_cv_lib_elfutils" = "xyes"], [true_action], 
[false_action])
++      AS_IF([test "x$bt_cv_lib_elfutils" = "x1"], [true_action], 
[false_action])
+ 
+       m4_popdef([false_action])
+       m4_popdef([true_action])
diff -Nru babeltrace-1.5.11/debian/patches/series 
babeltrace-1.5.11/debian/patches/series
--- babeltrace-1.5.11/debian/patches/series     2023-10-17 21:17:48.000000000 
+0200
+++ babeltrace-1.5.11/debian/patches/series     2025-12-29 16:55:58.000000000 
+0100
@@ -1,2 +1,3 @@
 fix-clean-bison-files.patch
 0001-Fix-Hurd-compat-for-PATH_MAX.patch
+cross.patch

Reply via email to