Skip to content

Conversation

xingxue-ibm
Copy link
Contributor

@xingxue-ibm xingxue-ibm commented Sep 15, 2025

Description

This continues the PR Add ucontext_t and {get,set,make,swap}context for powerpc64-linux for adding ucontext_t, mcontext_t, and related structures and functions.

Relevant header files:
ucontext_t and mcontext_t - https://github.com/bminor/glibc/blob/a6eb8285d9bfb7ec0875b85ca356e833ff964d4f/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h#L155-L196
pt_regs - https://github.com/torvalds/linux/blob/master/arch/powerpc/include/uapi/asm/ptrace.h
clone_args - https://github.com/torvalds/linux/blob/f83ec76bf285bea5727f478a68b894f5543ca76e/include/uapi/linux/sched.h#L92
{get,set,make,swap}context - https://github.com/bminor/glibc/blob/a6eb8285d9bfb7ec0875b85ca356e833ff964d4f/stdlib/ucontext.h#L34-L52

Closes: #3986

Sources

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

The test failed with the following errors, which do not seem to be related to the changes in this PR.

  error: expected `*` or `+`
     --> /home/xingxue/libc/target/powerpc64le-unknown-linux-gnu/debug/build/libc-test-7e8f2ce60f339395/out/src-hotfix/macros.rs:228:9
      |
  228 |         pub enum $ty_name:ident {
      |         ^^^

  error: expected `*` or `+`
     --> /home/xingxue/libc/target/powerpc64le-unknown-linux-gnu/debug/build/libc-test-7e8f2ce60f339395/out/src-hotfix/macros.rs:229:47
      |
  229 |             $($variant:ident $(= $value:expr)?,)+
      |                                               ^

  error: expected `*` or `+`
     --> /home/xingxue/libc/target/powerpc64le-unknown-linux-gnu/debug/build/libc-test-7e8f2ce60f339395/out/src-hotfix/macros.rs:242:9
      |
  242 |         pub enum $ty_name:ident {
      |         ^^^

  error: expected `*` or `+`
     --> /home/xingxue/libc/target/powerpc64le-unknown-linux-gnu/debug/build/libc-test-7e8f2ce60f339395/out/src-hotfix/macros.rs:243:47
      |
  243 |             $($variant:ident $(= $value:expr)?,)+
      |                                               ^
    ....

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you for getting this over the line!

The error looks like something from the old ctest that we recently replaced, so hopefully it should go away with a rebase.

@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Sep 22, 2025
@tgross35 tgross35 enabled auto-merge September 22, 2025 06:25
@tgross35
Copy link
Contributor

It looks like the new ctest doesn't like type aliases to arrays. You can ignore the type for now in libc-test/build.rs, otherwise I'll try to figure out how to fix things. (Cc @mbyx)

@mbyx
Copy link
Contributor

mbyx commented Sep 22, 2025

According to the docs for skip_roundtrip, aliases to arrays have to manually be skipped. It should be possible to automate that behaviour however. I'll try to make a PR when I have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-gnu O-linux O-powerpc O-unix S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants