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

Tests fail to build with LTO #451

Open
eli-schwartz opened this issue Mar 6, 2024 · 1 comment
Open

Tests fail to build with LTO #451

eli-schwartz opened this issue Mar 6, 2024 · 1 comment

Comments

@eli-schwartz
Copy link

I tried to build arpack and run its tests using LTO with these *FLAGS: -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing

It failed while compiling the test programs:

/bin/sh ../libtool  --tag=F77   --mode=link x86_64-pc-linux-gnu-gfortran  -march=native -fstack-protector-all -O2 -pipe -fdiagnostics-color=always -frecord-gcc-switches -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-clash-protection -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wl,-O1 -Wl,--as-needed -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0 -o dnsimp dnsimp.o mmio.o ../SRC/libarpack.la -llapack -lblas 
libtool: link: x86_64-pc-linux-gnu-gfortran -march=native -fstack-protector-all -O2 -pipe -fdiagnostics-color=always -frecord-gcc-switches -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-clash-protection -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,-O1 -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0 -o .libs/dnsimp dnsimp.o mmio.o  -Wl,--as-needed ../SRC/.libs/libarpack.so //usr/lib/gcc/x86_64-pc-linux-gnu/13/libquadmath.so -lm -llapack -lblas
dnsimp.f:196:72: error: type of 'mmread' does not match original declaration [-Werror=lto-type-mismatch]
  196 |      *           temp,temp,temp,A,temp)
      |                                                                        ^
mmio.f:1:23: note: 'mmread' was previously declared here
    1 |       subroutine mmread(iunit,rep,field,symm,rows,cols,nnz,nnzmax,
      |                       ^
mmio.f:1:23: note: code may be misoptimized unless '-fno-strict-aliasing' is used
lto1: some warnings being treated as errors
lto-wrapper: fatal error: x86_64-pc-linux-gnu-gfortran returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

Downstream bug report: https://bugs.gentoo.org/878139
Full build log: build.log

@fghoussen
Copy link
Collaborator

Does your BLAS/LAPACK supports LTO? Feel free to PR a fix if you find one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants