Apple’s library technology has a long and glorious history, dating all the way back to the origins of Unix. This does, however, mean that it can be a bit confusing to newcomers. This is my attempt to clarify some terminology.
If you have any questions or comments about this, start a new thread and tag it with Linker so that I see it.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
An Apple Library Primer
Apple’s tools support two related concepts:
Platform — This is the platform itself; macOS, iOS, iOS Simulator, and Mac Catalyst are all platforms.
Architecture — This is a specific CPU architecture used by a platform. arm64 and x86_64 are both architectures.
A given architecture might be used by multiple platforms. The most obvious example of this arm64, which is used by all of the platforms listed above.
Code built for one platform will not work on another platform, even if both platforms use the same architecture.
Code is usually packaged in either a Mach-O file or a static library. Mach-O is used for executables (MH_EXECUTE), dynamic libraries (MH_DYLIB), bundles (MH_BUNDLE), and object files (MH_OBJECT). These can have a variety of different extensions; the only constant is that .o is always used for a Mach-O containing an object file. Use otool and nm to examine a Mach-O file. Use vtool to quickly determine the platform for which it was built. Use size to get a summary of its size. Use dyld_info to get more details about a dynamic library.
IMPORTANT All the tools mentioned here are documented in man pages. For information on how to access that documentation, see Reading UNIX Manual Pages. There’s also a Mach-O man page, with basic information about the file format.
Many of these tools have old and new variants, using the -classic suffix or llvm- prefix, respectively. For example, there’s nm-classic and llvm-nm. If you run the original name for the tool, you’ll get either the old or new variant depending on the version of the currently selected tools. To explicitly request the old or new variants, use xcrun.
The term Mach-O image refers to a Mach-O that can be loaded and executed without further processing. That includes executables, dynamic libraries, and bundles, but not object files.
A dynamic library has the extension .dylib. You may also see this called a shared library.
A framework is a bundle structure with the .framework extension that has both compile-time and run-time roles:
At compile time, the framework combines the library’s headers and its stub library (stub libraries are explained below).
At run time, the framework combines the library’s code, as a Mach-O dynamic library, and its associated resources.
The exact structure of a framework varies by platform. For the details, see Placing Content in a Bundle.
macOS supports both frameworks and standalone dynamic libraries. Other Apple platforms support frameworks but not standalone dynamic libraries.
Historically these two roles were combined, that is, the framework included the headers, the dynamic library, and its resources. These days Apple ships different frameworks for each role. That is, the macOS SDK includes the compile-time framework and macOS itself includes the run-time one. Most third-party frameworks continue to combine these roles.
A static library is an archive of one or more object files. It has the extension .a. Use ar, libtool, and ranlib to inspect and manipulate these archives.
The static linker, or just the linker, runs at build time. It combines various inputs into a single output. Typically these inputs are object files, static libraries, dynamic libraries, and various configuration items. The output is most commonly a Mach-O image, although it’s also possible to output an object file. The linker may also output metadata, such as a link map (see Using a Link Map to Track Down a Symbol’s Origin).
The linker has seen three major implementations:
ld — This dates from the dawn of Mac OS X.
ld64 — This was a rewrite started in the 2005 timeframe. Eventually it replaced ld completely. If you type ld, you get ld64.
ld_prime — This was introduced with Xcode 15. This isn’t a separate tool. Rather, ld now supports the -ld_classic and -ld_new options to select a specific implementation.
Note During the Xcode 15 beta cycle these options were -ld64 and -ld_prime. I continue to use those names because the definition of new changes over time (some of us still think of ld64 as the new linker ;–).
The dynamic linker loads Mach-O images at runtime. Its path is /usr/lib/dyld, so it’s often referred to as dyld, dyld, or DYLD. Personally I pronounced that dee-lid, but some folks say di-lid and others say dee-why-el-dee.
IMPORTANT Third-party executables must use the standard dynamic linker.
Other Unix-y platforms support the notion of a statically linked executable, one that makes system calls directly. This is not supported on Apple platforms. Apple platforms provide binary compatibility via system dynamic libraries and frameworks, not at the system call level.
Note Apple platforms have vestigial support for custom dynamic linkers (your executable tells the system which dynamic linker to use via the LC_LOAD_DYLINKER load command). This facility originated on macOS’s ancestor platform and has never been a supported option on any Apple platform.
The dynamic linker has seen 4 major revisions. See WWDC 2017 Session 413 (referenced below) for a discussion of versions 1 through 3. Version 4 is basically a merging of versions 2 and 3.
The dyld man page is chock-full of useful info, including a discussion of how it finds images at runtime.
Every dynamic library has an install name, which is how the dynamic linker identifies the library. Historically that was the path where you installed the library. That’s still true for most system libraries, but nowadays a third-party library should use an rpath-relative install name. For more about this, see Dynamic Library Identification.
Mach-O images are position independent, that is, they can be loaded at any location within the process’s address space. Historically, Mach-O supported the concept of position-dependent images, ones that could only be loaded at a specific address. While it may still be possible to create such an image, it’s no longer a good life choice.
Mach-O images have a default load address, also known as the base address. For modern position-independent images this is 0 for library images and 4 GiB for executables (leaving the bottom 32 bits of the process’s address space unmapped). When the dynamic linker loads an image, it chooses an address for the image and then rebases the image to that address. If you take that address and subtract the image’s load address, you get a value known as the slide.
Xcode 15 introduced the concept of a mergeable library. This a dynamic library with extra metadata that allows the linker to embed it into the output Mach-O image, much like a static library. Mergeable libraries have many benefits. For all the backstory, see WWDC 2023 Session 10268 Meet mergeable libraries. For instructions on how to set this up, see Configuring your project to use mergeable libraries.
If you put a mergeable library into a framework structure you get a mergeable framework.
Xcode 15 also introduced the concept of a static framework. This is a framework structure where the framework’s dynamic library is replaced by a static library.
Note It’s not clear to me whether this offers any benefit over creating a mergeable framework.
Earlier versions of Xcode did not have proper static framework support. That didn’t stop folks trying to use them, which caused all sorts of weird build problems.
A universal binary is a file that contains multiple architectures for the same platform. Universal binaries always use the universal binary format. Use the file command to learn what architectures are within a universal binary. Use the lipo command to manipulate universal binaries.
A universal binary’s architectures are either all in Mach-O format or all in the static library archive format. The latter is called a universal static library.
A universal binary has the same extension as its non-universal equivalent. That means a .a file might be a static library or a universal static library.
Most tools work on a single architecture within a universal binary. They default to the architecture of the current machine. To override this, pass the architecture in using a command-line option, typically -arch or --arch.
An XCFramework is a single document package that includes libraries for any combination of platforms and architectures. It has the extension .xcframework. An XCFramework holds either a framework, a dynamic library, or a static library. All the elements must be the same type. Use xcodebuild to create an XCFramework. For specific instructions, see Xcode Help > Distribute binary frameworks > Create an XCFramework.
Historically there was no need to code sign libraries in SDKs. If you shipped an SDK to another developer, they were responsible for re-signing all the code as part of their distribution process. Xcode 15 changes this. You should sign your SDK so that a developer using it can verify this dependency. For more details, see WWDC 2023 Session 10061 Verify app dependencies with digital signatures and Verifying the origin of your XCFrameworks.
A stub library is a compact description of the contents of a dynamic library. It has the extension .tbd, which stands for text-based description (TBD). Apple’s SDKs include stub libraries to minimise their size; for the backstory, read this post. Use the tapi tool to create and manipulate stub libraries. In this context TAPI stands for a text-based API, an alternative name for TBD. Oh, and on the subject of tapi, I’d be remiss if I didn’t mention tapi-analyze!
Stub libraries currently use YAML format, a fact that’s relevant when you try to interpret linker errors. If you’re curious about the format, read the tapi-tbdv4 man page. There’s also a JSON variant documented in the tapi-tbdv5 man page.
Note Back in the day stub libraries used to be Mach-O files with all the code removed (MH_DYLIB_STUB). This format has long been deprecated in favour of TBD.
Historically, the system maintained a dynamic linker shared cache, built at runtime from its working set of dynamic libraries. In macOS 11 and later this cache is included in the OS itself. Libraries in the cache are no longer present in their original locations on disk:
% ls -lh /usr/lib/libSystem.B.dylib
ls: /usr/lib/libSystem.B.dylib: No such file or directory
Apple APIs, most notably dlopen, understand this and do the right thing if you supply the path of a library that moved into the cache. That’s true for some, but not all, command-line tools, for example:
% dyld_info -exports /usr/lib/libSystem.B.dylib
/usr/lib/libSystem.B.dylib [arm64e]:
-exports:
offset symbol
…
0x5B827FE8 _mach_init_routine
% nm /usr/lib/libSystem.B.dylib
…/nm: error: /usr/lib/libSystem.B.dylib: No such file or directory
When the linker creates a Mach-O image, it adds a bunch of helpful information to that image, including:
The target platform
The deployment target, that is, the minimum supported version of that platform
Information about the tools used to build the image, most notably, the SDK version
A build UUID
For more information about the build UUID, see TN3178 Checking for and resolving build UUID problems. To dump the other information, run vtool.
In some cases the OS uses the SDK version of the main executable to determine whether to enable new behaviour or retain old behaviour for compatibility purposes. You might see this referred to as compiled against SDK X. I typically refer to this as a linked-on-or-later check.
Apple tools support the concept of autolinking. When your code uses a symbol from a module, the compiler inserts a reference (using the LC_LINKER_OPTION load command) to that module into the resulting object file (.o). When you link with that object file, the linker adds the referenced module to the list of modules that it searches when resolving symbols.
Autolinking is obviously helpful but it can also cause problems, especially with cross-platform code. For information on how to enable and disable it, see the Build settings reference.
Mach-O uses a two-level namespace. When a Mach-O image imports a symbol, it references the symbol name and the library where it expects to find that symbol. This improves both performance and reliability but it precludes certain techniques that might work on other platforms. For example, you can’t define a function called printf and expect it to ‘see’ calls from other dynamic libraries because those libraries import the version of printf from libSystem.
To help folks who rely on techniques like this, macOS supports a flat namespace compatibility mode. This has numerous sharp edges — for an example, see the posts on this thread — and it’s best to avoid it where you can. If you’re enabling the flat namespace as part of a developer tool, search the ’net for dyld interpose to learn about an alternative technique.
WARNING Dynamic linker interposing is not documented as API. While it’s a useful technique for developer tools, do not use it in products you ship to end users.
Apple platforms use DWARF. When you compile a file, the compiler puts the debug info into the resulting object file. When you link a set of object files into a executable, dynamic library, or bundle for distribution, the linker does not include this debug info. Rather, debug info is stored in a separate debug symbols document package. This has the extension .dSYM and is created using dsymutil. Use symbols to learn about the symbols in a file. Use dwarfdump to get detailed information about DWARF debug info. Use atos to map an address to its corresponding symbol name.
Different languages use different name mangling schemes:
C, and all later languages, add a leading underscore (_) to distinguish their symbols from assembly language symbols.
C++ uses a complex name mangling scheme. Use the c++filt tool to undo this mangling.
Likewise, for Swift. Use swift demangle to undo this mangling.
For a bunch more info about symbols in Mach-O, see Understanding Mach-O Symbols. This includes a discussion of weak references and weak definition. If your code is referencing a symbol unexpectedly, see Determining Why a Symbol is Referenced.
To remove symbols from a Mach-O file, run strip. To hide symbols, run nmedit.
It’s common for linkers to divide an object file into sections. You might find data in the data section and code in the text section (text is an old Unix term for code). Mach-O uses segments and sections. For example, there is a text segment (__TEXT) and within that various sections for code (__TEXT > __text), constant C strings (__TEXT > __cstring), and so on.
Over the years there have been some really good talks about linking and libraries at WWDC, including:
WWDC 2023 Session 10268 Meet mergeable libraries
WWDC 2022 Session 110362 Link fast: Improve build and launch times
WWDC 2022 Session 110370 Debug Swift debugging with LLDB
WWDC 2021 Session 10211 Symbolication: Beyond the basics
WWDC 2019 Session 416 Binary Frameworks in Swift — Despite the name, this covers XCFrameworks in depth.
WWDC 2018 Session 415 Behind the Scenes of the Xcode Build Process
WWDC 2017 Session 413 App Startup Time: Past, Present, and Future
WWDC 2016 Session 406 Optimizing App Startup Time
Note The older talks are no longer available from Apple, but you may be able to find transcripts out there on the ’net.
Historically Apple published a document, Mac OS X ABI Mach-O File Format Reference, or some variant thereof, that acted as the definitive reference to the Mach-O file format. This document is no longer available from Apple. If you’re doing serious work with Mach-O, I recommend that you find an old copy. It’s definitely out of date, but there’s no better place to get a high-level introduction to the concepts. The Mach-O Wikipedia page has a link to an archived version of the document.
For the most up-to-date information about Mach-O, see the declarations and doc comments in <mach-o/loader.h>.
Revision History
2025-08-04 Added a link to Determining Why a Symbol is Referenced.
2025-06-29 Added information about autolinking.
2025-05-21 Added a note about the legacy Mach-O stub library format (MH_DYLIB_STUB).
2025-04-30 Added a specific reference to the man pages for the TBD format.
2025-03-01 Added a link to Understanding Mach-O Symbols. Added a link to TN3178 Checking for and resolving build UUID problems. Added a summary of the information available via vtool. Discussed linked-on-or-later checks. Explained how Mach-O uses segments and sections. Explained the old (-classic) and new (llvm-) tool variants. Referenced the Mach-O man page. Added basic info about the strip and nmedit tools.
2025-02-17 Expanded the discussion of dynamic library identification.
2024-10-07 Added some basic information about the dynamic linker shared cache.
2024-07-26 Clarified the description of the expected load address for Mach-O images.
2024-07-23 Added a discussion of position-independent images and the image slide.
2024-05-08 Added links to the demangling tools.
2024-04-30 Clarified the requirement to use the standard dynamic linker.
2024-03-02 Updated the discussion of static frameworks to account for Xcode 15 changes. Removed the link to WWDC 2018 Session 415 because it no longer works )-:
2024-03-01 Added the WWDC 2023 session to the list of sessions to make it easier to find. Added a reference to Using a Link Map to Track Down a Symbol’s Origin. Made other minor editorial changes.
2023-09-20 Added a link to Dynamic Library Identification. Updated the names for the static linker implementations (-ld_prime is no more!). Removed the beta epithet from Xcode 15.
2023-06-13 Defined the term Mach-O image. Added sections for both the static and dynamic linkers. Described the two big new features in Xcode 15: mergeable libraries and dependency verification.
2023-06-01 Add a reference to tapi-analyze.
2023-05-29 Added a discussion of the two-level namespace.
2023-04-27 Added a mention of the size tool.
2023-01-23 Explained the compile-time and run-time roles of a framework. Made other minor editorial changes.
2022-11-17 Added an explanation of TAPI.
2022-10-12 Added links to Mach-O documentation.
2022-09-29 Added info about .dSYM files. Added a few more links to WWDC sessions.
2022-09-21 First posted.
Linker
RSS for tagUse dyld to link in frameworks at runtime. Use ld to make your programs and link archive libraries at build time.
Posts under Linker tag
80 Posts
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I have an Xcode project setup as follows:
3 static libraries
1 framework target, whose Mach-O type is set to Dynamic Library
main app target (iOS app)
The target dependencies are as follows:
In framework's build phase [Link with libraries], I have the 3 libs statically linked.
In the main app's build phase [Link with libraries], I have only the framework, which is dynamically linked.
As per my understanding:
The libs are statically linked to the framework. So, the framework binary would contain code from all the libs.
The framework is dynamically linked to the main app (iOS app in this case). So, the main app's binary only has a reference to the framework's binary, which would be loaded in the memory at runtime.
Assuming my understanding is correct, I'm stuck with the following problem:
All 3 libs build successfully
The framework builds successfully
The main app target doesn't build. The compilation is successful, but the build fails with linker errors.
Please let me know if I am doing something incorrectly, or if a configuration is missing. Below are more details:
The linker gives the following error:
Undefined symbols for architecture arm64:
"StringUtils.GetStr() -> Swift.String", referenced from:
dynamic_fw.AppDelegate.application(_: __C.UIApplication, didFinishLaunchingWithOptions: [__C.UIApplicationLaunchOptionsKey : Any]?) -> Swift.Bool in AppDelegate.o
"TWUtils.GetNum() -> Swift.Int", referenced from:
dynamic_fw.AppDelegate.application(_: __C.UIApplication, didFinishLaunchingWithOptions: [__C.UIApplicationLaunchOptionsKey : Any]?) -> Swift.Bool in AppDelegate.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
And the command shown in the logs for linking phase is:
Ld /Users/raunit.shrivastava/Library/Developer/Xcode/DerivedData/dynamic-fw-foqtqhpopkmoapfufzxbfloamnpr/Build/Products/Debug-iphonesimulator/dynamic-fw.app/dynamic-fw normal (in target 'dynamic-fw' from project 'dynamic-fw')
cd /Users/raunit.shrivastava/Desktop/dynamic-fw
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -Xlinker -reproducible -target arm64-apple-ios17.5-simulator -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.5.sdk -O0 -L/Users/raunit.shrivastava/Library/Developer/Xcode/DerivedData/dynamic-fw-foqtqhpopkmoapfufzxbfloamnpr/Build/Intermediates.noindex/EagerLinkingTBDs/Debug-iphonesimulator -L/Users/raunit.shrivastava/Library/Developer/Xcode/DerivedData/dynamic-fw-foqtqhpopkmoapfufzxbfloamnpr/Build/Products/Debug-iphonesimulator -L. -L./StringUtils -L./TWFramework -L./TWUtils -L./dynamic-fw -F/Users/raunit.shrivastava/Library/Developer/Xcode/DerivedData/dynamic-fw-foqtqhpopkmoapfufzxbfloamnpr/Build/Intermediates.noindex/EagerLinkingTBDs/Debug-iphonesimulator -F/Users/raunit.shrivastava/Library/Developer/Xcode/DerivedData/dynamic-fw-foqtqhpopkmoapfufzxbfloamnpr/Build/Products/Debug-iphonesimulator -F. -F./StringUtils -F./TWFramework -F./TWUtils -F./dynamic-fw -filelist /Users/raunit.shrivastava/Library/Developer/Xcode/DerivedData/dynamic-fw-foqtqhpopkmoapfufzxbfloamnpr/Build/Intermediates.noindex/dynamic-fw.build/Debug-iphonesimulator/dynamic-fw.build/Objects-normal/arm64/dynamic-fw.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker ./\*\* -dead_strip -Xlinker -object_path_lto -Xlinker /Users/raunit.shrivastava/Library/Developer/Xcode/DerivedData/dynamic-fw-foqtqhpopkmoapfufzxbfloamnpr/Build/Intermediates.noindex/dynamic-fw.build/Debug-iphonesimulator/dynamic-fw.build/Objects-normal/arm64/dynamic-fw_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -L/usr/lib/swift -Xlinker -add_ast_path -Xlinker /Users/raunit.shrivastava/Library/Developer/Xcode/DerivedData/dynamic-fw-foqtqhpopkmoapfufzxbfloamnpr/Build/Intermediates.noindex/dynamic-fw.build/Debug-iphonesimulator/dynamic-fw.build/Objects-normal/arm64/dynamic_fw.swiftmodule -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/raunit.shrivastava/Library/Developer/Xcode/DerivedData/dynamic-fw-foqtqhpopkmoapfufzxbfloamnpr/Build/Intermediates.noindex/dynamic-fw.build/Debug-iphonesimulator/dynamic-fw.build/dynamic-fw.app-Simulated.xcent -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __ents_der -Xlinker /Users/raunit.shrivastava/Library/Developer/Xcode/DerivedData/dynamic-fw-foqtqhpopkmoapfufzxbfloamnpr/Build/Intermediates.noindex/dynamic-fw.build/Debug-iphonesimulator/dynamic-fw.build/dynamic-fw.app-Simulated.xcent.der -framework TWFramework -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker /Users/raunit.shrivastava/Library/Developer/Xcode/DerivedData/dynamic-fw-foqtqhpopkmoapfufzxbfloamnpr/Build/Intermediates.noindex/dynamic-fw.build/Debug-iphonesimulator/dynamic-fw.build/Objects-normal/arm64/dynamic-fw_dependency_info.dat -o /Users/raunit.shrivastava/Library/Developer/Xcode/DerivedData/dynamic-fw-foqtqhpopkmoapfufzxbfloamnpr/Build/Products/Debug-iphonesimulator/dynamic-fw.app/dynamic-fw
Hello.
On my app I have the necessity to use mergeable libraries, in my context my libraries are indirect dependency, in other words the dependency isn’t target in my project, and they are XCFramework where they are imported on Framework, Libraries, and Embedded Content session on my app target.
Following the documentation on Configuring your project to use mergeable libraries it said.

