-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ pkgs ? import <nixpkgs> { } | ||
, extraPkgs ? [ ] | ||
}: | ||
let | ||
# Target the LLVM version that rustc is built with for LTO. | ||
llvmPackages0 = pkgs.rustc.llvmPackages; | ||
|
||
# Force the use of lld and other llvm tools for LTO | ||
llvmPackages = llvmPackages0.override { | ||
bootBintoolsNoLibc = null; | ||
bootBintools = null; | ||
}; | ||
|
||
# LTO requires LLVM bintools including ld.lld and llvm-ar. | ||
buildStdenv = pkgs.overrideCC llvmPackages.stdenv (llvmPackages.stdenv.cc.override { | ||
bintools = pkgs.buildPackages.rustc.llvmPackages.bintools; | ||
}); | ||
in | ||
# Disclaimer: This currently also requies nix-ld (https://github.com/Mic92/nix-ld) to run binaries provided by mozilla. | ||
buildStdenv.mkDerivation { | ||
name = "env"; | ||
nativeBuildInputs = [ | ||
pkgs.bashInteractive | ||
pkgs.mercurial | ||
pkgs.rustc | ||
pkgs.cargo | ||
pkgs.unzip | ||
pkgs.m4 | ||
pkgs.pkg-config | ||
] ++ pkgs.lib.optional (!pkgs.stdenv.isDarwin) pkgs.libnotify | ||
++ extraPkgs; | ||
} |