Joachim Breitner mail at
Wed Dec 3 13:13:24 UTC 2014


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
> $ ldd tests/rts/linker_unload 
> =>  (0x00007fff20f6c000)
> => /usr/lib/x86_64-linux-gnu/ (0x00007f83c5bbb000)
> => /lib/x86_64-linux-gnu/ (0x00007f83c58b5000)
> => /lib/x86_64-linux-gnu/ (0x00007f83c56ac000)
> => /lib/x86_64-linux-gnu/ (0x00007f83c54a8000)
> => /lib/x86_64-linux-gnu/ (0x00007f83c50e3000)
> => /lib/x86_64-linux-gnu/ (0x00007f83c4ec4000)
> 	/lib64/ (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



Joachim “nomeata” Breitner
  mail at joachim-breitner.de
  Jabber: nomeata at  • GPG-Key: 0xF0FBF51F
  Debian Developer: nomeata at

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <>

More information about the ghc-devs mailing list