Skip to content

Enable clone3() syscall on SPARC which was added in Linux v7.0#4980

Open
glaubitz wants to merge 1 commit into
rust-lang:mainfrom
glaubitz:sparc-clone3-enable
Open

Enable clone3() syscall on SPARC which was added in Linux v7.0#4980
glaubitz wants to merge 1 commit into
rust-lang:mainfrom
glaubitz:sparc-clone3-enable

Conversation

@glaubitz

Copy link
Copy Markdown
Contributor

clone3() has been added for SPARC in Linux v7.0, thus enable it.

@rustbot

This comment has been minimized.

@tgross35

Copy link
Copy Markdown
Contributor

Deleting the comments in src/ is fine, but we of course can't unskip the tests until things pass. Could you just update that comment to mention the kernel version?

Also, do you have a link to the relevant source?

@glaubitz

Copy link
Copy Markdown
Contributor Author

Deleting the comments in src/ is fine, but we of course can't unskip the tests until things pass. Could you just update that comment to mention the kernel version?

Ah, I wasn't aware that the tests are run against the kernel headers.

So, I guess I will wait with the PR until the build environment for the CI is recent enough. I don't think it makes much sense to just remove the comments for now.

Also, do you have a link to the relevant source?

The commit to add clone3() for SPARC is this one: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/sparc?id=2153b2e8917b73e9e7fae8963f03b8e60bd8f5ff

It requires an additional fix to land first: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/sparc?id=e38eba3b77878ada327a572a41596a3b0b44e522

@tgross35

Copy link
Copy Markdown
Contributor

In that case,

@rustbot blocked

Should be able to update once https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md bumps the kernel version, or probably once the 26.04 images are out.

@glaubitz

glaubitz commented May 1, 2026

Copy link
Copy Markdown
Contributor Author

Linux kernel v7.0 was released last week, so we might be able to merge this once Rust's CI has been updated to use the latest Linux kernel sources.

@rustbot

This comment has been minimized.

@glaubitz glaubitz force-pushed the sparc-clone3-enable branch from b44535f to c9b00b2 Compare June 15, 2026 17:57
@rustbot

This comment has been minimized.

@tgross35

Copy link
Copy Markdown
Contributor

This should work after #5177

@tgross35

Copy link
Copy Markdown
Contributor

@rustbot author

I think if you rebase, the tests should pass

@rustbot

rustbot commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

Starting with version 7.0, the Linux kernel gained support
for clone3() on SPARC. Thus, it can be enabled in libc now.
@glaubitz glaubitz force-pushed the sparc-clone3-enable branch from c9b00b2 to a96142a Compare June 20, 2026 07:33
@rustbot

rustbot commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

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.

@glaubitz

Copy link
Copy Markdown
Contributor Author

I think if you rebase, the tests should pass

Rebased and force-pushed.

@glaubitz

Copy link
Copy Markdown
Contributor Author

Not sure why it fails on the CI, it works for me locally on a sparc64-linux host:

(sid_sparc64-dchroot)glaubitz@stadler:~/libc$ uname -a
Linux stadler 7.1.0-rc1+ #2 SMP Sun May  3 07:56:50 UTC 2026 sparc64 GNU/Linux
(sid_sparc64-dchroot)glaubitz@stadler:~/libc$ git branch
  master
* sparc-clone3-enable
(sid_sparc64-dchroot)glaubitz@stadler:~/libc$ cargo build
   Compiling libc v1.0.0-alpha.3 (/home/glaubitz/libc)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 12.08s
(sid_sparc64-dchroot)glaubitz@stadler:~/libc$ cargo test
   Compiling libc v1.0.0-alpha.3 (/home/glaubitz/libc)
    Finished `test` profile [unoptimized + debuginfo] target(s) in 10.53s
     Running unittests src/lib.rs (target/debug/deps/libc-c55ff6801c333c33)

running 6 tests
test macros::tests::c_enum_basic ... ok
test macros::tests::c_enum_multiple_set_value ... ok
test macros::tests::c_enum_set_value ... ok
test macros::tests::c_enum_repr ... ok
test macros::tests::c_enum_vis ... ok
test macros::tests::test_offset_of ... ok

test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests/const_fn.rs (target/debug/deps/const_fn-43ca8a932c87d555)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests libc

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

(sid_sparc64-dchroot)glaubitz@stadler:~/libc$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants