[Bug 697229]
Hjl-tools
697229 at bugs.launchpad.net
Wed Oct 5 20:11:54 UTC 2011
A small testcase:
hjl at gnu-6 pr13250]$ cat foo.c
char mpi_fortran_argv_null_[8];
[hjl at gnu-6 pr13250]$ cat bar.c
extern char mpi_fortran_argv_null_[8];
int
bar ()
{
return mpi_fortran_argv_null_[0];
}
[hjl at gnu-6 pr13250]$ cat main.c
char mpi_fortran_argv_null_[1];
extern int bar ();
int
main ()
{
bar ();
return 0;
}
[hjl at gnu-6 pr13250]$ make
gcc -g -c -o main.o main.c
gcc -shared -fPIC -g -o libfoo.so foo.c
gcc -shared -fPIC -g -o libbar.so bar.c libfoo.so
gcc -Wl,--as-needed -o x main.o libbar.so libfoo.so -Wl,-rpath,.
/usr/local/bin/ld: main.o(.debug_info+0x7e): unresolvable R_X86_64_64 relocation against symbol `mpi_fortran_argv_null_'
./x
[hjl at gnu-6 pr13250]$
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to binutils in Ubuntu.
https://bugs.launchpad.net/bugs/697229
Title:
openmpi link failure with ld --as-needed
Status in binutils:
Confirmed
Status in “binutils” package in Ubuntu:
Confirmed
Status in “openmpi” package in Ubuntu:
Confirmed
Status in “openmpi” package in Debian:
New
Bug description:
$ cat test.F
program main
include 'mpif.h'
integer ierr
call mpi_init(ierr)
end
$ mpif90 test.F -Wl,--as-needed -Wall -Wno-unused-variable -g -I/usr/lib/openmpi/include -I/usr/lib/openmpi/lib -L/usr/lib/openmpi/lib -L/usr/lib/gcc/i686-linux-gnu/4.5.2 -ldl -lmpi -lopen-rte -lopen-pal -lnsl -lutil -lgcc_s -lpthread -ldl /usr/bin/ld: /tmp/cccq3IWF.o(.debug_info+0x48d): unresolvable R_X86_64_64 relocation against symbol `mpi_fortran_argv_null_'
/usr/bin/ld: /tmp/cccq3IWF.o(.debug_info+0x4a7): unresolvable R_X86_64_64 relocation against symbol `mpi_fortran_argv_null_'
/usr/bin/ld: /tmp/cccq3IWF.o(.debug_info+0x511): unresolvable R_X86_64_64 relocation against symbol `mpi_fortran_errcodes_ignore_'
/usr/bin/ld: /tmp/cccq3IWF.o(.debug_info+0x52b): unresolvable R_X86_64_64 relocation against symbol `mpi_fortran_errcodes_ignore_'
works with --no-as-needed.
To manage notifications about this bug go to:
https://bugs.launchpad.net/binutils/+bug/697229/+subscriptions
More information about the foundations-bugs
mailing list