Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 913040 - sys-cluster/openmpi-4.1.4-r1: unable to compile with LTO (checking external symbol convention... configure: error: unknown naming convention: )
Summary: sys-cluster/openmpi-4.1.4-r1: unable to compile with LTO (checking external ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Cluster Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2023-08-26 08:09 UTC by Arniii
Modified: 2024-07-12 05:55 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
configuration log with the error (config.log,458.40 KB, text/x-log)
2023-08-26 08:09 UTC, Arniii
Details
emerge --info openmpi (emerge-info.log,8.56 KB, text/x-log)
2023-08-26 08:10 UTC, Arniii
Details
emerge's build log (emerge-build-log.log,22.42 KB, text/x-log)
2023-08-26 08:11 UTC, Arniii
Details
my /etc/portage/make.conf . Add here that it's on clang profile. (etc_portage_make.conf,2.55 KB, text/plain)
2023-08-26 08:12 UTC, Arniii
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arniii 2023-08-26 08:09:45 UTC
Created attachment 868755 [details]
configuration log with the error

Firstly, was problem that gfortran don't understand -rtlib=compiler-rt . That's solved by sam_ . Thanks to you.

And then I got to another problem: it uses at configuring demangler. IDK why.
So, it tries to use llvm-nm at gfortran's lto files and it gets error.
Comment 1 Arniii 2023-08-26 08:10:22 UTC
Created attachment 868756 [details]
emerge --info openmpi
Comment 2 Arniii 2023-08-26 08:11:14 UTC
Created attachment 868757 [details]
emerge's build log
Comment 3 Arniii 2023-08-26 08:12:06 UTC
Created attachment 868758 [details]
my /etc/portage/make.conf . Add here that it's on clang profile.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-08-29 06:19:14 UTC
configure:44496: checking to see if Fortran compilers need additional linker flags
configure:44617: result: none
configure:44672: checking  external symbol convention
configure:44729: x86_64-pc-linux-gnu-gfortran -O3 -pipe -march=skylake -mabm --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=6144 -g3 -ggdb -flto=4 -c conftest.f -Wl,-O1 -Wl,--as-needed -Wl,--as-needed  -lz
configure:44736: $? = 0
Could not determine Fortran naming convention. Output from llvm-nm:
0000000000000001 C __gnu_lto_slim
0000000000000000 W conftest.f.100c6f4c
configure:44775: result: 
configure:44793: error: unknown naming convention: 


Does it work without LTO?
Comment 5 Arniii 2023-09-15 14:05:07 UTC
(In reply to Sam James from comment #4)
> configure:44496: checking to see if Fortran compilers need additional linker
> flags
> configure:44617: result: none
> configure:44672: checking  external symbol convention
> configure:44729: x86_64-pc-linux-gnu-gfortran -O3 -pipe -march=skylake -mabm
> --param=l1-cache-line-size=64 --param=l1-cache-size=32
> --param=l2-cache-size=6144 -g3 -ggdb -flto=4 -c conftest.f -Wl,-O1
> -Wl,--as-needed -Wl,--as-needed  -lz
> configure:44736: $? = 0
> Could not determine Fortran naming convention. Output from llvm-nm:
> 0000000000000001 C __gnu_lto_slim
> 0000000000000000 W conftest.f.100c6f4c
> configure:44775: result: 
> configure:44793: error: unknown naming convention: 
> 
> 
> Does it work without LTO?

I've tried without LTO, yep, it steps through the point further. So yes, llvm-nm  cannot understand gfortran lto symbols.
Comment 6 Eli Schwartz gentoo-dev 2024-05-31 19:07:56 UTC
It is more generally broken:

configure:44049: checking if C and Fortran are link compatible
configure:44097: x86_64-pc-linux-gnu-gcc -c -DNDEBUG -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wformat -Werror=format-security -Werror=implicit-function-declaration -Werror=implicit-int -Werror=int-conversion -Werror=incompatible-pointer-types -finline-functions -fno-strict-aliasing  conftest_c.c
configure:44104: $? = 0
configure:44125: x86_64-pc-linux-gnu-gfortran -o conftest -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0  conftest.f90 conftest_c.o  -lz >&5
conftest.f90:4:23: error: type of 'testfunc' does not match original declaration [-Werror=lto-type-mismatch]
    4 |        call testfunc(1)
      |                       ^
conftest_c.c:2:5: note: return value type mismatch
    2 | int testfunc_(int a) { return a; }
      |     ^
conftest_c.c:2:5: note: type 'int' should match type 'void'
conftest_c.c:2:5: note: 'testfunc_' was previously declared here
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/14/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
configure:44125: $? = 1
configure: failed program was:
|       program main
| 
|        external testfunc
|        call testfunc(1)
| 
|       end
configure:44151: result: no
configure:44176: error: C and Fortran compilers are not link compatible.  Can not continue.
Comment 7 Larry the Git Cow gentoo-dev 2024-07-12 05:55:16 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0c0b7168dd3315736ebe69575a88a8176bd3bec0

commit 0c0b7168dd3315736ebe69575a88a8176bd3bec0
Author:     Eli Schwartz <eschwartz93@gmail.com>
AuthorDate: 2024-05-31 19:32:49 +0000
Commit:     Eli Schwartz <eschwartz@gentoo.org>
CommitDate: 2024-07-12 05:01:50 +0000

    sys-cluster/openmpi: mark as LTO-unsafe, strict-aliasing unsafe
    
    Closes: https://bugs.gentoo.org/913040
    Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>

 sys-cluster/openmpi/openmpi-4.1.6.ebuild | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)