mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
build-support/meson: set crt-static for rustc
Just like we do in the Cargo setup hook, to have musl/static builds work properly we need to explicitly set whether we want static builds or not. Rust's built-in target definitions are inconsistent — some musl architectures default to static, and others don't. Unfortunately it doesn't seem to be valid to break this list onto multiple lines.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user