Skip to content

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

Merged
tgross35 merged 1 commit into
rust-lang:mainfrom
glaubitz:sparc-clone3-enable
Jul 21, 2026
Merged

Enable clone3() syscall on SPARC which was added in Linux v7.0#4980
tgross35 merged 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.

@glaubitz
glaubitz force-pushed the sparc-clone3-enable branch from c9b00b2 to a96142a Compare June 20, 2026 07:33
@rustbot

This comment has been minimized.

@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$

@glaubitz
glaubitz force-pushed the sparc-clone3-enable branch from a96142a to f88a84e Compare June 24, 2026 13:26
@rustbot

This comment has been minimized.

@glaubitz

Copy link
Copy Markdown
Contributor Author

The version of linux-libc-dev in the Docker container used for sparc64-unknown-linux-gnu is just too old:

#6 7.966 Selecting previously unselected package linux-libc-dev:amd64.
#6 7.967 Preparing to unpack .../076-linux-libc-dev_6.14.0-37.37_amd64.deb ...
#6 7.968 Unpacking linux-libc-dev:amd64 (6.14.0-37.37) ...

It needs to be version 7.0.0 or higher.

@tgross35

Copy link
Copy Markdown
Contributor

Thank you for looking deeper - I still don't mind just adding a test skip so you can be done with this :) But if you prefer, maybe test basing on top of #5175 to see if that resolves it?

@rustbot

This comment has been minimized.

@tgross35

Copy link
Copy Markdown
Contributor

At some point it looks like these got updated. In a recent CI run https://github.com/rust-lang/libc/actions/runs/29835127031/job/88650259315#step:7:669:

#6 19.07 Selecting previously unselected package linux-libc-dev:amd64.
#6 19.07 Preparing to unpack .../076-linux-libc-dev_7.0.0-28.28_amd64.deb ...

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 f88a84e to a616765 Compare July 21, 2026 18:10
@rustbot

rustbot commented Jul 21, 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.

@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Jul 21, 2026

@tgross35 tgross35 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Finally passing CI! Thanks for the persistence.

View changes since this review

@tgross35
tgross35 enabled auto-merge July 21, 2026 18:23
@tgross35
tgross35 added this pull request to the merge queue Jul 21, 2026
Merged via the queue into rust-lang:main with commit 177e0cd Jul 21, 2026
57 checks passed
jollaitbot pushed a commit to sailfishos-mirror/rust-libc that referenced this pull request Jul 22, 2026
Starting with version 7.0, the Linux kernel gained support
for clone3() on SPARC. Thus, it can be enabled in libc now.

(backport <rust-lang/libc#4980>)
(cherry picked from commit 177e0cd0f40126bd4186ddeb1da2c6be595a9fc1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-gnu O-linux O-linux-like O-sparc O-unix S-waiting-on-author 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.

3 participants