But on Manually configure merging don’t said how to configure to indirect dependencies.

So I have tried configure use the linker flag -merge_framework for each XCFramework using -Wl, -merge_framework, {XCFramework_Name}, but I am receiving the following error unknown argument: -merge_framework’ when build the release.
In app target is set build settings MERGED_BINARY_TYPE = manual;
The question is:
Is possible using mergeable libraries in XCFramework dependencies ? How I do this? Because on the doc is not clear how to use in indirect dependency like XCFramework.
Regards
Michel Carvalho
I got several reports about our TestFlight app crashing unconditionally on 2 devices (iOS 18.1 and iOS 18.3.1) on app start with the following reason:
Termination Reason: DYLD 4 Symbol missing
Symbol not found: _$sScIsE4next7ElementQzSgyYa7FailureQzYKF
(terminated at launch; ignore backtrace)
The symbol in question demangles to
(extension in Swift):Swift.AsyncIteratorProtocol.next() async throws(A.Failure) -> A.Element?
Our deploy target is iOS 18.0, this symbol was introduced in Swift 6.0, we're using latest Xcode 16 now - everything should be working, but for some reason aren't.
Since this symbol is quite rarely used directly, I was able to pinpoint the exact place in code related to it. Few days ago I added the following code to our app library (details omitted):
public struct AsyncRecoveringStream<Base: AsyncSequence>: AsyncSequence {
...
public struct AsyncIterator: AsyncIteratorProtocol {
...
public mutating func next(isolation actor: isolated (any Actor)? = #isolation) async throws(Failure) -> Element? {
...
}
}
}
I tried to switch to Xcode 26 - it was still crashing on affected phone. Then I changed next(isolation:) to its older version, next():
public mutating func next() async throws(Failure) -> Element?
And there crashes are gone. However, this change is a somewhat problematic, since I either have to lower Swift version of our library from 6 to 5 and we loose concurrency checks and typed throws or I'm loosing tests due to Swift compiler crash. Performance is also affected, but it's not that critical for our case.
Why is this crash happening? How can I solve this problem or elegantly work around it?
Thank you!
2025-10-09_17-13-31.7885_+0100-23e00e377f9d43422558d069818879042d4c5c2e.crash
I admit I am doing something unusual, and I would not be surprised if it didn't work. I am surprised, however, because after performing the equivalent operations on four bundles, all of the bundles work fine on macOS 15.6.1, but only two of them work on macOS 26.1 (beta 2). I don't know what causes the different outcomes.
What I am trying to do is get Java to pass the macOS 26 AppKit UI SDK linkage checking without having to rebuild the JDK using Xcode 26. Rebuilding works for the latest SDK, but it is very inconvenient and may not work for older JDKs. It usually takes a while before the JDK build team successfully transitions to a new Xcode release.
My approach is to use vtool to update the sdk version in the LC_BUILD_VERSION load command of $JAVA_HOME/bin/java, which is the launching executable for the JDK.
I performed this operation on four JDKs: 25, 21, 17, and 11. (I ran vtool on macOS 15.)
It was completely successful on JDK 25 and 21. The JDK launches correctly on macOS 15 and macOS 26. On macOS 26, AppKit uses the new UI, which is the desired outcome. The JDK runs despite that fact that I signed the modified $JAVA_HOME/bin/java with my developer ID, which is inconsistent with the JDK bundle signature. (Redoing the bundle signing is part of the JDK build process; if that were necessary, I would stick with rebuilding the JDK.)
The operation was not successful on JDK 17 and 11. I noticed two problems, which are not obviously related.
When vtool created the new version of the java program, it lost the tool definition.
$ vtool -show-build-version java
java:
Load command 10
cmd LC_BUILD_VERSION
cmdsize 32
platform MACOS
minos 11.0
sdk 11.1
ntools 1
tool LD
version 609.8
$ vtool -set-build-version 1 10.0 26.0 -output a.out java
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/vtool warning: code signature will be invalid for a.out
$ vtool -show-build-version a.out
a.out:
Load command 22
cmd LC_BUILD_VERSION
cmdsize 24
platform MACOS
minos 10.0
sdk 26.0
ntools 0
Adding back the tool definition didn't seem to matter.
When I try to run the revised executable (in the context of the JDK bundle), it works on macOS 15, but on macOS 26, it is rejected as damaged. If I run the revised executable outside the JDK bundle, it runs (but fails because it can't find the rest of the JDK, which is expected).
In all cases, GateKeeper rejects the revised executable because it has not been notarized, but that doesn't seem to stop the program from executing.
Topic:
Developer Tools & Services
SubTopic:
General
Tags:
macOS
Linker
Gatekeeper
Signing Certificates
Undefined symbols for architecture arm64:
"_swift_coroFrameAlloc", referenced from:
NvMobileCore.Constraint.isActive.modify : Swift.Bool in NvMobileCore[5]
NvMobileCore.Constraint.isActive.modify : Swift.Bool in NvMobileCore[5]
NvMobileCore.NvMobileCoreManager.delegate.modify : NvMobileCore.NvPublicInterface? in NvMobileCore[53]
NvMobileCore.NvMobileCoreManager.delegate.modify : NvMobileCore.NvPublicInterface? in NvMobileCore[53]
NvMobileCore.NvMobileCoreManager.language.modify : Swift.String in NvMobileCore[53]
NvMobileCore.NvMobileCoreManager.language.modify : Swift.String in NvMobileCore[53]
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
My Xcode project has the following configuration:
1 iOS app target
1 Xcode framework target (mach-o-type "Dynamic Library")
5 static libraries
Dependencies:
All the static libraries are target dependencies of the framework.
The framework is the only target dependency of the iOS app.
For the iOS app target, within the General tab > Frameworks, Libraries & Embedded content, I've set the framework as "Do not embed"
So now I have a dynamic framework which won't be copied to the .app bundle in the build output.
As per my understanding, this should result in a runtime error, dyld should not be able to find the framework files as they were not embedded in the final .app bundle.
But regardless, my app runs without any errors, using all the methods exposed by the framework.
What is the correct understanding here?
What exactly does Embed/Do not embed mean (apart from excluding the files from .app bundle)
When both settings are specified, is there any priority or precedence of one setting over the other?
We are unable to access images from an Asset catalog that is part of a dynamic framework that is mergeable, on Debug configuration, when running on an actual device under certain circumstances when using Xcode 16.4 and targeting iOS.
If anywhere in the app we call the Bundle(identifier:) initializer for whatever ID, subsequent calls to UIImage(named:in:with:) for images in the framework's bundle return nil. We have verified that the bundle (path) and the name of image & assets target memberships are correct, and that Assets.car has the images.
Additionally the only way to make UIImage(named:in:with:) work is to use Bundle(for:) where BundleFinder is part of the mergeable library, non private NSObject class. Anything else and the re-exported bundle is returned which has no assets.
Is anyone have this problem on xcode 26 ?
Undefined symbol: _swift_FORCE_LOAD$_swiftCompatibility50
Undefined symbol: _swift_FORCE_LOAD$_swiftCompatibility51
Undefined symbol: _swift_FORCE_LOAD$_swiftCompatibility56
Undefined symbol: _swift_FORCE_LOAD$_swiftCompatibilityConcurrency
Undefined symbol: _swift_FORCE_LOAD$_swiftCompatibilityDynamicReplacements
My Xcode project fails to run with the following crash log any time I use a new SwiftUI symbol such as ConcentricRectangle or .glassEffect. I've tried using the legacy linker to no avail. It compiles perfectly fine, and I've tried targeting just macOS 26 also to no avail. This is a macOS project that's compiled just fine for years and compiles and runs on macOS going back to 13.0.
Failed to look up symbolic reference at 0x118e743cd - offset 1916987 - symbol symbolic _____y_____y_____y_____yAAyAAy_____y__________G_____G_____yAFGGSg_ACyAAy_____y_____SSG_____y_____SgGG______tGSgACyAAyAAy_____ATG_____G_AVtGSgtGGAQySbGG______Qo_ 7SwiftUI4ViewPAAE11glassEffect_2inQrAA5GlassV_qd__tAA5ShapeRd__lFQO AA15ModifiedContentV AA6VStackV AA05TupleC0V AA01_hC0V AA9RectangleV AA5ColorV AA12_FrameLayoutV AA24_BackgroundStyleModifierV AA6IDViewV 8[ ]012EditorTabBarC0V AA022_EnvironmentKeyWritingS0V A_0W0C AA7DividerV A_0w4JumpyC0V AA08_PaddingP0V AA07DefaultgeH0V in /Users/[ ]/Library/Developer/Xcode/DerivedData/[ ]-grfjhgtlsyiobueapymobkzvfytq/Build/Products/Debug/[ ]/Contents/MacOS/[ ].debug.dylib - pointer at 0x119048408 is likely a reference to a missing weak symbol
Example crashing code:
import SwiftUI
struct MyView: View {
var body: some View {
if #available(macOS 26.0, *) {
Text("what the heck man").glassEffect()
}
}
}
Xcode 16.2
Flutter version 3.27.1
0 0x1008abee4 __assert_rtn + 160
1 0x1008add9c ld::tool::OutputFile::setFixup64(unsigned char*, unsigned long long, ld::Atom const*) (.cold.3) + 0
2 0x100789640 ld::tool::OutputFile::setFixup64(unsigned char*, unsigned long long, ld::Atom const*) + 656
3 0x100785b78 ld::tool::OutputFile::applyFixUps(ld::Internal&, unsigned long long, ld::Atom const*, unsigned char*) + 4388
4 0x10078be18 ___ZN2ld4tool10OutputFile10writeAtomsERNS_8InternalEPh_block_invoke + 488
5 0x19bc19428 _dispatch_client_callout2 + 20
6 0x19bc2d850 _dispatch_apply_invoke3 + 336
7 0x19bc193e8 _dispatch_client_callout + 20
8 0x19bc1ac68 _dispatch_once_callout + 32
9 0x19bc2c8a4 _dispatch_apply_invoke + 252
10 0x19bc193e8 _dispatch_client_callout + 20
11 0x19bc2b080 _dispatch_root_queue_drain + 864
12 0x19bc2b6b8 _dispatch_worker_thread2 + 156
13 0x19bdc5fd0 _pthread_wqthread + 228
A linker snapshot was created at:
/tmp/Test Kopi Kenangan.debug.dylib-2025-02-27-100512.ld-snapshot
ld: Assertion failed: (reconstituted == accumulator), function setFixup64, file OutputFile.cpp, line 2975.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am trying to debug the AAX version of my plugin (MIDI effect) on Pro Tools, but I am getting the following error (Mac console) when attempting to load it:
dlsym cannot find symbol g_dwILResult in CFBundle etc..
I used Xcode 16.4 to build the plugin.
Has anybody come across the same or a similar message?
Best,
Achillefs
Axart Labs
I created 2 iOS projects in Xcode:
Project 1:
4 targets (main app + 3 app extensions)
4 static libraries
the main app's target dependencies include - 3 app extensions and the 4 libs.
the main app's binary is linked to all 4 libs
similarly, each extension is linked to all 4 libs
Project 2:
5 targets (main app + 3 app extensions + 1 framework)
4 static libraries
the main app's target dependencies include - 3 app extensions and the framework
each extension is dependent only on the framework
the framework's target dependencies include all the 4 static libs
As per my understanding, the app bundle size for Project 2 should be less than that of Project 1, since we eliminate duplicating the static libs for each target by using a framework instead.
However, I have found that the bundle size is more for Project 2 as compared to the bundle size of project 1.
I do not understand, why?
I'm having a problem with Xcode 26 where a symbol bug is causing my app to crash at launch if they are running iOS 17.X
This has to do with a HealthKit API that was introduced in iOS 18.1 HKQuantityType(.appleSleepingBreathingDisturbances), I use availability clauses to ensure I only support it in that version. This all worked fine with Xcode 16.4 but breaks in Xcode 26.
This means ALL my users running iOS 17 will get at launch crashes if this isn't resolved in the Xcode GM seed.
I'll post the code here in case I'm doing anything wrong. This, the HealthKit capability, the "HealthKit Privacy - Health Share Usage Description" and "Privacy - Health Update Usage Description", and device/simulator on iOS 17.X are all you need to reproduce the issue.
I've made a feedback too as I'm 95% sure it's a bug: FB19727966
import SwiftUI
import HealthKit
struct ContentView: View {
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
Text("Hello, world!")
}
.padding()
.task {
print(await requestPermission())
}
}
}
#Preview {
ContentView()
}
func requestPermission() async -> Bool {
if #available(iOS 18.0, *) {
let healthTypes = [HKQuantityType(.appleSleepingBreathingDisturbances)]
var readTypes = healthTypes.map({$0})
let write: Set<HKSampleType> = []
let res: ()? = try? await HKHealthStore().requestAuthorization(toShare: write, read: Set(readTypes))
guard res != nil else {
print("requestPermission returned nil")
return false
}
return true
}
else { return false}
}
This is a lengthy one. I have basically compiled a Rust binary into a dylib and packaged into a .xcframework that contains per arch .frameworks. This loads correctly when run from Xcode into a real iOS device. However, when deployed to TestFlight the app crashes.
Here is what is a bit different, the dylib is not fully self-contained. It tries to reach in an use C functions I have exposed in my library code. Calling functions that are just within the dylib and just return works fine, but the moment it tries to call one of the exposed functions it crashes.
A full in-depth step by step of how I packaged the binaries can be found in my website: https://ospfranco.com/complete-guide-to-dylibs-in-ios-and-android
When I look at the TestFlight crash report there are no symbols but the termination cause via WatchDog is:
Termination Reason: CODESIGNING 2 Invalid Page
I have declared my functions as such:
OBJC_EXTERN void ios_prepare_request(const char *url)
#define EXPORT __attribute__((visibility("default"), used, retain))
extern "C" {
EXPORT void ios_prepare_request(const char *url) {
NSString *urlString = [NSString stringWithUTF8String:url];
request =
[NSMutableURLRequest requestWithURL:[NSURL URLWithString:urlString]];
}
}
// Function used to prevent optimization
void force_symbol_registration() {
// Force these symbols to be included in the binary by referencing them
volatile void *ptrs[] = {(void *)ios_prepare_request,};
// Prevent compiler from optimizing away the array
(void)ptrs;
}
And I load my framework as:
opacity::force_symbol_registration();
// NSBundle *dylib_bundle =
// [NSBundle bundleWithIdentifier:@"com.opacitylabs.sdk"];
// NSString *dylib_path = [dylib_bundle pathForResource:@"sdk" ofType:@""];
// // Load the dynamic library
// void *handle = dlopen([dylib_path UTF8String], RTLD_NOW | RTLD_GLOBAL);
// if (!handle) {
// NSString *errorMessage = [NSString stringWithUTF8String:dlerror()];
// *error =
// [NSError errorWithDomain:@"OpacitySDKDylibError"
// code:1002
// userInfo:@{NSLocalizedDescriptionKey :
// errorMessage}];
// return -1; // or appropriate error code
// }
// Make sure the main executable's symbols are available
dlopen(NULL, RTLD_NOW | RTLD_GLOBAL);
NSBundle *frameworkBundle =
[NSBundle bundleWithIdentifier:@"com.opacitylabs.sdk"];
if (![frameworkBundle isLoaded]) {
BOOL success = [frameworkBundle load];
if (!success) {
NSString *errorMessage = @"Failed to load framework";
*error =
[NSError errorWithDomain:@"OpacitySDKDylibError"
code:1002
userInfo:@{NSLocalizedDescriptionKey : errorMessage}];
return -1;
}
}
As you can see, I have also tried dlopen both work when run from Xcode but crash when deployed on testflight.
I have tried re-signing the xcframework/frameworks on a pre build step but it doesn't work
As stated, I can call the functions inside the dylib, but once they try to call my exposed code it crashes
Is this achievable at all or just a limitation of the iOS sandbox?
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::addImport(ld::Atom const*, ld::tool::StringPoolAtom*) + 140
4 0x1041f6500 ld::tool::SymbolTableAtom::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)
I have been learning from the Apple Developer tutorials and I got stuck on the ScoreKeeper chapter with Testing. Since my Macbook Pro 2017 can only use Xcode 15.2 as the highest level, I am having issues with it. I saw a forum post that a certain level of Swift and the tool chain would fix this. I attempted to install Swift 5.10.1 to then realize I only had Xcode 15.2 not 15.3, so I had to attempt to install Swift 5.9. Since neither option worked, I uninstalled Xcode and removed any extra files along with swift packages, minus my projects, to redownload and reinstall Xcode 15.2. Now I am having issues with building the scheme, and I get link error,s and they pertain to Swift 5.10.1, which I had not installed any Swift packages after the Xcode reinstallation. I have tried another previous project even a new one same error. This was 7/30/25, as of today 7/31 I tried to install Swift 5.9 thinking it would overwrite or "downgrade" the package, no such luck. The file path in the error stops at the /.../...RELEASE.pkg file and does not continue, which seems to be the issue of the error. How to I fix this issue, I had a working product 3 dyas ago
I'm unable to API such as NSFileProviderManager on MacOS catalyst although the developer site says this extension is supported. https://developer.apple.com/documentation/fileprovider
I've attempted to build a iOS framework to import into the catalyst target with no luck (I thought Catalyst was against the iOS API — maybe not?). Also attempted building a MacOS framework to import (maybe it's the other way around) but no luck.
Has anyone found a workaround? Building for "MacOS for iPad" does work but isn't ideal for the UI.
I'm building an open-source framework called OgreNextMain on macOS, and it statically links to an open-source library called FreeImage. When I run the nm -gU command on the binary within the resulting framework, I see lots of the symbols from FreeImage, but a couple that I wanted to use are missing. I thought, maybe they get stripped if they are not called by OgreNextMain, so I looked into stripping options. The "strip style" in the Xcode build settings for OgreNextMain is set to "debugging symbols". I tried setting the "additional strip flags" build setting to have the "-s" option and the path to a file containing the names of the symbols I want, but that didn't have any effect.
H there!
I'm new to mergeable libraries, so sorry if I missed anything obvious. We have some really huge projects with mergeable libraries that started failing to build with Xcode 26 beta 3. After doing some research I managed to create a very small project where I was able to reproduce the issues. The project just contains a SwiftUI app and a framework. The framework includes just a class that is used from a SwiftUI view included in the app.
Problems
I found the following:
Default configuration (no mergeable libraries)
Everything works as expected
Automatic mergeable libraries
In this case I just set Create Merged Binary to Automatic. In this case:
the application can be properly built and run in the simulator
the SwiftUI preview stops working with the following report:
== PREVIEW UPDATE ERROR:
FailedToAnalyzeBuiltTargetDescription: Could not analyze the built target description for MLibTestCase to create the preview.
buildableName: MLibTestCase
==================================
| UnrecognizedLinkerArguments: Unrecognized linker arguments
|
| arguments: -no_merge_framework
|
Manual mergeable libraries
In this case I set:
Create Merged Binary to Automatic in the app target
Build Mergeable Library to Yes in the library target
and I get exactly the same result as above. But if in addition I set:
MAKE_MERGEABLE to YES as a User-Defined setting in the library target
now things gets really worse, as:
linking no longer works, failing with the following error:
duplicate symbol '_relinkableLibraryClassesCount' in:
[...]/Build/Products/Debug-iphonesimulator/MLib.framework/MLib
bundle-file
duplicate symbol '_relinkableLibraryClasses' in:
[...]/Build/Products/Debug-iphonesimulator/MLib.framework/MLib
bundle-file
ld: 2 duplicate symbols
the SwiftUI preview fails, but now due to the error mentioned above:
== PREVIEW UPDATE ERROR:
SchemeBuildError: Failed to build the scheme “MLibTestCase”
linker command failed with exit code 1 (use -v to see invocation)
Conclusions, thoughts and doubts
After watching the WWDC session on mergeable libraries and reading the corresponding Apple documentation I got the feeling that Xcode would automatically manage mergeable libraries in both Debug and Release configurations, doing different things, but after performing this experiment with Xcode 26 beta 3 I'm no longer convinced that this is the case.
Anyway, our projects seemed to be working properly until Xcode 26 beta 2, using the last mentioned settings, this is, manual merged binary, with frameworks including the build mergeable library and MAKE_MERGEABLE settings.
In addition, the symbols causing the duplication error seem to be synthesized by the linker in the case of mergeable libraries, so it's weird to get this error related with something that the linker is supposed to manage automatically. And don't forget that Unrecognized linker argument...
So:
Has Xcode 26 beta 3 changed the way mergeable libraries are treated and configured, or is this a bug?
In case this is not a bug, are we now supposed to provide different settings for Debug and Release builds? (I could create a merged binary only in the Release configuration, but again, we didn't have to do this before this Xcode version)