Skip to content

Conversation

@he32
Copy link
Contributor

@he32 he32 commented Dec 19, 2025

Description

These are changes which appear to be required to get this file to build (and cross-build) again.
Admittedly, some of the additions are based on error messages emitted by the rustc compiler.

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

@he32 he32 marked this pull request as draft December 19, 2025 18:44
@he32 he32 marked this pull request as ready for review December 19, 2025 23:00
wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request Dec 19, 2025
...to something which also passes the upstream automated checks.
Pull request submitted at
  rust-lang/libc#4886
@he32 he32 marked this pull request as draft December 26, 2025 10:57
he32 added 2 commits December 26, 2025 23:34
...and let each machine definition implement their own of the latter,
instead of c_uchar which is inconsistent with the C implementation.

This allows us to fix the errors from

    $ cd libc-test; cargo test
    ...
    bad `pthread_spin_t` size: rust: 1 != c 4
    bad `pthread_spin_t` align: rust: 1 != c 4
    bad `__cpu_simple_lock_nv_t` signed: rust: 1 != c 0
    size of `pthread_spin_t` is 4 in C and 1 in Rust
 * Use the same type names as used by the native libc, to allow
   more self-tests to succeed
 * Eliminate use of s! and s_no_extra_traits!
 * Move type definitions up before their use
 * Remove un-needed imports, uncovered by libc's "cargo test"
 * Hardwire _ALIGNBYTES to what't it's in C instead of a dynamic
   erroneous define.  THis now makes all the libc self-tests succeed.
@he32 he32 marked this pull request as ready for review December 26, 2025 23:59
@he32
Copy link
Contributor Author

he32 commented Dec 27, 2025

Not sure how those two failing CI jobs can be related to my proposed changes...

@rustbot
Copy link
Collaborator

rustbot commented Dec 28, 2025

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.

he32 added a commit to he32/libc that referenced this pull request Dec 29, 2025
…finition.

This is already part of pull request
  rust-lang#4886
which is yet to be applied.
@he32
Copy link
Contributor Author

he32 commented Dec 29, 2025

Not sure how those two failing CI jobs can be related to my proposed changes...

Evidently caused by what I had not done (merged upstream 'main' branch into mine).

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.

2 participants