custom VaList layout for Hexagon
This commit is contained in:
parent
ce63e5d9ea
commit
023f38fe73
1 changed files with 20 additions and 0 deletions
|
|
@ -31,6 +31,9 @@ use crate::marker::PhantomCovariantLifetime;
|
|||
// the pointer decay behavior in Rust, while otherwise matching Rust semantics.
|
||||
// This attribute ensures that the compiler uses the correct ABI for functions
|
||||
// like `extern "C" fn takes_va_list(va: VaList<'_>)` by passing `va` indirectly.
|
||||
//
|
||||
// The Clang `BuiltinVaListKind` enumerates the `va_list` variations that Clang supports,
|
||||
// and we mirror these here.
|
||||
crate::cfg_select! {
|
||||
all(
|
||||
target_arch = "aarch64",
|
||||
|
|
@ -124,6 +127,23 @@ crate::cfg_select! {
|
|||
}
|
||||
}
|
||||
|
||||
all(target_arch = "hexagon", target_env = "musl") => {
|
||||
/// Hexagon Musl implementation of a `va_list`.
|
||||
///
|
||||
/// See the [LLVM source] for more details. On bare metal Hexagon uses an opaque pointer.
|
||||
///
|
||||
/// [LLVM source]:
|
||||
/// https://github.com/llvm/llvm-project/blob/0cdc1b6dd4a870fc41d4b15ad97e0001882aba58/clang/lib/CodeGen/Targets/Hexagon.cpp#L407-L417
|
||||
#[repr(C)]
|
||||
#[derive(Debug)]
|
||||
#[rustc_pass_indirectly_in_non_rustic_abis]
|
||||
struct VaListInner {
|
||||
__current_saved_reg_area_pointer: *const c_void,
|
||||
__saved_reg_area_end_pointer: *const c_void,
|
||||
__overflow_area_pointer: *const c_void,
|
||||
}
|
||||
}
|
||||
|
||||
// The fallback implementation, used for:
|
||||
//
|
||||
// - apple aarch64 (see https://github.com/rust-lang/rust/pull/56599)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue