[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1110332: apparix FTCBFS: Tries to AC_TRY_RUN va_copy



Package: apparix
Version: 11-062-3
Tags: patch
User: debian-cross@lists.debian.org
Usertags: ftcbfs
X-Debbugs-Cc: debian-cross@lists.debian.org

Dear Maintainer,

apparix checks for various implementations of va_copy and runs code to check the same.
This is not possible during cross compilation.
This is likely not required and compiling to check if va_copy is present should be enough.

Attached patch modifies that behavior. I've also shortened the function quite a bit to
just test if the function does its job. Please consider to review and apply if this looks good.

thanks
Nilesh
From 823f81810a256788723ff8ebf7138489f640e5c5 Mon Sep 17 00:00:00 2001
From: Nilesh Patra <nilesh@debian.org>
Date: Sun, 3 Aug 2025 17:57:14 +0530
Subject: [PATCH] Add patch to fixup FTCBFS

---
 debian/patches/cross.patch | 52 ++++++++++++++++++++++++++++++++++++++
 debian/patches/series      |  1 +
 2 files changed, 53 insertions(+)
 create mode 100644 debian/patches/cross.patch

diff --git a/debian/patches/cross.patch b/debian/patches/cross.patch
new file mode 100644
index 0000000..d8389a3
--- /dev/null
+++ b/debian/patches/cross.patch
@@ -0,0 +1,52 @@
+diff --git a/acinclude.m4 b/acinclude.m4
+index 5badc0d..e8909fe 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -234,34 +234,9 @@ dnl ##
+ dnl #   test program for va_copy() implementation
+ changequote(<<,>>)
+ m4_define(__va_copy_test, <<[
+-#include <stdlib.h>
+-#include <stdarg.h>
+-#include <string.h>
+ #define DO_VA_COPY(d, s) $1
+-void test(char *str, ...)
+-{
+-    va_list ap, ap2;
+-    int i;
+-    va_start(ap, str);
+-    DO_VA_COPY(ap2, ap);
+-    for (i = 1; i <= 9; i++) {
+-        int k = (int)va_arg(ap, int);
+-        if (k != i)
+-            abort();
+-    }
+-    DO_VA_COPY(ap, ap2);
+-    for (i = 1; i <= 9; i++) {
+-        int k = (int)va_arg(ap, int);
+-        if (k != i)
+-            abort();
+-    }
+-    va_end(ap);
+-}
+-int main(int argc, char *argv[])
+-{
+-    test("test", 1, 2, 3, 4, 5, 6, 7, 8, 9);
+-    exit(0);
+-}
++va_list ap, ap2;
++DO_VA_COPY(ap2, ap);
+ ]>>)
+ changequote([,])
+ 
+@@ -271,7 +246,9 @@ m4_define(__va_copy_check, [
+ [/* Predefined possible va_copy() implementation (id: $1) */
+ #define __VA_COPY_USE_$1(d, s) $2])
+     if test ".$ac_cv_va_copy" = .; then
+-        AC_TRY_RUN(__va_copy_test($2), [ac_cv_va_copy="$1"])
++        AC_TRY_COMPILE([
++			#include <stdarg.h>
++			],__va_copy_test($2), [ac_cv_va_copy="$1"])
+     fi
+ ])
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 8889fdf..f292a7d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 00-fix-spelling.patch
+cross.patch
-- 
2.47.2


Reply to: