mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
Merge pull request #37600 from abbradar/impureusenative
impureUseNativeOptimizations: add stdenv adapter
This commit is contained in:
commit
cd0c8739d7
@ -171,4 +171,19 @@ rec {
|
||||
NIX_CFLAGS_LINK = toString (args.NIX_CFLAGS_LINK or "") + " -fuse-ld=gold";
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/* Modify a stdenv so that it builds binaries optimized specifically
|
||||
for the machine they are built on.
|
||||
|
||||
WARNING: this breaks purity! */
|
||||
impureUseNativeOptimizations = stdenv: stdenv //
|
||||
{ mkDerivation = args: stdenv.mkDerivation (args // {
|
||||
NIX_CFLAGS_COMPILE = toString (args.NIX_CFLAGS_COMPILE or "") + " -march=native";
|
||||
NIX_ENFORCE_NO_NATIVE = false;
|
||||
|
||||
preferLocalBuild = true;
|
||||
allowSubstitutes = false;
|
||||
});
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user