Skip to content

Commit f5da714

Browse files
committed
Fix Fortran st_size fields of mpi_fortran_argv_null_, mpi_fortran_weights_empty_, mpi_fortran_unweighted_, mpi_fortran_errcodes_ignore_, and mpi_fortran_argvs_null_
Due to a GNU ld bug (https://sourceware.org/bugzilla/show_bug.cgi?id=25236), the 5 common symbols are incorrectly versioned VER_NDX_LOCAL because their definitions in Fortran sources have smaller st_size than those in libmpi.so. This makes the Fortran library not linkable with lld in distributions that ship openmpi built with -Wl,--version-script (https://bugs.llvm.org/show_bug.cgi?id=43748): % mpifort -fuse-ld=lld /dev/null ld.lld: error: corrupt input file: version definition index 0 for symbol mpi_fortran_argv_null_ is out of bounds >>> defined in /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_usempif08.so ... Work around it by changing dimensions so that st_size of Fortran sources are at least as large as those in libmpi.so (equal on 64-bit platforms). This also fixes a minor issue that MPI_UNWEIGHTED and MPI_WEIGHTS_EMPTY were not declared as arrays (not fully fixed by commit 107c007). Fixes #7209 Signed-off-by: Fangrui Song <[email protected]>
1 parent ff48070 commit f5da714

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ompi/mpi/fortran/base/gen-mpi-mangling.pl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,33 +64,33 @@
6464
$fortran->{unweighted} = {
6565
c_type => "int *",
6666
c_name => "mpi_fortran_unweighted",
67-
f_type => "integer",
67+
f_type => "integer, dimension(2)",
6868
f_name => "MPI_UNWEIGHTED",
6969
};
7070
$fortran->{weights_empty} = {
7171
c_type => "int *",
7272
c_name => "mpi_fortran_weights_empty",
73-
f_type => "integer",
73+
f_type => "integer, dimension(2)",
7474
f_name => "MPI_WEIGHTS_EMPTY",
7575
};
7676

7777
$fortran->{argv_null} = {
7878
c_type => "char *",
7979
c_name => "mpi_fortran_argv_null",
80-
f_type => "character, dimension(1)",
80+
f_type => "character, dimension(8)",
8181
f_name => "MPI_ARGV_NULL",
8282
};
8383
$fortran->{argvs_null} = {
8484
c_type => "char *",
8585
c_name => "mpi_fortran_argvs_null",
86-
f_type => "character, dimension(1, 1)",
86+
f_type => "character, dimension(1, 8)",
8787
f_name => "MPI_ARGVS_NULL",
8888
};
8989

9090
$fortran->{errcodes_ignore} = {
9191
c_type => "int *",
9292
c_name => "mpi_fortran_errcodes_ignore",
93-
f_type => "integer, dimension(1)",
93+
f_type => "integer, dimension(2)",
9494
f_name => "MPI_ERRCODES_IGNORE",
9595
};
9696
$fortran->{status_ignore} = {

0 commit comments

Comments
 (0)