mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 04:43:09 +03:00
impureUseNativeOptimizations: add stdenv adapter
This allows one to force a compiler to use native machine optimizations. This goes contrary to all the usual guarantees of Nix and so should be used only by end-user and only in specific cases when they know what are they doing. In my case this is needed to get a noticeable FPS boost in RPCS3 which is very CPU-hungry PlayStation 3 emulator.
This commit is contained in:
parent
b1b4c6c4eb
commit
15bfee85f3
@ -210,4 +210,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