nearcore: switch to fat lto

This commit is contained in:
Jörg Thalheim 2022-05-11 15:47:03 +02:00
parent bd41737ab4
commit 8d2b8d0da3
No known key found for this signature in database

View File

@ -23,7 +23,7 @@ rustPlatform.buildRustPackage rec {
''; '';
CARGO_PROFILE_RELEASE_CODEGEN_UNITS = "1"; CARGO_PROFILE_RELEASE_CODEGEN_UNITS = "1";
CARGO_PROFILE_RELEASE_LTO = "thin"; CARGO_PROFILE_RELEASE_LTO = "fat";
NEAR_RELEASE_BUILD = "release"; NEAR_RELEASE_BUILD = "release";
OPENSSL_NO_VENDOR = 1; # we want to link to OpenSSL provided by Nix OPENSSL_NO_VENDOR = 1; # we want to link to OpenSSL provided by Nix
@ -42,6 +42,9 @@ rustPlatform.buildRustPackage rec {
protobuf protobuf
]; ];
# fat LTO requires ~3.4GB RAM
requiredSystemFeatures = [ "big-parallel" ];
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
BINDGEN_EXTRA_CLANG_ARGS = "-isystem ${llvmPackages.libclang.lib}/lib/clang/${lib.getVersion llvmPackages.clang}/include"; BINDGEN_EXTRA_CLANG_ARGS = "-isystem ${llvmPackages.libclang.lib}/lib/clang/${lib.getVersion llvmPackages.clang}/include";