-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Added ucontext_t for powerpc64-linux #3986
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: mgiessing <[email protected]>
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @JohnTitor (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
Related to #3964 |
I see there is an issue with the PR in regards to the usage of of c_double/float64. error[E0277]: the trait bound `f64: core::cmp::Eq` is not satisfied
--> src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs:43:9
|
43 | pub fp_regs: [::c_double; 33], // # define __NFPREG 33
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `core::cmp::Eq` is not implemented for `f64`, which is required by `[f64; 33]: core::cmp::Eq`
|
= help: the following other types implement trait `core::cmp::Eq`:
i128
i16
i32
i64
i8
isize
u128
u16
and 4 others
= note: required for `[f64; 33]` to implement `core::cmp::Eq`
note: required by a bound in `AssertParamIsEq`
--> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/cmp.rs:359:1
= note: this error originates in the derive macro `Eq` which comes from the expansion of the macro `s` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `f64: Hash` is not satisfied
--> src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs:43:9
|
43 | pub fp_regs: [::c_double; 33], // # define __NFPREG 33
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Hash` is not implemented for `f64`, which is required by `[f64; 33]: Hash`
|
= help: the following other types implement trait `Hash`:
i128
i16
i32
i64
i8
isize
u128
u16
and 4 others
= note: required for `[f64; 33]` to implement `Hash`
= note: this error originates in the derive macro `Hash` which comes from the expansion of the macro `s` (in Nightly builds, run with -Z macro-backtrace for more info) @JohnTitor Would you know what I need to change to make this pass? I tried to adapt based on the aarch64, loongarch64 & riscv64 version with the help of the powerpc64 glibc ucontext header file but apparently something's going wrong! Any help is appreciated! |
…warnings Signed-off-by: mgiessing <[email protected]>
Signed-off-by: mgiessing <[email protected]>
Signed-off-by: mgiessing <[email protected]>
@rustbot label stable-nominated |
I think this looks fine, but could you please add links to the relevant headers in the PR description? |
@rustbot author (just comment |
@tgross35 Thanks for looking into this! I updated the PR description with the relevant header files. |
pub gp_regs: [::c_ulong; 48], // # define __NGREG 48 | ||
pub fp_regs: [::c_double; 33], // # define __NFPREG 33 | ||
pub v_regs: *mut vrregset_t, | ||
pub vmx_reserve: [::c_long; 69], // # define __NVRREG 34 (34*2+1) |
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.
Jut to be consistent, could you duplicate the C types?
const _NGREG: usize = 48;
const __NFPREG: usize = 33;
const __NVRREG: usize = 34;
type gregset_t = [::c_ulong; __NGREG];
type fpregset_t = [::c_double; __NFPREG];
// in the struct
pub vmx_reserve: [::c_long; __NVRREG + __NVRREG + 1],
} | ||
|
||
#[allow(missing_debug_implementations)] | ||
pub struct pt_regs { |
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.
Which pt_regs
does this use? It doesn't look like the generic one at https://github.com/torvalds/linux/blob/f43b15692129904ccc064180fa2dd796ba3843a5/arch/arc/include/asm/ptrace.h#L65C3-L65C15
☔ The latest upstream changes (presumably #4070) made this pull request unmergeable. Please resolve the merge conflicts. |
@mgiessing this will need a rebase since the |
I'm currently not having access to my laptop so the earliest I can work again on this will be mid of December, more probably beginning of next year :-) |
No worries! I'll mark this as a draft. Any chance you know the answer to https://github.com/rust-lang/libc/pull/3986/files#r1831808892? If so, maybe somebody could pick this up to finish it. |
Description
This PR will add
ucontext_t
to powerpc64le-unknown-linux-gnu.The relevant header files this is linked to can be found here: https://github.com/bminor/glibc/blob/master/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h and for
ucontext_t
specifically here: https://github.com/bminor/glibc/blob/master/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h#L155-L196Sources
Checklist
libc-test/semver
have been updated*LAST
or*MAX
areincluded (see #3131)
cd libc-test && cargo test --target mytarget
);especially relevant for platforms that may not be checked in CI
Testing throws an error, but that is not related to this PR as far as I can see. Even without the patch I see an error in the main branch