@@ -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)
70− "--with-gcc=${stdenv.cc.targetPrefix}cc"
70+ [ "--with-gcc=${stdenv.cc.targetPrefix}cc"
71 # BINTOOLS
72 # BINTOOLS
73+ (if stdenv.hostPlatform.isLinux
74+ # use gold as the linker on linux to improve link times
76+ "--with-ld=${stdenv.cc.bintools.targetPrefix}ld.gold"
77+ "--ghc-option=-optl-fuse-ld=gold"
78+ "--ld-option=-fuse-ld=gold"
72− "--with-ld=${stdenv.cc.bintools.targetPrefix}ld"
80+ "--with-ld=${stdenv.cc.bintools.targetPrefix}ld"
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"
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" )