Status and future of the LLVM backend

Joachim Breitner mail at
Thu Dec 4 22:37:02 UTC 2014


Am Montag, den 01.12.2014, 13:17 -0500 schrieb Ben Gamari:
> Is there any way you could poke around at the state of the tree after
> the failure? It would be nice to confirm that this is in fact that
> bfd/gold issue and perhaps figure out why isn't being used.
> Otherwise I can try to reproduce this on my ARM box.

ok, I finally reproduced this on a porter box, and (using strace...) I
found out that -B/usr/bin/ was ignored. What did work was passing
-optl-fuse-ld=gold to ghc. But that, in turn, causes

/usr/bin/ --hash-size=31: unknown option

There seems to be some special handling for Gold in SysTools.lhs, via
getLinkerInfo'. But passing -pgml=/usr/bin/ to ghc causes

/usr/bin/ -pthread: unknown option
/usr/bin/ use the --help option for usage information

so this is not the right thing to do.

The problem is that in order to find out which linker is used, ghc calls

/usr/bin/gcc -Wl,-version

without passing the options from -optl, so the -fuse-ld=gold is not used
in this step. I’m a bit confused, because the code in getLinkerInfo'
looks like it should be passing them... ah, but only on HEAD, not in
7.8... and git blame tells me that I probably want to apply this patch:

commit e7b414a3cc0e27049f2608f5e0a00c47146cc46d
Author: Sebastian Dröge <sebastian at>
Date:   Tue Nov 18 12:40:20 2014 -0600

    Fix detection of GNU gold linker if invoked via gcc with parameters
    Previously the linker was called without any commandline parameters to
    detect whether bfd or gold is used. However the -fuse-ld parameter can
    be used to switch between gold and bfd and should be taken into account
    Trac #9336
    Signed-off-by: Austin Seipp <austin at>

(which would have saved me some work had I known about it). I’ll try it
and report back.


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