Skip to content

XCode 14 and older rustup installed rustc versions are incompatible #105167

Closed

Description

@mitsuhiko

With the update to xcode 14 older rustc versions installed from rustup are failing with an error that looks like this:

  = note: ld: in /Users/mitsuhiko/.rustup/toolchains/1.51.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libpanic_unwind-68aa428439efc3d3.rlib(lib.rmeta),
   archive member 'lib.rmeta' with length 33472 is not mach-o or llvm bitcode file
  '/Users/mitsuhiko/.rustup/toolchains/1.51.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libpanic_unwind-68aa428439efc3d3.rlib' for architecture arm64

From testing 1.54.0 and 1.56.0 and latest is fine, 1.51 and 1.53 are not.

Meta

rustc --version --verbose:

rustc 1.51.0 (2fd73fabe 2021-03-23)
binary: rustc
commit-hash: 2fd73fabe469357a12c2c974c140f67e7cdd76d0
commit-date: 2021-03-23
host: aarch64-apple-darwin
release: 1.51.0
LLVM version: 11.0.1

I believe this is related to #103044.

Since those are rather old Rust versions I assume there is not a lot of reason to do something about it, but I figured I report it because I wasn't sure if this was supposed to happen and maybe someone else will also stumble upon it. I noticed it because I had an override set to my MSRV on a library.

Activity

  1. ehuss commented on Dec 2, 2022

    @ehuss
    Contributor

    I believe this is a known issue. It was fixed by #84449. I think the only workaround is to use an older xcode, or to use another linker. Rumors are that mold doesn't complain, though that might just be by luck.

  2. bjorn3 commented on Dec 12, 2022

    @bjorn3
    Member

    Rumors are that mold doesn't complain, though that might just be by luck.

    That might be that mold is based on an older version of apple's ld from before this breaking change.

  3. added a commit that references this issue on Sep 19, 2023
  4. dtolnay commented on Sep 19, 2023

    @dtolnay
    Member

    I don't expect this is actionable in rustc.

    For users hitting the "not mach-o or llvm bitcode file" error in GitHub Actions, the solution is to use runs-on: macos-11 on Rust versions below 1.54, rather than runs-on: macos-latest.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions