Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mitsuhiko opened this issue Dec 2, 2022 · 3 comments
Closed

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

mitsuhiko opened this issue Dec 2, 2022 · 3 comments
Labels
C-bug Category: This is a bug.

Comments

@mitsuhiko
Copy link
Contributor

mitsuhiko commented Dec 2, 2022

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.

@mitsuhiko mitsuhiko added the C-bug Category: This is a bug. label Dec 2, 2022
@ehuss
Copy link
Contributor

ehuss commented Dec 2, 2022

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.

@bjorn3
Copy link
Member

bjorn3 commented Dec 12, 2022

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.

Thomasdezeeuw added a commit to Thomasdezeeuw/mio that referenced this issue Aug 13, 2023
According to rust-lang/rust#105167 and
rust-lang/rust#107252 (comment),
Xcode 14 broke support for rustc < 1.53.
Thomasdezeeuw added a commit to tokio-rs/mio that referenced this issue Aug 13, 2023
According to rust-lang/rust#105167 and
rust-lang/rust#107252 (comment),
Xcode 14 broke support for rustc < 1.53.
Thomasdezeeuw added a commit to Thomasdezeeuw/mio that referenced this issue Aug 13, 2023
According to rust-lang/rust#105167 and
rust-lang/rust#107252 (comment),
Xcode 14 broke support for rustc < 1.53.

Backport of commit 8dd37c5.
Thomasdezeeuw added a commit to tokio-rs/mio that referenced this issue Aug 13, 2023
According to rust-lang/rust#105167 and
rust-lang/rust#107252 (comment),
Xcode 14 broke support for rustc < 1.53.

Backport of commit 8dd37c5.
sagebind added a commit to sagebind/castaway that referenced this issue Sep 19, 2023
@dtolnay
Copy link
Member

dtolnay commented Sep 19, 2023

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
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

6 participants