use llvm::LLVMRustHasFeature;
use rustc::session::Session;
use rustc_trans::back::write::create_target_machine;
- use syntax::feature_gate::UnstableFeatures;
use syntax::symbol::Symbol;
use libc::c_char;
"ssse3\0", "tbm\0", "lzcnt\0", "popcnt\0",
"sse4a\0", "rdrnd\0", "rdseed\0", "fma\0"];
+const HEXAGON_WHITELIST: &'static [&'static str] = &["hvx\0", "hvx-double\0"];
+
/// Add `target_feature = "..."` cfgs for a variety of platform
/// specific features (SSE, NEON etc.).
///
let whitelist = match &*sess.target.target.arch {
"arm" => ARM_WHITELIST,
"x86" | "x86_64" => X86_WHITELIST,
+ "hexagon" => HEXAGON_WHITELIST,
_ => &[],
};
}
let requested_features = sess.opts.cg.target_feature.split(',');
- let unstable_options = sess.opts.debugging_opts.unstable_options;
- let is_nightly = UnstableFeatures::from_environment().is_nightly_build();
let found_negative = requested_features.clone().any(|r| r == "-crt-static");
let found_positive = requested_features.clone().any(|r| r == "+crt-static");
found_positive
};
- // If we switched from the default then that's only allowed on nightly, so
- // gate that here.
- if (found_positive || found_negative) && (!is_nightly || !unstable_options) {
- sess.fatal("specifying the `crt-static` target feature is only allowed \
- on the nightly channel with `-Z unstable-options` passed \
- as well");
- }
-
if crt_static {
cfg.insert((tf, Some(Symbol::intern("crt-static"))));
}