mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 04:43:09 +03: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";
|
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