diff --git a/pkgs/build-support/lib/meson.nix b/pkgs/build-support/lib/meson.nix index 501d4315fdff..76f458cdd9c8 100644 --- a/pkgs/build-support/lib/meson.nix +++ b/pkgs/build-support/lib/meson.nix @@ -27,7 +27,9 @@ let [binaries] llvm-config = 'llvm-config-native' - rust = ['rustc', '--target', '${stdenv.targetPlatform.rust.rustcTargetSpec}'] + rust = ['rustc', '-C', 'target-feature=${ + if stdenv.targetPlatform.isStatic then "+" else "-" + }crt-static', '--target', '${stdenv.targetPlatform.rust.rustcTargetSpec}'] # Meson refuses to consider any CMake binary during cross compilation if it's # not explicitly specified here, in the cross file. # https://github.com/mesonbuild/meson/blob/0ed78cf6fa6d87c0738f67ae43525e661b50a8a2/mesonbuild/cmake/executor.py#L72