pkgbuilds icon indicating copy to clipboard operation
pkgbuilds copied to clipboard

[mpir] GCC14 compile issue

Open Smoolak opened this issue 9 months ago • 2 comments

Description

When attempting to compile the mpir project with GCC 14 using yay, the configuration script fails due to issues in the "long long reliability test 1." The compilation succeeds with GCC 13 but not with GCC 14.

Steps to Reproduce

  1. Attempt to install mpir using yay with GCC 14:
    export CC=/usr/bin/gcc-14
    export CXX=/usr/bin/g++-14
    yay -S mpir
    

Expected Behavior

The configuration and build processes should complete successfully using GCC 14.

Actual Behavior

The configuration fails during "long long reliability test 1." Relevant config.log snippet:

Test compile: long long reliability test 1
configure:6438: cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection         -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/home/smoolak/.cache/yay/mpir/src=/usr/src/debug/mpir -flto=auto  conftest.c >&5
conftest.c:12:1: error: return type defaults to 'int' [-Wimplicit-int]
   12 | f(){static const struct{t1 n;t1 src[9];t1 want[9];}d[]={{1,{0},{1}},};t1 got[9];int i;
      | ^
conftest.c: In function 'f':
conftest.c:13:44: error: implicit declaration of function 'h' [-Wimplicit-function-declaration]
   13 | for(i=0;i<1;i++){if(e(got,got,9,d[i].n)==0)h();g(i,d[i].src,d[i].n,got,d[i].want,9);if(d[i].n)h();}}
      |                                            ^
conftest.c:13:48: error: implicit declaration of function 'g' [-Wimplicit-function-declaration]
   13 | for(i=0;i<1;i++){if(e(got,got,9,d[i].n)==0)h();g(i,d[i].src,d[i].n,got,d[i].want,9);if(d[i].n)h();}}
      |                                                ^
conftest.c: At top level:
conftest.c:14:1: error: return type defaults to 'int' [-Wimplicit-int]
   14 | h(){}g(){}
      | ^
conftest.c:14:6: error: return type defaults to 'int' [-Wimplicit-int]
   14 | h(){}g(){}
      |      ^
configure:6441: $? = 1
failed program was:
/* The following provokes a segfault in the compiler on powerpc-apple-darwin.
   Extracted from tests/mpn/t-iord_u.c.  Causes Apple's gcc 3.3 build 1640 and
   1666 to segfault with, e.g., -O2 -mpowerpc64.  */

#if defined(__GNUC__) && !defined(__clang__)
typedef unsigned long long t1;typedef t1*t2;
#if defined(__GNUC_STDC_INLINE__)  /* e.g. GCC 5.x defaults to this, not __GNUC_GNU_INLINE__ */
extern
#endif
__inline__ t1 e(t2 rp,t2 up,int n,t1 v0)
{t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;}
f(){static const struct{t1 n;t1 src[9];t1 want[9];}d[]={{1,{0},{1}},};t1 got[9];int i;
for(i=0;i<1;i++){if(e(got,got,9,d[i].n)==0)h();g(i,d[i].src,d[i].n,got,d[i].want,9);if(d[i].n)h();}}
h(){}g(){}
#else
int dummy;
#endif

int main () { return 0; }
configure:6846: result: no, long long reliability test 1

Workaround

The issue does not occur with GCC 13:

yay -S gcc13
export CC=/usr/bin/gcc-13
export CXX=/usr/bin/g++-13
yay -S mpir

Smoolak avatar May 17 '24 13:05 Smoolak