-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #2591 - semarie:openbsd-archs, r=Amanieu
add more archs definition for openbsd it adds libc definitions for more archs for openbsd: arm, mips64, powerpc, powerpc64, and riscv64. it is a first iteration on adding support for at least some of them in rustc. I manually created them from OpenBSD source code and from clang crosscompilation output to determine type size and constants values.
- Loading branch information
Showing
6 changed files
with
94 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
pub type c_long = i32; | ||
pub type c_ulong = u32; | ||
pub type c_char = u8; | ||
|
||
// should be pub(crate), but that requires Rust 1.18.0 | ||
cfg_if! { | ||
if #[cfg(libc_const_size_of)] { | ||
#[doc(hidden)] | ||
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_double>() - 1; | ||
} else { | ||
#[doc(hidden)] | ||
pub const _ALIGNBYTES: usize = 8 - 1; | ||
} | ||
} | ||
|
||
pub const _MAX_PAGE_SHIFT: u32 = 12; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
pub type c_long = i64; | ||
pub type c_ulong = u64; | ||
pub type c_char = i8; | ||
|
||
#[doc(hidden)] | ||
pub const _ALIGNBYTES: usize = 7; | ||
|
||
pub const _MAX_PAGE_SHIFT: u32 = 14; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
pub type c_long = i32; | ||
pub type c_ulong = u32; | ||
pub type c_char = u8; | ||
|
||
// should be pub(crate), but that requires Rust 1.18.0 | ||
cfg_if! { | ||
if #[cfg(libc_const_size_of)] { | ||
#[doc(hidden)] | ||
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_double>() - 1; | ||
} else { | ||
#[doc(hidden)] | ||
pub const _ALIGNBYTES: usize = 8 - 1; | ||
} | ||
} | ||
|
||
pub const _MAX_PAGE_SHIFT: u32 = 12; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
pub type c_long = i64; | ||
pub type c_ulong = u64; | ||
pub type c_char = u8; | ||
|
||
// should be pub(crate), but that requires Rust 1.18.0 | ||
cfg_if! { | ||
if #[cfg(libc_const_size_of)] { | ||
#[doc(hidden)] | ||
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1; | ||
} else { | ||
#[doc(hidden)] | ||
pub const _ALIGNBYTES: usize = 8 - 1; | ||
} | ||
} | ||
|
||
pub const _MAX_PAGE_SHIFT: u32 = 12; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
pub type c_long = i64; | ||
pub type c_ulong = u64; | ||
pub type c_char = u8; | ||
|
||
// should be pub(crate), but that requires Rust 1.18.0 | ||
cfg_if! { | ||
if #[cfg(libc_const_size_of)] { | ||
#[doc(hidden)] | ||
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1; | ||
} else { | ||
#[doc(hidden)] | ||
pub const _ALIGNBYTES: usize = 8 - 1; | ||
} | ||
} | ||
|
||
pub const _MAX_PAGE_SHIFT: u32 = 12; |