about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src/back
diff options
context:
space:
mode:
authorArtyom Tetyukhin <51746822+arttet@users.noreply.github.com>2023-11-15 14:55:18 +0400
committerArtyom Tetyukhin <51746822+arttet@users.noreply.github.com>2023-11-15 14:55:18 +0400
commitf5e349219405c3c49f7449f29524d8a77bc4d768 (patch)
tree77984e45a334aeb07b8cba865cc2e1a2ecbec835 /compiler/rustc_codegen_ssa/src/back
parent698fcc8219e6dd690b148a23af10a0e5747621fe (diff)
downloadrust-f5e349219405c3c49f7449f29524d8a77bc4d768.tar.gz
rust-f5e349219405c3c49f7449f29524d8a77bc4d768.zip
Add arm64e-apple-ios target
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/back')
-rw-r--r--compiler/rustc_codegen_ssa/src/back/metadata.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/metadata.rs b/compiler/rustc_codegen_ssa/src/back/metadata.rs
index cb60ed729c1..d716774690a 100644
--- a/compiler/rustc_codegen_ssa/src/back/metadata.rs
+++ b/compiler/rustc_codegen_ssa/src/back/metadata.rs
@@ -226,6 +226,10 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static
 
     let mut file = write::Object::new(binary_format, architecture, endianness);
     if sess.target.is_like_osx {
+        if macho_is_arm64e(&sess.target) {
+            file.set_macho_cpu_subtype(object::macho::CPU_SUBTYPE_ARM64E);
+        }
+
         file.set_macho_build_version(macho_object_build_version_for_target(&sess.target))
     }
     if binary_format == BinaryFormat::Coff {
@@ -385,6 +389,11 @@ fn macho_object_build_version_for_target(target: &Target) -> object::write::Mach
     build_version
 }
 
+/// Is Apple's CPU subtype `arm64e`s
+fn macho_is_arm64e(target: &Target) -> bool {
+    return target.llvm_target.starts_with("arm64e");
+}
+
 pub enum MetadataPosition {
     First,
     Last,