On 2025-09-24 10:08, Trupti wrote:
Hello,
I was able to reproduce the issue on a ppc64el machine using sbuild.
Below is the relevant error log:
make[4]: Leaving directory '/build/reproducible-path/arb-6.0.6'
make[3]: *** [Makefile:1968: arb] Error 2
make[3]: Leaving directory '/build/reproducible-path/arb-6.0.6'
make[2]: *** [Makefile:2303: all] Error 2
make[2]: Leaving directory '/build/reproducible-path/arb-6.0.6'
dh_auto_build: error: make -j16 "INSTALL=install --strip-program=true"
all returned exit code 2
make[1]: *** [debian/rules:51: override_dh_auto_build] Error 25
make[1]: Leaving directory '/build/reproducible-path/arb-6.0.6'
make: *** [debian/rules:39: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit
status 2
The build failed during the build stage inside the sbuild chroot for
ppc64el architecture.
+------------------------------------------------------------------------------+
| Summary Mon, 22 Sep 2025
11:25:43 +0000 |
+------------------------------------------------------------------------------+
Build Architecture: ppc64el
Build Type: binary
Build-Space: 333292
Build-Time: 92
Distribution: forky-ppc64el-sbuild
Fail-Stage: build
Host Architecture: ppc64el
Install-Time: 54
Machine Architecture: ppc64el
Package: arb
Package-Time: 150
Source-Version: 6.0.6-8
I will investigate the issue further and get back to you.
Thanks,
Trupti
Hello,
The build fails with GCC 14+ because some functions in CAP2.c are
written in an old C style.
Earlier GCC versions allowed this, but new compilers treat them as
functions with no arguments.
So calls like my_calloc(1) or ckopen(file,mode) now give errors.
The code needs to be updated with proper function declarations.
I will work on preparing a patch to fix this.
Thanks,
Trupti
Hi,
Please find attached a patch (gcc15_fix_cap2.patch) which fixes the
CAP2.c build failures with GCC 15 on ppc64el. The issue was caused by
incorrect function prototypes in CAP2.c. This patch corrects the
function signatures and ensures consistent ANSI-style declarations.
Built and tested successfully on ppc64el with GCC 15.
Note: there are still other Altivec/Eigen-related errors in the code, so
the full build is still failing. Those need to be addressed in a
separate patch.
I would appreciate a review of this patch and any suggestions for
improvements.
Thanks,
Trupti
Index: arb-6.0.6/GDE/SUPPORT/CAP2.c
===================================================================
--- arb-6.0.6.orig/GDE/SUPPORT/CAP2.c
+++ arb-6.0.6/GDE/SUPPORT/CAP2.c
@@ -284,8 +284,8 @@ char *argv[];
char *sequence; /* Storing all segments */
char *reverse; /* Storing all reverse segments */
int symbol, prev; /* The next character */
- FILE *Ap, *ckopen(); /* For the sequence file */
- char *my_calloc(int); /* space-allocating function */
+ FILE *Ap, *ckopen(const char *filename, const char *mode); /* For the sequence file */
+ char *my_calloc(int amout); /* space-allocating function */
register int i, j, k; /* index variables */
/* Mod by S.S. */
int jj;
@@ -454,7 +454,7 @@ static int *S; /* saving operations
/* The following definitions are for function diff() */
-int diff();
+int diff(char *A, char *B, int M, int N, int q1, int q2);
static int zero = 0; /* int type zero */
#define gap(k) ((k) <= 0 ? 0 : q+r*(k)) /* k-symbol indel score */
@@ -493,7 +493,7 @@ static int al_len; /* length of ali
INIT(M) int M;
{
register int j; /* row and column indices */
- char *my_calloc(); /* space-allocating function */
+ char *my_calloc(int amount); /* space-allocating function */
/* allocate space for all vectors */
j = (M + 1) * sizeof(int );
@@ -514,7 +514,7 @@ MAKE()
int size; /* size of a lookup table */
int limit, digit, step; /* temporary variables */
register int i, j, k, p, q; /* index varibles */
- char *my_calloc(); /* space-allocating function */
+ char *my_calloc(int amount); /* space-allocating function */
char *A; /* pointer to a sequence */
int M; /* length of a sequence */
@@ -581,14 +581,14 @@ PAIR(V,V1,Q,R,R1) int V[][128],V1[][128
int count, limit; /* temporary variables */
register int i, j, d; /* row and column indices */
- char *my_calloc(); /* space-allocating function */
+ char *my_calloc(int amount); /* space-allocating function */
int rl, cl;
char *A, *B;
int M, N;
overptr node1;
int total; /* total number of pairs */
int hit; /* number of pairs satisfying cond. */
- int CHECK();
+ int CHECK(short int orienti, int i, int j);
v = V;
q = Q;
@@ -633,7 +633,7 @@ PAIR(V,V1,Q,R,R1) int V[][128],V1[][128
if ( no_mat >= al_len * per_cent &&
( al_len >= over_len || iscon ) )
{
- node1 = ( overptr ) my_calloc( (int ) sizeof(over));
+ node1 = ( overptr ) my_calloc( (int) sizeof(over));
if ( iscon )
node1->kind = 0; /* containment */
else
@@ -681,8 +681,7 @@ PAIR(V,V1,Q,R,R1) int V[][128],V1[][128
/* Return 1 if two sequences satisfy the necessary condition for overlap,
and 0 otherwise. Parameters first and second are the indices of segments,
and parameter orient indicates the orientation of segment first. */
-int CHECK(orient,first,second) short orient;
-int first, second;
+int CHECK(short int orient,int first, int second)
{
int limit, bound; /* maximum number of jumps */
int small; /* smaller of limit and bound */
@@ -690,10 +689,10 @@ int first, second;
float cut; /* cutoff score */
register int i; /* index variable */
int t, q; /* temporary variables */
- int JUMP();
- int RJUMP();
- int JUMPC();
- int RJUMPC();
+ int JUMP(int *arr, int first, int second, int orient);
+ int RJUMP(int *arr, int first, int second, int orient);
+ int JUMPC(int *arr, int first, int second);
+ int RJUMPC(int *arr, int first, int second);
delta = DELTA;
if ( orient )
@@ -730,8 +729,7 @@ int first, second;
}
/* Compute a vector of lengths of jumps */
-int JUMP(H,one,two,orient) int H[], one, two;
-short orient;
+int JUMP(int H[], int one, int two, short int orient)
{
char *A, *B; /* pointers to two sequences */
int M, N; /* lengths of two sequences */
@@ -781,7 +779,7 @@ short orient;
}
/* Compute a vector of lengths of jumps for reverse complement of one */
-int JUMPC(H,one,two) int H[], one, two;
+int JUMPC(int H[], int one, int two)
{
char *A, *B; /* pointers to two sequences */
int M, N; /* lengths of two sequences */
@@ -831,8 +829,7 @@ int JUMPC(H,one,two) int H[], one, two
}
/* Compute a vector of lengths of reverse jumps */
-int RJUMP(H,one,two,orient) int H[], one, two;
-short orient;
+int RJUMP(int H[], int one, int two, short int orient)
{
char *A, *B; /* pointers to two sequences */
int N; /* length of a sequence */
@@ -881,7 +878,7 @@ short orient;
}
/* Compute a vector of lengths of reverse jumps for reverse complement */
-int RJUMPC(H,one,two) int H[], one, two;
+int RJUMPC(int H[], int one, int two)
{
char *A, *B; /* pointers to two sequences */
int M, N; /* lengths of two sequences */
@@ -934,7 +931,8 @@ int RJUMPC(H,one,two) int H[], one, tw
/* Construct contigs */
ASSEM()
{
- char *my_calloc(); /* space-allocating function */
+
+ char *my_calloc(int amount); /* space-allocating function */
register int i, j, k; /* index variables */
overptr node1, x, y; /* temporary pointer */
int five, three; /* indices of 5' and 3' segments */
@@ -1045,7 +1043,7 @@ REPAIR()
short isconi, isconj; /* containment condition */
int score; /* the max score */
int i, j, f, d, e; /* row and column indices */
- char *my_calloc(); /* space-allocating function */
+ char *my_calloc(int amount); /* space-allocating function */
char *A, *B;
int M, N;
overptr node1;
@@ -1135,9 +1133,9 @@ REPAIR()
}
/* Construct contigs */
-REASSEM(piece_num, number) int piece_num, number;
+REASSEM(int piece_num, int number)
{
- char *my_calloc(); /* space-allocating function */
+ char *my_calloc(int amount); /* space-allocating function */
int i, j, k, d; /* index variables */
overptr node1, x, y; /* temporary pointer */
int five, three; /* indices of 5' and 3' segments */
@@ -1233,13 +1231,12 @@ REASSEM(piece_num, number) int piece_nu
}
}
-RECONCILE(y, pp,nn) overptr y;
-int *pp,*nn;
+RECONCILE(overptr y, int *pp, int *nn)
{
short orienti, orientj; /* orientation of segments */
short orientk, orientd; /* orientation of segments */
int i, j, k, d, f; /* row and column indices */
- char *my_calloc(); /* space-allocating function */
+ char *my_calloc(int amount); /* space-allocating function */
char *A, *B;
int M, N;
overptr node1;
@@ -1344,7 +1341,7 @@ int *pp,*nn;
FORM_TREE()
{
register int i, j, k; /* index variables */
- char *my_calloc(); /* space-allocating function */
+ char *my_calloc(int amount); /* space-allocating function */
overptr node1; /* temporary pointer */
short orient; /* orientation of segment */
int group; /* serial number of contigs */
@@ -1422,7 +1419,7 @@ SORT(seg, ort) int seg;
short ort;
{
register int i, j, k; /* index variables */
- char *my_calloc(); /* space-allocating function */
+ char *my_calloc(int amount); /* space-allocating function */
overptr node1; /* temporary pointer */
short orient; /* orientation of segment */
char *A, *B; /* pointers to segment sequences */
@@ -1495,7 +1492,7 @@ short ort;
SHOW()
{
register int i, j, k; /* index variables */
- char *my_calloc(); /* space-allocating function */
+ char *my_calloc(int amount); /* space-allocating function */
int n; /* number of working segments */
int limit; /* number of slots in work */
int col; /* number of output columns prepared */
@@ -1697,7 +1694,7 @@ SHOW()
/* allocate more space for output fragment */
ALOC_SEQ(t) rowptr t;
{
- char *my_calloc(); /* space-allocating function */
+ char *my_calloc(int amount); /* space-allocating function */
char *start, *end, *p;
t->linesize *= 2;
start = t->line;
@@ -1714,7 +1711,7 @@ ENTER(b, d, id, pos, par) int *b, *d, i
rowptr par;
{
int i;
- char *my_calloc(); /* space-allocating function */
+ char *my_calloc(int amount); /* space-allocating function */
rowptr t;
if ( *b <= *d )
@@ -2110,10 +2107,7 @@ S.S.
A[1..M] and B[1..N] that begins(ends) with a delete if tb(te) is zero
and appends such a conversion to the current script. */
-int diff(A,B,M,N,tb,te) char *A, *B;
-int M, N;
-int tb, te;
-
+int diff(char *A, char *B, int M, int N, int tb, int te)
{
int midi, midj, type; /* Midpoint, type, and cost */
int midc;
@@ -2122,7 +2116,7 @@ int tb, te;
register int i, j;
register int c, e, d, s;
int t, *va;
- char *my_calloc();
+ char *my_calloc(int amount);
/* Boundary cases: M <= 1 or N == 0 */
@@ -2281,10 +2275,9 @@ char *msg, *val;
}
/* ckopen - open file; check for success */
-FILE *ckopen(name, mode)
-char *name, *mode;
+FILE *ckopen(char *name, char *mode)
{
- FILE *fopen(), *fp;
+ FILE *fp;
if ((fp = fopen(name, mode)) == NULL)
fatalf("Cannot open %s.", name);
@@ -2292,13 +2285,13 @@ char *name, *mode;
}
/* my_calloc - allocate space; check for success */
-char *my_calloc(amount)
-int amount;
+char *my_calloc(int amount)
{
- char *malloc(), *p;
+ char *malloc(int),*p;
- if ((p = malloc( (unsigned) amount)) == NULL)
+ if ((p =(char *) malloc( (unsigned) amount)) == NULL)
fatal("Ran out of memory.");
return(p);
}
+