-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Implement va_arg for Hexagon Linux musl targets #150008
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
|
cc @folkertdev Tested with #150009 #150010, and this |
Implements proper variadic argument handling for hexagon-unknown-linux-musl targets using a 3-pointer VaList structure compatible with LLVM's HexagonBuiltinVaList implementation. * Handles register save area vs overflow area transition * Provides proper 4-byte and 8-byte alignment for arguments * Only activates for hexagon+musl targets via Arch::Hexagon & Env::Musl
961715a to
0c1612e
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@rustbot reroll |
|
r? folkertdev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On its own this will miscompile, so maybe you can copy the changes from #149967 and just add them to this commit.
| // This includes `target.is_like_darwin`, which on x86_64 targets is like sysv64. | ||
| Arch::X86_64 => emit_x86_64_sysv64_va_arg(bx, addr, target_ty), | ||
| Arch::Xtensa => emit_xtensa_va_arg(bx, addr, target_ty), | ||
| Arch::Hexagon if target.env == Env::Musl => emit_hexagon_va_arg(bx, addr, target_ty), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to make this match exhaustive soon, so could you also add the non-musl HexagonABIInfo::EmitVAArgForHexagon logic? I think that actually manually implements emitVoidPtrVAArg (which we translate as emit_ptr_va_arg in this module) but maybe there is some subtle difference
Implements proper variadic argument handling for hexagon-unknown-linux-musl targets using a 3-pointer VaList structure compatible with LLVM's HexagonBuiltinVaList implementation.