We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ba5cca2 commit e92f433Copy full SHA for e92f433
src/cargo/core/compiler/build_context/target_info.rs
@@ -403,7 +403,16 @@ fn env_args(
403
// This is probably a build script or plugin and we're
404
// compiling with --target. In this scenario there are
405
// no rustflags we can apply.
406
- return Ok(Vec::new());
+ // However, musl host need this rustflags to compile
407
+ // plugin dynamically.
408
+ if cfg!(target_env = "musl") {
409
+ let mut rustflags = Vec::new();
410
+ rustflags.push("-C".into());
411
+ rustflags.push("target-feature=-crt-static".into());
412
+ return Ok(rustflags);
413
+ } else {
414
+ return Ok(Vec::new());
415
+ }
416
}
417
418
// First try RUSTFLAGS from the environment
0 commit comments