Repository navigation
Conversation
This comment has been minimized.
This comment has been minimized.
Member
Contributor
Author
|
No, this PR does not fix #5227. It checks function signatures at compile time and leaves the Windows function pointer address-check skip in place The new checks also expose a FreeBSD kcmp signature mismatch and four WASI pthread prototype mismatchesShould those public Rust parameter-type corrections be included here or handled separately? |
Assign each C symbol to a pointer derived from its Rust declaration before returning its erased address. Preserve variadics, qualifiers, and calling conventions, and correct array declarations in the test fixture. Check getitimer and setitimer separately against their POSIX prototypes, without the GNU enum parameter. Headers: https://github.com/rust-lang/libc/blob/b739c733e06a5f184bae7e296919c15d6ccd8ec8/ctest-test/src/t1.h#L40-L59 https://github.com/bminor/glibc/blob/66f3e9219d8f86b977d9be04ad469b5d72af0da2/time/sys/time.h#L137-L158 Fixes rust-lang#5574.
The restored signature checks expose const pointer mismatches in the two os_unfair_lock assertion functions and an incorrect freadlink return type. Skip these functions until their public bindings can be corrected separately. Headers: https://github.com/apple-oss-distributions/libplatform/blob/2512ffd8bb5c6caff3c8ea83331ab8a0adc820c3/include/os/lock.h#L175-L196 https://github.com/apple-oss-distributions/xnu/blob/f6217f891ac0bb64f3d375211650a4c1ff8ca1ea/bsd/sys/unistd.h#L192
Skip the swapcontext pointer check only on AArch64 glibc. The C header marks it with indirect_return, which affects pointer compatibility but cannot be represented by the Rust declaration. Headers: https://github.com/bminor/glibc/blob/66f3e9219d8f86b977d9be04ad469b5d72af0da2/stdlib/ucontext.h#L41-L43 https://github.com/bminor/glibc/blob/66f3e9219d8f86b977d9be04ad469b5d72af0da2/sysdeps/aarch64/bits/indirect-return.h#L23-L35
Probe the configured C++ compiler before running its signature regressions and skip only when the compiler executable is missing. Other compiler failures and all C signature checks continue to fail normally. Existing C-only CI image: https://github.com/rust-lang/libc/blob/b739c733e06a5f184bae7e296919c15d6ccd8ec8/ci/docker/x86_64-unknown-linux-gnu/Dockerfile#L1-L7
subotac
force-pushed
the
fix/ctest-function-signatures
branch
from
October 11, 2026 18:01
52c7d7f to
caa87d8
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Restore compile-time checks of foreign function signatures before erasing their types for the existing address check. Add C and C++ regressions for argument and return types, variadics, pointer constness, and callbacks.
Correct the array declarations in the test fixture and check glibc timer functions separately against their POSIX prototypes.
Temporarily skip three existing Apple prototype mismatches exposed by these checks.
Also skip glibc's AArch64
swapcontextpointer check because its C-onlyindirect_returnattribute affects function pointer compatibility.Run the C++ compiler regressions when a C++ compiler is available; keep them optional for C-only CI images.
Fixes #5574.
Checklist
ctest/testsandctest/src/tests.rshave been updatedLIBC_BLESS=1 cargo test -p ctest);@rustbot label +stable-nominated