Skip to content

Conversation

asomers
Copy link
Contributor

@asomers asomers commented Sep 7, 2025

Description

Raise the ABI used by libc on FreeBSD to FreeBSD 12, rather than 11. That includes significant changes, such as 64-bit inodes, and support for the riscv64 GENERIC kernel. This is a backport of #2406 .

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

@rustbot
Copy link
Collaborator

rustbot commented Sep 7, 2025

⚠️ Warning ⚠️

  • Pull requests are usually filed against the main branch for this repo, but this one is against libc-0.2. Please double check that you specified the right target!

12
} else {
11
12
Copy link
Member

Choose a reason for hiding this comment

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

This makes the last two branches of the if identical, which is causing it to fail checks in CI.

@joshtriplett
Copy link
Member

Given that std and rustc no longer support FreeBSD 11, this seems fine to merge, as soon as it passes CI.

@joshtriplett
Copy link
Member

joshtriplett commented Sep 15, 2025

#4695 fixes some of the CI issues.

@tgross35 tgross35 changed the title Raise libc's FreeBSD ABI to 12 [0.2] Raise libc's FreeBSD ABI to 12 Sep 19, 2025
@Gelbpunkt
Copy link
Contributor

Given that std and rustc no longer support FreeBSD 11

std support was dropped in 1.75 AFAICT, this crate still targets 1.63 as the MSRV so there are still compiler versions supported by libc that technically have FreeBSD 11 support.

@jrtc27
Copy link

jrtc27 commented Sep 22, 2025

What exactly is holding this up? It's frustrating not to be able to land this backport because of pre-existing CI issues, which is what it sounds like is the case? This continues to block rust on FreeBSD/riscv64, and at the moment it's unclear (a) what the actual requirements are before this can be merged (b) whether those are being actively worked on (c) on what timeline it is expected those will be resolved. Could you please provide a clear statement so we know where we stand rather than waiting and hoping for something to happen at some unknown point in the future?

@tgross35
Copy link
Contributor

The Linux CI issues only appeared within the past couple of weeks due to the Ubuntu LTS cycle, and has since been fixed on both branches. The FreeBSD CI has never been blocking and FreeBSD 15 specifically was broken for a while, but given we just got the patches to fix it, it seemed worthwhile waiting for those to come in before landing more major FreeBSD changes. No urgency was ever noted here, but it's only been a few weeks anyway.

I understand this looks unclear on the outside, but I've been in touch with Josh on Zulip and with Alan on the various FreeBSD PRs. Also the backport PRs landing to libc-0.2 have passing CI.

@jrtc27
Copy link

jrtc27 commented Sep 23, 2025

For the full context:

This has been a longstanding issue with Rust on FreeBSD/riscv64 (see rust-lang/rust#92466), and there has been increasing pressure from users and developers to support it. I, as one of the people who has been responsible for maintaining the architecture port over the years in FreeBSD, have tried to push for fixing rust rather than adding dodgy workarounds in FreeBSD, but with FreeBSD 15.0 being due out later this year there's been a renewed desire to get it working one way or another rather than blocking the increasing number of bits of third-party software that transitively depend on Rust. We thought it had been fixed a year ago when the commit this PR backports was landed, but that turned out not to be the case after those who care about Rust on FreeBSD/riscv64 finally reported that it was still broken (having not done so earlier because they were not aware that we believed it was meant to be fixed already and so figured there was no point saying it was unchanged). So if possible we would really like to be able to demonstrate, prior to the release of 15.0, that Rust works on unmodified FreeBSD/riscv64, as otherwise there is a chance that I will be forced to concede to hacking the kernel to allow the use of an ABI that predates the existence of the architecture within FreeBSD.

With regards to your message, does that mean that you think all the necessary FreeBSD bits have landed now, or are there still ones outstanding? If the former, does this just need rebasing to rerun CI with the fixes? If the latter, what specifically are we waiting on, please? I don't see a huge amount of context on Zulip in https://rust-lang.zulipchat.com/#narrow/channel/351149-t-libs.2Fcrates/topic/FreeBSD.20and.20libc/with/540227460 if that's where you're referring to, but perhaps you mean elsewhere.

asomers and others added 2 commits September 23, 2025 02:32
FreeBSD 11 was EoL on 30-Sept-2021.  Update libc's ABI to 12.  That
version includes significant changes, such as 64-bit inodes.

(backport <rust-lang#2406>)
(cherry picked from commit 4bafe6b)
@tgross35 tgross35 added this pull request to the merge queue Sep 23, 2025
@tgross35
Copy link
Contributor

The remaining cherry picks have now landed, so it indeed just needed the rebase.

I think RISC-V support unfortunately got needlessly tangled up with bumping the minimum: IMO we could have taken a PR at any time bumping the minimum specifically for that arch, getting a new platform running at all is completely orthogonal to nudging the entire ecosystem for already-supported targets. #2406 didn't get backported immediately because there were talks about a blog post to give the ecosystem a heads up, and Alan's last message only mentioned merging to main. Plus some volatility around rust-lang/rust#89058.

In any case thanks for the context, I wasn't aware of the status and RISC-V relationship here. If anything less than trivial is needed to support the arch, please do bring it up on Zulip so we can make sure things keep moving forward.

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 23, 2025
@tgross35 tgross35 added this pull request to the merge queue Sep 23, 2025
@tgross35
Copy link
Contributor

As a note, riscv64gc-unknown-freebsd doesn't have a listed target maintainer at https://doc.rust-lang.org/beta/rustc/platform-support.html. https://github.com/rust-lang/rust/blob/f6092f224d2b1774b31033f12d0bee626943b02f/src/doc/rustc/src/platform-support.md should probably be updated to point to the same file as other FreeBSD targets. If interested, you can also list yourself as a maintainer in freebsd.md (optionally specific to RISC-V) so others know to ping you for platform-specific topics.

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 23, 2025
@tgross35 tgross35 added this pull request to the merge queue Sep 23, 2025
Merged via the queue into rust-lang:libc-0.2 with commit ffa9170 Sep 23, 2025
50 checks passed
@tgross35
Copy link
Contributor

Released in 0.2.176 https://github.com/rust-lang/libc/releases/tag/0.2.176

@cperciva
Copy link

Thanks everyone for getting this landed!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants