linker_unload

Boespflug, Mathieu m at tweag.io
Wed Dec 3 13:22:51 UTC 2014


Have you tried using ld.gold instead? I've run into many issues with
the default ld.bfd recently (none of which seems related to this
issue, but it tells me that weird linker bugs do happen and testing
with another linker may help isolate the root cause).
--
Mathieu Boespflug
Founder at http://tweag.io.


On 3 December 2014 at 14:13, Joachim Breitner <mail at joachim-breitner.de> wrote:
> Hi,
>
>
> Am Mittwoch, den 03.12.2014, 11:18 +0100 schrieb Herbert Valerio Riedel:
>> On 2014-12-03 at 09:48:58 +0100, Simon Peyton Jones wrote:
>> For a non-failing linker_unload environment, the testprogram is linked
>> against libgmp.so:
>>
>> $ ldd tests/rts/linker_unload
>>       linux-vdso.so.1 =>  (0x00007fff20f6c000)
>>       libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f83c5bbb000)
>>       libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f83c58b5000)
>>       librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f83c56ac000)
>>       libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f83c54a8000)
>>       libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f83c50e3000)
>>       libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f83c4ec4000)
>>       /lib64/ld-linux-x86-64.so.2 (0x00007f83c5e76000)
>
> and for a failing, it is not.
>
>
> I further narrowed it down to the question of whether gcc passes
> "--as-needed" to ld by default: If I pass "-optl-Wl,--no-as-needed" to
> ghc when compiling linker_unload.c, it works there as well.
>
>
> In some releases of Ubuntu, --as-needed is the default¹. Not sure why
> Herbert does not see this behavior in a recent release (14.04).
>
> I’m also not sure about the right fix: Should we just pass
> -Wl,--no-as-needed to gcc always? But clearly there is a reason for this
> flag becoming default. Can we set up things so that they work with
> --as-needed?
>
> Greetings,
> Joachim
>
>
>
>
> ¹ https://lists.ubuntu.com/archives/ubuntu-devel-announce/2010-November/000783.html
>
>
>
> --
> Joachim “nomeata” Breitner
>   mail at joachim-breitner.dehttp://www.joachim-breitner.de/
>   Jabber: nomeata at joachim-breitner.de  • GPG-Key: 0xF0FBF51F
>   Debian Developer: nomeata at debian.org
>
>
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-devs
>


More information about the ghc-devs mailing list