Debian Bug report logs - #608901
link failure with ld --as-needed

version graph

Packages: openmpi, binutils; Maintainer for openmpi is Debian Open MPI Maintainers <pkg-openmpi-maintainers@lists.alioth.debian.org>; Maintainer for binutils is Matthias Klose <doko@debian.org>; Source for binutils is src:binutils.

Reported by: Matthias Klose <doko@ubuntu.com>

Date: Tue, 4 Jan 2011 14:03:01 UTC

Severity: normal

Fixed in version binutils/2.21.90.20111004-2

Done: Matthias Klose <doko@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Open MPI Maintainers <pkg-openmpi-maintainers@lists.alioth.debian.org>, Matthias Klose <doko@debian.org>:
Bug#608901; Package openmpi,binutils. (Tue, 04 Jan 2011 14:03:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Matthias Klose <doko@ubuntu.com>:
New Bug report received and forwarded. Copy sent to Debian Open MPI Maintainers <pkg-openmpi-maintainers@lists.alioth.debian.org>, Matthias Klose <doko@debian.org>. (Tue, 04 Jan 2011 14:03:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Matthias Klose <doko@ubuntu.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: link failure with ld --as-needed
Date: Tue, 04 Jan 2011 14:57:41 +0100
Package: openmpi,binutils
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu natty ubuntu-patch
User: debian-gcc@lists.debian.org
Usertags: ld-as-needed

With gcc, gcc-4.5 and binutils from experimental, the following configure test 
(taken from petsc) fails with --as-needed:

$ 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_'

the error messages hint to an object file not built with -fPIC, but I didn't 
find one yet.

The -L/usr/lib/openmpi/lib is needed until bug #608717 is fixed.




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Open MPI Maintainers <pkg-openmpi-maintainers@lists.alioth.debian.org>, Matthias Klose <doko@debian.org>:
Bug#608901; Package openmpi,binutils. (Tue, 04 Jan 2011 20:00:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ralf Wildenhues <Ralf.Wildenhues@gmx.de>:
Extra info received and forwarded to list. Copy sent to Debian Open MPI Maintainers <pkg-openmpi-maintainers@lists.alioth.debian.org>, Matthias Klose <doko@debian.org>. (Tue, 04 Jan 2011 20:00:07 GMT) Full text and rfc822 format available.

Message #10 received at 608901@bugs.debian.org (full text, mbox):

From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
To: Matthias Klose <doko@ubuntu.com>
Cc: 608901@bugs.debian.org
Subject: Re: Bug#608901: link failure with ld --as-needed
Date: Tue, 4 Jan 2011 20:56:37 +0100
Hello Matthias,

* Matthias Klose wrote on Tue, Jan 04, 2011 at 02:57:41PM CET:
> With gcc, gcc-4.5 and binutils from experimental, the following
> configure test (taken from petsc) fails with --as-needed:
> 
> $ 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_'
[...]
> the error messages hint to an object file not built with -fPIC, but
> I didn't find one yet.

Can you show -showme and -v output?

Thanks,
Ralf




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Open MPI Maintainers <pkg-openmpi-maintainers@lists.alioth.debian.org>, Matthias Klose <doko@debian.org>:
Bug#608901; Package openmpi,binutils. (Tue, 04 Jan 2011 20:39:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Matthias Klose <doko@ubuntu.com>:
Extra info received and forwarded to list. Copy sent to Debian Open MPI Maintainers <pkg-openmpi-maintainers@lists.alioth.debian.org>, Matthias Klose <doko@debian.org>. (Tue, 04 Jan 2011 20:39:08 GMT) Full text and rfc822 format available.

Message #15 received at 608901@bugs.debian.org (full text, mbox):

From: Matthias Klose <doko@ubuntu.com>
To: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Cc: 608901@bugs.debian.org
Subject: Re: Bug#608901: link failure with ld --as-needed
Date: Tue, 04 Jan 2011 21:34:07 +0100
[Message part 1 (text/plain, inline)]
On 04.01.2011 20:56, Ralf Wildenhues wrote:
> Hello Matthias,
>
> * Matthias Klose wrote on Tue, Jan 04, 2011 at 02:57:41PM CET:
>> With gcc, gcc-4.5 and binutils from experimental, the following
>> configure test (taken from petsc) fails with --as-needed:
>>
>> $ 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_'
> [...]
>> the error messages hint to an object file not built with -fPIC, but
>> I didn't find one yet.
>
> Can you show -showme and -v output?

thanks for the quick reply.


[v.log (text/x-log, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Open MPI Maintainers <pkg-openmpi-maintainers@lists.alioth.debian.org>, Matthias Klose <doko@debian.org>:
Bug#608901; Package openmpi,binutils. (Thu, 06 Jan 2011 21:42:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ralf Wildenhues <Ralf.Wildenhues@gmx.de>:
Extra info received and forwarded to list. Copy sent to Debian Open MPI Maintainers <pkg-openmpi-maintainers@lists.alioth.debian.org>, Matthias Klose <doko@debian.org>. (Thu, 06 Jan 2011 21:42:09 GMT) Full text and rfc822 format available.

Message #20 received at 608901@bugs.debian.org (full text, mbox):

From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
To: Matthias Klose <doko@ubuntu.com>, 608901@bugs.debian.org
Subject: Re: Bug#608901: link failure with ld --as-needed
Date: Thu, 6 Jan 2011 22:40:10 +0100
* Matthias Klose wrote on Tue, Jan 04, 2011 at 09:34:07PM CET:
> On 04.01.2011 20:56, Ralf Wildenhues wrote:
> >* Matthias Klose wrote on Tue, Jan 04, 2011 at 02:57:41PM CET:
> >>With gcc, gcc-4.5 and binutils from experimental, the following
> >>configure test (taken from petsc) fails with --as-needed:

> >>$ 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_'
> >[...]
> >>the error messages hint to an object file not built with -fPIC, but
> >>I didn't find one yet.
> >
> >Can you show -showme and -v output?

>  /usr/lib/gcc/x86_64-linux-gnu/4.5.2/collect2 --build-id --no-add-needed --eh-frame-hdr -m elf_x86_64 --hash-style=both -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/gcc/x86_64-linux-gnu/4.5.2/../../../../lib/crt1.o /usr/lib/gcc/x86_64-linux-gnu/4.5.2/../../../../lib/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.5.2/crtbegin.o -L/usr/lib/openmpi/lib -L/usr/lib/gcc/i686-linux-gnu/4.5.2 -L/usr/lib/openmpi/lib -L/usr/lib/gcc/x86_64-linux-gnu/4.5.2 -L/usr/lib/gcc/x86_64-linux-gnu/4.5.2/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.5.2/../../.. /tmp/ccqYKv1H.o --as-needed -ldl -lmpi -lopen-rte -lopen-pal -lnsl -lutil -lgcc_s -lpthread -ldl -lmpi_f90 -lmpi_f77 -lmpi -lopen-rte -lopen-pal -ldl --export-dynamic -lnsl -lutil -lgfortran -lm -ldl -lgfortran -lm -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/4.5.2/crtend.o /usr/lib/gcc/x86_64-linux-gnu/4.5.2/../../../../lib/crtn.o
> /usr/bin/ld: /tmp/ccqYKv1H.o(.debug_info+0x48d): unresolvable R_X86_64_64 relocation against symbol `mpi_fortran_argv_null_'
> /usr/bin/ld: /tmp/ccqYKv1H.o(.debug_info+0x4a7): unresolvable R_X86_64_64 relocation against symbol `mpi_fortran_argv_null_'
> /usr/bin/ld: /tmp/ccqYKv1H.o(.debug_info+0x511): unresolvable R_X86_64_64 relocation against symbol `mpi_fortran_errcodes_ignore_'
> /usr/bin/ld: /tmp/ccqYKv1H.o(.debug_info+0x52b): unresolvable R_X86_64_64 relocation against symbol `mpi_fortran_errcodes_ignore_'

Thanks.  libmpi_f90 should provide these symbols.  libmpi_f77 references
them on my system, but doesn't have a DT_NEEDED entry on libmpi_f90.so.0.

Can you wrap -lmpi_f90 in '-Wl,--no-as-needed ... -Wl,--as-needed' when
running commands manually, to see whether that fixes it?

Can you show nm output for the generated .o file?

I remember there have been GCC or binutils issues with as-needed and
symbols in common blocks, but can't find a reference now.

Thanks,
Ralf




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Open MPI Maintainers <pkg-openmpi-maintainers@lists.alioth.debian.org>, Matthias Klose <doko@debian.org>:
Bug#608901; Package openmpi,binutils. (Thu, 06 Jan 2011 22:03:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Matthias Klose <doko@ubuntu.com>:
Extra info received and forwarded to list. Copy sent to Debian Open MPI Maintainers <pkg-openmpi-maintainers@lists.alioth.debian.org>, Matthias Klose <doko@debian.org>. (Thu, 06 Jan 2011 22:03:06 GMT) Full text and rfc822 format available.

Message #25 received at 608901@bugs.debian.org (full text, mbox):

From: Matthias Klose <doko@ubuntu.com>
To: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>, 608901@bugs.debian.org
Cc: Matthias Klose <doko@ubuntu.com>
Subject: Re: Bug#608901: link failure with ld --as-needed
Date: Thu, 06 Jan 2011 22:59:12 +0100
On 06.01.2011 22:40, Ralf Wildenhues wrote:
> * Matthias Klose wrote on Tue, Jan 04, 2011 at 09:34:07PM CET:
>> On 04.01.2011 20:56, Ralf Wildenhues wrote:
>>> * Matthias Klose wrote on Tue, Jan 04, 2011 at 02:57:41PM CET:
>>>> With gcc, gcc-4.5 and binutils from experimental, the following
>>>> configure test (taken from petsc) fails with --as-needed:
>
>>>> $ 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_'
>>> [...]
>>>> the error messages hint to an object file not built with -fPIC, but
>>>> I didn't find one yet.
>>>
>>> Can you show -showme and -v output?
>
>>   /usr/lib/gcc/x86_64-linux-gnu/4.5.2/collect2 --build-id --no-add-needed --eh-frame-hdr -m elf_x86_64 --hash-style=both -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/gcc/x86_64-linux-gnu/4.5.2/../../../../lib/crt1.o /usr/lib/gcc/x86_64-linux-gnu/4.5.2/../../../../lib/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.5.2/crtbegin.o -L/usr/lib/openmpi/lib -L/usr/lib/gcc/i686-linux-gnu/4.5.2 -L/usr/lib/openmpi/lib -L/usr/lib/gcc/x86_64-linux-gnu/4.5.2 -L/usr/lib/gcc/x86_64-linux-gnu/4.5.2/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.5.2/../../.. /tmp/ccqYKv1H.o --as-needed -ldl -lmpi -lopen-rte -lopen-pal -lnsl -lutil -lgcc_s -lpthread -ldl -lmpi_f90 -lmpi_f77 -lmpi -lopen-rte -lopen-pal -ldl --export-dynamic -lnsl -lutil -lgfortran -lm -ldl -lgfortran -lm -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/4.5.2/crtend.o /usr/lib/gcc/x86_64-linux-gnu/4.5.2/../../../../lib/crtn.o
>> /usr/bin/ld: /tmp/ccqYKv1H.o(.debug_info+0x48d): unresolvable R_X86_64_64 relocation against symbol `mpi_fortran_argv_null_'
>> /usr/bin/ld: /tmp/ccqYKv1H.o(.debug_info+0x4a7): unresolvable R_X86_64_64 relocation against symbol `mpi_fortran_argv_null_'
>> /usr/bin/ld: /tmp/ccqYKv1H.o(.debug_info+0x511): unresolvable R_X86_64_64 relocation against symbol `mpi_fortran_errcodes_ignore_'
>> /usr/bin/ld: /tmp/ccqYKv1H.o(.debug_info+0x52b): unresolvable R_X86_64_64 relocation against symbol `mpi_fortran_errcodes_ignore_'
>
> Thanks.  libmpi_f90 should provide these symbols.  libmpi_f77 references
> them on my system, but doesn't have a DT_NEEDED entry on libmpi_f90.so.0.
>
> Can you wrap -lmpi_f90 in '-Wl,--no-as-needed ... -Wl,--as-needed' when
> running commands manually, to see whether that fixes it?

yes, this works as expected.

> Can you show nm output for the generated .o file?
>
> I remember there have been GCC or binutils issues with as-needed and
> symbols in common blocks, but can't find a reference now.

$ nm test.o
0000000000000000 t MAIN__
                 U _gfortran_set_args
                 U _gfortran_set_options
000000000000001b T main
0000000000000001 C mpi_fortran_argv_null_
0000000000000008 C mpi_fortran_argvs_null_
0000000000000004 C mpi_fortran_bottom_
0000000000000004 C mpi_fortran_errcodes_ignore_
0000000000000004 C mpi_fortran_in_place_
0000000000000014 C mpi_fortran_status_ignore_
0000000000000008 C mpi_fortran_statuses_ignore_
                 U mpi_init_
0000000000000000 r options.0.1778

$ objdump -T /usr/lib/libmpi_f90.so|grep argv
0000000000202c80 g    DO .bss   0000000000000008              mpi_fortran_argv_null_
0000000000202c60 g    DO .bss   0000000000000008  Base 
mpi_fortran_argvs_null_

$ nm -D /usr/lib/libmpi_f90.so|grep argv
0000000000202c80 B mpi_fortran_argv_null_
0000000000202c60 B mpi_fortran_argvs_null_

objdump doesn't show `Base' for this symbol.




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Open MPI Maintainers <pkg-openmpi-maintainers@lists.alioth.debian.org>, Matthias Klose <doko@debian.org>:
Bug#608901; Package openmpi,binutils. (Sat, 08 Jan 2011 08:51:11 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ralf Wildenhues <Ralf.Wildenhues@gmx.de>:
Extra info received and forwarded to list. Copy sent to Debian Open MPI Maintainers <pkg-openmpi-maintainers@lists.alioth.debian.org>, Matthias Klose <doko@debian.org>. (Sat, 08 Jan 2011 08:51:11 GMT) Full text and rfc822 format available.

Message #30 received at 608901@bugs.debian.org (full text, mbox):

From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
To: Matthias Klose <doko@ubuntu.com>, 608901@bugs.debian.org
Subject: Re: Bug#608901: link failure with ld --as-needed
Date: Sat, 8 Jan 2011 09:50:39 +0100
* Matthias Klose wrote on Thu, Jan 06, 2011 at 10:59:12PM CET:
> On 06.01.2011 22:40, Ralf Wildenhues wrote:
> >
> >>  /usr/lib/gcc/x86_64-linux-gnu/4.5.2/collect2 --build-id --no-add-needed --eh-frame-hdr -m elf_x86_64 --hash-style=both -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/gcc/x86_64-linux-gnu/4.5.2/../../../../lib/crt1.o /usr/lib/gcc/x86_64-linux-gnu/4.5.2/../../../../lib/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.5.2/crtbegin.o -L/usr/lib/openmpi/lib -L/usr/lib/gcc/i686-linux-gnu/4.5.2 -L/usr/lib/openmpi/lib -L/usr/lib/gcc/x86_64-linux-gnu/4.5.2 -L/usr/lib/gcc/x86_64-linux-gnu/4.5.2/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.5.2/../../.. /tmp/ccqYKv1H.o --as-needed -ldl -lmpi -lopen-rte -lopen-pal -lnsl -lutil -lgcc_s -lpthread -ldl -lmpi_f90 -lmpi_f77 -lmpi -lopen-rte -lopen-pal -ldl --export-dynamic -lnsl -lutil -lgfortran -lm -ldl -lgfortran -lm -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/4.5.2/crtend.o /usr/lib/gcc/x86_64-linux-gnu/4.5.2/../../../../lib/crtn.o
> >>/usr/bin/ld: /tmp/ccqYKv1H.o(.debug_info+0x48d): unresolvable R_X86_64_64 relocation against symbol `mpi_fortran_argv_null_'
> >>/usr/bin/ld: /tmp/ccqYKv1H.o(.debug_info+0x4a7): unresolvable R_X86_64_64 relocation against symbol `mpi_fortran_argv_null_'
> >>/usr/bin/ld: /tmp/ccqYKv1H.o(.debug_info+0x511): unresolvable R_X86_64_64 relocation against symbol `mpi_fortran_errcodes_ignore_'
> >>/usr/bin/ld: /tmp/ccqYKv1H.o(.debug_info+0x52b): unresolvable R_X86_64_64 relocation against symbol `mpi_fortran_errcodes_ignore_'
> >
> >Thanks.  libmpi_f90 should provide these symbols.  libmpi_f77 references
> >them on my system, but doesn't have a DT_NEEDED entry on libmpi_f90.so.0.
> >
> >Can you wrap -lmpi_f90 in '-Wl,--no-as-needed ... -Wl,--as-needed' when
> >running commands manually, to see whether that fixes it?
> 
> yes, this works as expected.

> $ nm test.o
[...]
> 0000000000000001 C mpi_fortran_argv_null_
> 0000000000000008 C mpi_fortran_argvs_null_
> 0000000000000004 C mpi_fortran_bottom_
> 0000000000000004 C mpi_fortran_errcodes_ignore_
[...]

Well, so test.o already provides common definitions for them.
I don't think --as-needed is then supposed to trigger inclusion
for libmpi_f90, but I also don't think the link should fail then.

> $ objdump -T /usr/lib/libmpi_f90.so|grep argv
> 0000000000202c80 g    DO .bss   0000000000000008              mpi_fortran_argv_null_
> 0000000000202c60 g    DO .bss   0000000000000008  Base
> mpi_fortran_argvs_null_
> 
> $ nm -D /usr/lib/libmpi_f90.so|grep argv
> 0000000000202c80 B mpi_fortran_argv_null_
> 0000000000202c60 B mpi_fortran_argvs_null_
> 
> objdump doesn't show `Base' for this symbol.

I don't think symbol versions are relevant here though.

Can you reproduce it with something like this?

cat >liba.c <<\END
extern int foo;

int a ()
{
  return foo;
}
END

cat >libb.c <<\END
int foo;

int b ()
{
  return foo;
}
END

cat >main.c <<\END
int foo;
extern int b ();

int main ()
{
  return b ();
}
END

gcc -fPIC -c liba.c
gcc -fPIC -c libb.c
gcc -c main.c
gcc -shared -o liba.so liba.o
gcc -shared -o libb.so libb.o
gcc -o main main.o -L. -Wl,--as-needed -la -lb


If not, then can you modify it so it reproduces (maybe several variables
are needed)?  If yes, then I suggest (possibly after further
simplification, e.g., omitting liba) you file a bug with binutils.
And can you find out whether you can avoid the bug by, say force-pulling
in libmpi_f90 aka libb (by referencing an unrelated symbol in that
library).

And, I guess, upstream OpenMPI should be notified about this.

Thanks,
Ralf




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Open MPI Maintainers <pkg-openmpi-maintainers@lists.alioth.debian.org>, Matthias Klose <doko@debian.org>:
Bug#608901; Package openmpi,binutils. (Tue, 11 Jan 2011 16:06:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Manuel Prinz <manuel@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Open MPI Maintainers <pkg-openmpi-maintainers@lists.alioth.debian.org>, Matthias Klose <doko@debian.org>. (Tue, 11 Jan 2011 16:06:06 GMT) Full text and rfc822 format available.

Message #35 received at 608901@bugs.debian.org (full text, mbox):

From: Manuel Prinz <manuel@debian.org>
To: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>, 608901@bugs.debian.org
Subject: Re: [Pkg-openmpi-maintainers] Bug#608901: link failure with ld --as-needed
Date: Tue, 11 Jan 2011 16:55:52 +0100
On Sat, Jan 08, 2011 at 09:50:39AM +0100, Ralf Wildenhues wrote:
> And, I guess, upstream OpenMPI should be notified about this.

Done. And thanks a lot for taking the time to investigate this!

Best regards,
Manuel




Reply sent to Matthias Klose <doko@debian.org>:
You have taken responsibility. (Sat, 08 Oct 2011 12:36:04 GMT) Full text and rfc822 format available.

Notification sent to Matthias Klose <doko@ubuntu.com>:
Bug acknowledged by developer. (Sat, 08 Oct 2011 12:36:08 GMT) Full text and rfc822 format available.

Message #40 received at 608901-close@bugs.debian.org (full text, mbox):

From: Matthias Klose <doko@debian.org>
To: 608901-close@bugs.debian.org
Subject: Bug#608901: fixed in binutils 2.21.90.20111004-2
Date: Sat, 08 Oct 2011 12:32:41 +0000
Source: binutils
Source-Version: 2.21.90.20111004-2

We believe that the bug you reported is fixed in the latest version of
binutils, which is due to be installed in the Debian FTP archive:

binutils-dev_2.21.90.20111004-2_i386.deb
  to main/b/binutils/binutils-dev_2.21.90.20111004-2_i386.deb
binutils-doc_2.21.90.20111004-2_all.deb
  to main/b/binutils/binutils-doc_2.21.90.20111004-2_all.deb
binutils-gold_2.21.90.20111004-2_i386.deb
  to main/b/binutils/binutils-gold_2.21.90.20111004-2_i386.deb
binutils-multiarch_2.21.90.20111004-2_i386.deb
  to main/b/binutils/binutils-multiarch_2.21.90.20111004-2_i386.deb
binutils-source_2.21.90.20111004-2_all.deb
  to main/b/binutils/binutils-source_2.21.90.20111004-2_all.deb
binutils_2.21.90.20111004-2.diff.gz
  to main/b/binutils/binutils_2.21.90.20111004-2.diff.gz
binutils_2.21.90.20111004-2.dsc
  to main/b/binutils/binutils_2.21.90.20111004-2.dsc
binutils_2.21.90.20111004-2_i386.deb
  to main/b/binutils/binutils_2.21.90.20111004-2_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 608901@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Matthias Klose <doko@debian.org> (supplier of updated binutils package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Thu, 06 Oct 2011 08:06:04 +0200
Source: binutils
Binary: binutils binutils-dev binutils-multiarch binutils-gold binutils-hppa64 binutils-spu binutils-doc binutils-source
Architecture: source all i386
Version: 2.21.90.20111004-2
Distribution: unstable
Urgency: low
Maintainer: Matthias Klose <doko@debian.org>
Changed-By: Matthias Klose <doko@debian.org>
Description: 
 binutils   - The GNU assembler, linker and binary utilities
 binutils-dev - The GNU binary utilities (BFD development files)
 binutils-doc - Documentation for the GNU assembler, linker and binary utilities
 binutils-gold - The (experimental) GNU gold linker utility
 binutils-hppa64 - The GNU assembler, linker and binary utilities targeted for hppa6
 binutils-multiarch - Binary utilities that support multi-arch targets
 binutils-source - The GNU assembler, linker and binary utilities (source)
 binutils-spu - The GNU assembler, linker and binary utilities targeted for spu-e
Closes: 608901
Changes: 
 binutils (2.21.90.20111004-2) unstable; urgency=low
 .
   * Fix PR ld/13250, preserve the maximum alignment and size for common
     symbols (H.J. Lu). Closes: #608901. LP: #697229.
Checksums-Sha1: 
 e60c61dd0be80ab012717b090edc46539ca03239 1771 binutils_2.21.90.20111004-2.dsc
 7aaef4cd476d475ae80300785730b145e1471fa8 71282 binutils_2.21.90.20111004-2.diff.gz
 94e40018ac987ebf7609697677025ed9ebd087c2 580990 binutils-doc_2.21.90.20111004-2_all.deb
 2ab20b1700c09e8f74599cd9b3c8d468f38d1f6d 14109810 binutils-source_2.21.90.20111004-2_all.deb
 ca3eb3e446c588c8939ebe6ca993aeaa001740c1 4605680 binutils_2.21.90.20111004-2_i386.deb
 aa16bd7f5e53f3924354365890688b24a65e0e7d 4085468 binutils-dev_2.21.90.20111004-2_i386.deb
 8e2d1c9a8bbb5ba7594c493d67dec2ebce86a6d7 2235698 binutils-multiarch_2.21.90.20111004-2_i386.deb
 568692fc690354049a4ea6ead6f5cffccd89d168 1488 binutils-gold_2.21.90.20111004-2_i386.deb
Checksums-Sha256: 
 202ed0533441dd25c9acba9e20fdc47a48edc7d10938a062a372f34eea262ad8 1771 binutils_2.21.90.20111004-2.dsc
 ae8fbf753d3644d66b86e3c8f49236bd6c8c63ee5c80ab435af770e8e417d3eb 71282 binutils_2.21.90.20111004-2.diff.gz
 6be9283b25faab80b74f66d290fc0856b470f804d1e584efaa328a4fc46c1b14 580990 binutils-doc_2.21.90.20111004-2_all.deb
 31d6fa4d3b8bec962db8e285dcc7aaa330ecd6ebc4fab47a127bed84d6b0dd4d 14109810 binutils-source_2.21.90.20111004-2_all.deb
 6e6df21625eff2377f53aa69ac7ca000ba452411a789cef0d90195525f8ab340 4605680 binutils_2.21.90.20111004-2_i386.deb
 d7ca3cc9a256ef6fc849ec4d422233fef8e10705d1dd4d59e441419bbf02cf39 4085468 binutils-dev_2.21.90.20111004-2_i386.deb
 04ab17fa7fe4eb78e5f0bdac22f5cbd8aa82811acca18b232d5a378706711d35 2235698 binutils-multiarch_2.21.90.20111004-2_i386.deb
 896d02ef283fc09244d11e7cfac2c14a17290fe9299b1dfdc2bd142aa543c0f7 1488 binutils-gold_2.21.90.20111004-2_i386.deb
Files: 
 e9055dbf0ad1d224356f35754126b482 1771 devel optional binutils_2.21.90.20111004-2.dsc
 deb03ea49407e2bf347843fc5d8635e8 71282 devel optional binutils_2.21.90.20111004-2.diff.gz
 5ec36cb2405022dd765ca4356e60f741 580990 doc optional binutils-doc_2.21.90.20111004-2_all.deb
 935c46d59743c0f66ae75d6a50b171f5 14109810 devel optional binutils-source_2.21.90.20111004-2_all.deb
 a39f6296df9d5bffc57c98d4cbc76ee8 4605680 devel optional binutils_2.21.90.20111004-2_i386.deb
 53f0681fc15d9dba599e0940adb6a2bd 4085468 devel extra binutils-dev_2.21.90.20111004-2_i386.deb
 f3d6da148bfdad6b5fd2007981b77899 2235698 devel extra binutils-multiarch_2.21.90.20111004-2_i386.deb
 f0431d2f1c0cd81eaeb0f840f6392ce2 1488 devel extra binutils-gold_2.21.90.20111004-2_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk6QPzMACgkQStlRaw+TLJyROwCdF4lzDD4twN8ydy30tJm8lp5B
ycwAoIDU6D6nYsZRxt44yt3QGNr2ZBg3
=Bxcj
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sun, 06 Nov 2011 07:30:57 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Apr 18 13:58:12 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.