Implement the instruction_set attribute

This commit is contained in:
xd009642 2020-10-08 23:23:27 +01:00
parent 4437b4b150
commit a6e2b636e6
22 changed files with 247 additions and 4 deletions

View file

@ -20,6 +20,7 @@ pub fn target() -> TargetResult {
max_atomic_width: Some(32),
unsupported_abis: super::arm_base::unsupported_abis(),
target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
has_thumb_interworking: true,
..base
},
})

View file

@ -20,6 +20,7 @@ pub fn target() -> TargetResult {
max_atomic_width: Some(32),
unsupported_abis: super::arm_base::unsupported_abis(),
target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
has_thumb_interworking: true,
..base
},
})

View file

@ -23,6 +23,7 @@ pub fn target() -> TargetResult {
max_atomic_width: Some(32),
unsupported_abis: super::arm_base::unsupported_abis(),
target_mcount: "\u{1}mcount".to_string(),
has_thumb_interworking: true,
..base
},
})

View file

@ -994,6 +994,10 @@ pub struct TargetOptions {
/// used to locate unwinding information is passed
/// (only has effect if the linker is `ld`-like).
pub eh_frame_header: bool,
/// Is true if the target is an ARM architecture using thumb v1 which allows for
/// thumb and arm interworking.
pub has_thumb_interworking: bool,
}
impl Default for TargetOptions {
@ -1086,6 +1090,7 @@ impl Default for TargetOptions {
llvm_args: vec![],
use_ctors_section: false,
eh_frame_header: true,
has_thumb_interworking: false,
}
}
}
@ -1479,6 +1484,7 @@ impl Target {
key!(llvm_args, list);
key!(use_ctors_section, bool);
key!(eh_frame_header, bool);
key!(has_thumb_interworking, bool);
// NB: The old name is deprecated, but support for it is retained for
// compatibility.
@ -1717,6 +1723,7 @@ impl ToJson for Target {
target_option_val!(llvm_args);
target_option_val!(use_ctors_section);
target_option_val!(eh_frame_header);
target_option_val!(has_thumb_interworking);
if default.unsupported_abis != self.options.unsupported_abis {
d.insert(

View file

@ -55,6 +55,7 @@ pub fn target() -> TargetResult {
// don't have atomic compare-and-swap
atomic_cas: false,
has_thumb_interworking: true,
..super::thumb_base::opts()
},