ld: warning: found architecture 'arm64e.old', required architecture 'arm64e'

I have tried to build the Rust Compiler using XCode 15 and ld. So, I got the linker errors.

 ld: warning: ignoring file '/private/var/folders/q4/3s60g5510ydbd3qc3p4xflm80000gn/T/rustcms1l5o/symbols.o': found architecture 'arm64e.old', required architecture 'arm64e'

My env is

Darwin Mac-1702981776371.local 22.6.0 Darwin Kernel Version 22.6.0: Fri Sep 15 13:39:52 PDT 2023; root:xnu-8796.141.3.700.8~1/RELEASE_X86_64 x86_64
Xcode 15.0.1
Build version 15A507
Apple clang version 15.0.0 (clang-1500.0.40.1)
Target: x86_64-apple-darwin22.6.0
Thread model: posix
InstalledDir: /Applications/Xcode_15.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
@(#)PROGRAM:ld  PROJECT:dyld-1015.7
BUILD 16:59:22 Oct  1 2023
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
will use ld-classic for: armv6 armv7 armv7s arm64_32 i386 armv6m armv7k armv7m armv7em
LTO support using: LLVM version 15.0.0 (static support for 29, runtime is 29)
TAPI support using: Apple TAPI version 15.0.0 (tapi-1500.0.12.3)
Library search paths:
Framework search paths:

Moreover, I cannot reproduce it using Xcode 14.3.1. I don't have any errors when I use LLVM lld.

Xcode 14.3.1
Build version 14E300c
/Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk

I tried to compare private headers for binaries using otool -h. They are the same.

How can I fix it?

Replies

I don’t know anything about the Rust build system but it looks like it’s producing this symbols.o file using one flavour of the arm64e architecture, and the linker is expecting the other flavour. This speaks to a deeper problem: Apple does not support arm64e code for third-party developers [1]. Third-party code must use vanilla arm64. That’s because Apple hasn’t finalised the arm64e runtime, which means that we offer no API stability guarantees for it [2].

In your situation I’d look at how you can configure the Rust build system to target arm64.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] Except for KEXTs.

[2] You’ll note that lots of system libraries are built arm64e, but that’s fine because those are revlocked to the OS itself.