Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b6a79aa63bc6
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cd0c8739d7ef
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Apr 17, 2018

  1. 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.
    abbradar committed Apr 17, 2018

    Verified

    This commit was signed with the committer’s verified signature.
    elseym Simon Waibl
    Copy the full SHA
    15bfee8 View commit details

Commits on Oct 13, 2018

  1. Merge pull request #37600 from abbradar/impureusenative

    impureUseNativeOptimizations: add stdenv adapter
    lukateras authored Oct 13, 2018
    Copy the full SHA
    cd0c873 View commit details
Showing with 15 additions and 0 deletions.
  1. +15 −0 pkgs/stdenv/adapters.nix
15 changes: 15 additions & 0 deletions pkgs/stdenv/adapters.nix
Original file line number Diff line number Diff line change
@@ -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;
});
};
}