c-variadic: fix for sparc64#155660
Conversation
|
|
There was a problem hiding this comment.
Thanks for adding the docs. This makes sense to me, but similar to #152576 (and others) it would be good to have a regression test. Can probably just be based on top of that PR to reuse the test case.
41edc54 to
7970597
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. |
| pub const unsafe fn va_arg<T: VaArgSafe>(ap: &mut VaList<'_>) -> T; | ||
|
|
||
| #[unsafe(no_mangle)] | ||
| unsafe extern "C" fn read_f64(ap: &mut VaList<'_>) -> f64 { |
There was a problem hiding this comment.
I verified this with https://godbolt.org/z/qrM37rY6n and we match it exactly.
Interestingly using LLVM IR directly will miscompile va_arg.
Rollup of 7 pull requests Successful merges: - #155660 (c-variadic: fix for sparc64) - #153482 (tests/ui/macros: add annotations for reference rules) - #155075 (Add docs about SDKs and C compilation on armv7a-vex-v5) - #155685 (Fix `get_child_at_index` return type hints) - #155686 (Fix array template arg lookup behavior) - #155689 (Const initialize `LOCK_LATCH` thread local) - #155690 (Fix classify_union to return Union for regular unions)
Rollup merge of #155660 - folkertdev:sparc64-c-variadic, r=tgross35 c-variadic: fix for sparc64 tracking issue: #44930 Turns out it's a big-endian target that right-adjusts values in the stack slots. Apparently these tests do get run occasionally, though i don't think test failures are usually turned into issues on this repo. I guess we could add an assembly test here too, though really you just have to run these tests. I've tried this locally with qemu, and it passes all c-variadic tests. cc @thejpster @glaubitz r? tgross35
Rollup of 7 pull requests Successful merges: - rust-lang/rust#155660 (c-variadic: fix for sparc64) - rust-lang/rust#153482 (tests/ui/macros: add annotations for reference rules) - rust-lang/rust#155075 (Add docs about SDKs and C compilation on armv7a-vex-v5) - rust-lang/rust#155685 (Fix `get_child_at_index` return type hints) - rust-lang/rust#155686 (Fix array template arg lookup behavior) - rust-lang/rust#155689 (Const initialize `LOCK_LATCH` thread local) - rust-lang/rust#155690 (Fix classify_union to return Union for regular unions)
tracking issue: #44930
Turns out it's a big-endian target that right-adjusts values in the stack slots.
Apparently these tests do get run occasionally, though i don't think test failures are usually turned into issues on this repo. I guess we could add an assembly test here too, though really you just have to run these tests. I've tried this locally with qemu, and it passes all c-variadic tests.
cc @thejpster @glaubitz
r? tgross35