Skip to content

Conversation

mbyx
Copy link
Contributor

@mbyx mbyx commented Aug 22, 2025

Description

Attempts to fix errors in freebsd i686 by making sure that the correct build target is used when expanding macros.

Sources

https://cgit.freebsd.org/src/tree/sys/x86/include/reg.h?h=releng/13.1

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

@mbyx mbyx force-pushed the libc-fix-reg32 branch 3 times, most recently from 0ba05c1 to 27fc39f Compare August 24, 2025 10:36
@mbyx
Copy link
Contributor Author

mbyx commented Aug 24, 2025

There's only one reg32 struct in libc, and it should only be included if the target is 64 bit, but it fails on i686 which is a 32 bit platform. Looking at the .cirrus.yml file, I found the evidence: # Test i686 FreeBSD in 32-bit emulation on a 64-bit host.

What's happening is that libc is being expanded as if it was 64 bit, causing this problem.

I'm not sure but we might be able to fix this if we pass in the correct target when expanding macros?

@rustbot rustbot added the ctest Issues relating to the ctest crate label Aug 24, 2025
@mbyx
Copy link
Contributor Author

mbyx commented Aug 24, 2025

It worked! (FreeBSD 13 still likes to segfault, we might have to rerun multiple times, but it does work now)

@mbyx mbyx marked this pull request as ready for review August 24, 2025 10:57
@mbyx mbyx mentioned this pull request Aug 24, 2025
8 tasks
@mbyx mbyx force-pushed the libc-fix-reg32 branch 2 times, most recently from dce6e3c to f5b4cfd Compare August 28, 2025 09:46
This also fixes missing `reg32` struct bugs on 32-bit FreeBSD.
@mbyx mbyx requested a review from tgross35 August 28, 2025 09:53
@mbyx mbyx mentioned this pull request Aug 29, 2025
1 task
@mbyx mbyx closed this Aug 29, 2025
@mbyx mbyx reopened this Aug 29, 2025
@tgross35 tgross35 added this pull request to the merge queue Aug 30, 2025
Merged via the queue into rust-lang:main with commit 15af827 Aug 30, 2025
75 of 100 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ctest Issues relating to the ctest crate O-unix O-x86 S-waiting-on-author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants