Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mpir] GCC14 compile issue #268

Open
Smoolak opened this issue May 17, 2024 · 2 comments
Open

[mpir] GCC14 compile issue #268

Smoolak opened this issue May 17, 2024 · 2 comments

Comments

@Smoolak
Copy link

Smoolak commented May 17, 2024

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
@logan001
Copy link

logan001 commented May 26, 2024

checking compiler gcc -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/dan/cloudcompare/mpir/src=/usr/src/debug/mpir -flto=auto ... no, long long reliability test 1
checking whether cc is gcc... yes
checking compiler 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/dan/cloudcompare/mpir/src=/usr/src/debug/mpir -flto=auto ... no, long long reliability test 1
checking ABI=32
checking compiler gcc -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/dan/cloudcompare/mpir/src=/usr/src/debug/mpir -flto=auto ... no, long long reliability test 1
checking compiler icc -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/dan/cloudcompare/mpir/src=/usr/src/debug/mpir -flto=auto ... no
checking whether cc is gcc... yes
checking compiler 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/dan/cloudcompare/mpir/src=/usr/src/debug/mpir -flto=auto ... no, long long reliability test 1
configure: error: could not find a working compiler, see config.log for details
==> ERROR: A failure occurred in build().
    Aborting...

same error here.

@acxz acxz changed the title mpir GCC14 compile issue [mpir] GCC14 compile issue Jul 20, 2024
@acxz
Copy link
Owner

acxz commented Jul 20, 2024

Looks like an upstream issue. Can you post an issue upstream and link it back here?

On our end, for the sake of building the package we don't need to run the tests. If we can find a way to disable the tests, that should be good enough for us.

The solution I went with temporarily is to disable the specific errors that are being checked.
Patched with: 8dc24e1

@acxz acxz added the patched label Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants