}
pub fn crt_static(&self) -> bool {
+ // If the target does not opt in to crt-static support, use its default.
+ if self.target.target.options.crt_static_respected {
+ self.crt_static_feature()
+ } else {
+ self.target.target.options.crt_static_default
+ }
+ }
+
+ pub fn crt_static_feature(&self) -> bool {
let requested_features = self.opts.cg.target_feature.split(',');
let found_negative = requested_features.clone().any(|r| r == "-crt-static");
let found_positive = requested_features.clone().any(|r| r == "+crt-static");
/// Whether or not the CRT is statically linked by default.
pub crt_static_default: bool,
+ /// Whether or not crt-static is respected by the compiler (or is a no-op).
+ pub crt_static_respected: bool,
/// Whether or not stack probes (__rust_probestack) are enabled
pub stack_probes: bool,
panic_strategy: PanicStrategy::Unwind,
abi_blacklist: vec![],
crt_static_default: false,
+ crt_static_respected: false,
stack_probes: false,
}
}
key!(min_atomic_width, Option<u64>);
try!(key!(panic_strategy, PanicStrategy));
key!(crt_static_default, bool);
+ key!(crt_static_respected, bool);
key!(stack_probes, bool);
if let Some(array) = obj.find("abi-blacklist").and_then(Json::as_array) {
target_option_val!(max_atomic_width);
target_option_val!(panic_strategy);
target_option_val!(crt_static_default);
+ target_option_val!(crt_static_respected);
target_option_val!(stack_probes);
if default.abi_blacklist != self.options.abi_blacklist {