Use 16K code pages on Mac M1

Fixes #3278.
This commit is contained in:
Benjamin Bouvier
2021-09-01 16:59:12 +02:00
parent f871e8cf8f
commit fb94b81538
2 changed files with 22 additions and 5 deletions

View File

@@ -314,6 +314,21 @@ pub trait TargetIsa: fmt::Display + Send + Sync {
}
}
/// Returns the code (text) section alignment for this ISA.
fn code_section_alignment(&self) -> u64 {
use target_lexicon::*;
match (self.triple().operating_system, self.triple().architecture) {
(
OperatingSystem::MacOSX { .. }
| OperatingSystem::Darwin
| OperatingSystem::Ios
| OperatingSystem::Tvos,
Architecture::Aarch64(..),
) => 0x4000,
_ => 0x1000,
}
}
/// Get the pointer type of this ISA.
fn pointer_type(&self) -> ir::Type {
ir::Type::int(u16::from(self.pointer_bits())).unwrap()