"unknown option: -make_mergeable" when building a dynamic library as mergeable in Xcode 15

I have extracted a part of my app into a framework, which I have been building as a static library (mach-o type=static library). This has been inflating the app size, as the framework has been statically linked into both app & widget targets.

I have switched the framework to dynamic library, set to build it as a mergeable library, set the app targets to 'create merged library: automatic'.

Unfortunately, my release builds now fail with "unknown option: -make_mergeable" in Xcode 15 beta 8. This happens in "Link <MyFramework>" step during a framework build.

Debug builds work OK.

How can I fix this?

Replies

According to https://speakerdeck.com/kateinoigakukun/the-new-linker-in-xcode-15, it seems that in my case xcode doesn't call the new ld-prime linker, I have no idea why, though.

It seems that when I build for iOS 14.1, the new linker is not used. I had to switch the project to iOS15+, and then it started linking.

EDIT: Nope - once I removed the "-Wl -ld_new" (renamed from -ld_prime) flags to let the Xcode 14 build the project without error, I get "Unknown option: -make_mergeable" error again in Xcode 15 beta 8, suggesting that Xcode 15 for some reason decides to not use the new linker without being forced to :(.

You don't need to set "Build Mergeable Binary" as "Yes" if the framework is a direct dependency and it's a target in the same project. Just "automatic" in the build settings of app target is enough.