Xcode 26 Link Error

Using xcode 26 with linker flag -ld_classic,get an error :

0 0x1042b9778 __assert_rtn + 160 1 0x1042bc560 ld::tool::SymbolTableAtom<x86_64>::classicOrdinalForProxy(ld::Atom const*) (.cold.3) + 0 2 0x1041f3da8 ld::tool::SymbolTableAtom<x86_64>::classicOrdinalForProxy(ld::Atom const*) + 172 3 0x1041f4c1c ld::tool::SymbolTableAtom<arm64>::addImport(ld::Atom const*, ld::tool::StringPoolAtom*) + 140 4 0x1041f6500 ld::tool::SymbolTableAtom<arm64>::encode() + 396 5 0x1041e83a8 ___ZN2ld4tool10OutputFile20buildLINKEDITContentERNS_8InternalE_block_invoke.413 + 36 6 0x182a95b2c _dispatch_call_block_and_release + 32 7 0x182aaf85c _dispatch_client_callout + 16 8 0x182acc478 _dispatch_channel_invoke.cold.5 + 92 9 0x182aa7fa4 _dispatch_root_queue_drain + 736 10 0x182aa85d4 _dispatch_worker_thread2 + 156 11 0x182c49e28 _pthread_wqthread + 232 A linker snapshot was created at: /tmp/app-2025-06-13-215652.ld-snapshot ld: Assertion failed: (it != _dylibToOrdinal.end()), function dylibToOrdinal, file OutputFile.cpp, line 5196. clang++: error: linker command failed with exit code 1 (use -v to see invocation)

How Can I Fix This Error?

Does building your project with Xcode 16 produce this error? If so, then that's a regression, and you should file a bug report about it with a reproducible project attached. Then post the FB number here for our reference.

It would also be helpful if you shared more about the library (here and in your bug report). For example:

  • How is it built, and when? Using Xcode or other tools?
  • What happens if you rebuild the library so that you don't need the -ld_classic option?
  • Does it contain multiple architectures? Is it mixing iOS and iOS simulator together in the same binary?
  • What platform is this build for?

— Ed Ford,  DTS Engineer

Hi Ed,

Thanks for your follow-up.

  1. When building with Xcode 16, the project compiles successfully with the -ld_classic flag. If we remove the flag, we get duplicate symbols errors. Our project includes multiple internal libraries, and some of them currently contain overlapping symbols. This isn’t something we can resolve quickly, so for now, we’re relying on -ld_classic for compatibility.

  2. We see the same issue when building with Xcode 16.2 beta (Build 16C5050e). Removing the -ld_classic flag also results in duplicate symbol errors, just like with Xcode 16.0.

  3. The libraries contain both iOS and iOS Simulator architectures.

  4. Our primary target platform is iOS, built for arm64.

We’ll work on producing a minimal reproducible example and file a bug report. I’ll post the Feedback Assistant number here once that’s done.

Best regards,

ZWZ

I’ve filed a report via Feedback Assistant: FB18047963. The report includes the linker snapshot and full Xcode build output from when the issue occurred.

We appreciate you filing FB18047963. Can you try adding -dead_strip -allow_dead_duplicates to your linker options?

I hope that will help you out as a workaround, but you should invest in fixing up your project structure so that you don't have the issues you list in point 1, so that you can entirely remove use of ld_classic from your project. That's the correct long term solution.

— Ed Ford,  DTS Engineer

Several folks have replied above to say that the workaround options don't help them with the circumstances of their project. If you're in that camp, then you'll need to update your library so that it works without requiring -ld_classic, which as I said above, is the correct long-term solution. If you're not aware, ld_classic was deprecated in Xcode 16, and stated in the Xcode 16 Release Notes.

— Ed Ford,  DTS Engineer

@xixihaha1024 said the following in a comment:

clang++: error: unknown argument: '-allow_dead_duplicates' Command Ld failed with a nonzero exit code

The arguments need to be passed through from the clang driver to the linker, so they need to be prefixed with -Xlinker. The complete set of options for the workaround that you need to set in your linker options build setting is -Xlinker -dead_strip -Xlinker -allow_dead_duplicates. I'm sorry I didn't make that clear previously.

— Ed Ford,  DTS Engineer

Mixed ObjC ABI, compiled without category class properties.

how to resolve this warning?

Xcode 26 Link Error
 
 
Q