Skip to content

Commit

Permalink
Merge pull request #24692 from LumiGuide/haskell-link-with-gold
Browse files Browse the repository at this point in the history
haskell: add the linkWithGold function to link packages with ld.gold
  • Loading branch information
aristidb authored Apr 8, 2017
2 parents 058610c + c865b8e commit e893646
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkgs/development/haskell-modules/configuration-common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,13 @@ self: super: {
else dontCheck super.fsnotify;

double-conversion = if !pkgs.stdenv.isDarwin
then addExtraLibrary super.double-conversion pkgs.stdenv.cc.cc.lib
then addExtraLibrary
# https://github.com/bos/double-conversion/pull/17
(appendPatch super.double-conversion (pkgs.fetchpatch {
url = "https://github.com/basvandijk/double-conversion/commit/0927e347d53dbd96d1949930e728cc2471dd4b14.patch";
sha256 = "042yqbq5p6nc9nymmbz9hgp51dlc5asaj9bf91kw5fph6dw2hwg9";
}))
pkgs.stdenv.cc.cc.lib
else addExtraLibrary (overrideCabal super.double-conversion (drv:
{
postPatch = ''
Expand Down
3 changes: 3 additions & 0 deletions pkgs/development/haskell-modules/lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ rec {
fixupPhase = ":";
});

linkWithGold = drv : appendConfigureFlag drv
"--ghc-option=-optl-fuse-ld=gold --ld-option=-fuse-ld=gold --with-ld=ld.gold";

# link executables statically against haskell libs to reduce closure size
justStaticExecutables = drv: overrideCabal drv (drv: {
enableSharedExecutables = false;
Expand Down

0 comments on commit e893646

Please sign in to comment.