on iko/ghcjs-patch-master help sign in
use ld.gold by default on linux (#324)
096a6a6Richard Wallace
builder/comp-builder.nix+17−6
@@ -66,13 +66,24 @@ let
66 "--with-ghc-pkg=${ghc.targetPrefix}ghc-pkg"
66 "--with-ghc-pkg=${ghc.targetPrefix}ghc-pkg"
67 "--with-hsc2hs=${ghc.targetPrefix}hsc2hs"
67 "--with-hsc2hs=${ghc.targetPrefix}hsc2hs"
68 ] ++ lib.optionals (stdenv.cc != null)
68 ] ++ lib.optionals (stdenv.cc != null)
69− [ # CC
69+ ( # CC
70− "--with-gcc=${stdenv.cc.targetPrefix}cc"
70+ [ "--with-gcc=${stdenv.cc.targetPrefix}cc"
71+ ] ++
71 # BINTOOLS
72 # BINTOOLS
73+ (if stdenv.hostPlatform.isLinux
74+ # use gold as the linker on linux to improve link times
75+ then [
76+ "--with-ld=${stdenv.cc.bintools.targetPrefix}ld.gold"
77+ "--ghc-option=-optl-fuse-ld=gold"
78+ "--ld-option=-fuse-ld=gold"
79+ ] else [
72− "--with-ld=${stdenv.cc.bintools.targetPrefix}ld"
80+ "--with-ld=${stdenv.cc.bintools.targetPrefix}ld"
81+ ]
82+ ) ++ [
73− "--with-ar=${stdenv.cc.bintools.targetPrefix}ar"
83+ "--with-ar=${stdenv.cc.bintools.targetPrefix}ar"
74− "--with-strip=${stdenv.cc.bintools.targetPrefix}strip"
84+ "--with-strip=${stdenv.cc.bintools.targetPrefix}strip"
85+ ]
75− ] ++ [ # other flags
86+ ) ++ [ # other flags
76 (if dontStrip then "--disable-executable-stripping" else "--enable-executable-stripping")
87 (if dontStrip then "--disable-executable-stripping" else "--enable-executable-stripping")
77 (if dontStrip then "--disable-library-stripping" else "--enable-library-stripping")
88 (if dontStrip then "--disable-library-stripping" else "--enable-library-stripping")
78 (if enableLibraryProfiling then "--enable-library-profiling" else "--disable-library-profiling" )
89 (if enableLibraryProfiling then "--enable-library-profiling" else "--disable-library-profiling" )