dyld shared cache info

Can someone actually explain me what dyld_shared_cache_x86_64 and other files located at /System/Library/dyld are? I know that dyld is the dynamic libraries loader which recursively load required dylib into memory for every launched process but i still dont get what dyld_cache and aot_cache exactly are? I'm looking to a detailed explanation about those.

Answered by DTS Engineer in 691751022

On macOS the exact nature of the dyld shared cache has changed over time. Unless otherwise stated, the following assumes macOS 11.

The dyld shared cache is slightly misnamed because it’s not actually a cache [1]. Rather, it’s part of macOS’s mastering process. When Apple builds macOS we take all the commonly-used dynamic libraries and pre-link them together into a single shared file. This allows for many optimisations that improve app startup time.

The AOT cache relates to dyld 3’s closure formation.

For a bunch of backstory here, see WWDC 2017 Session 413 App Startup Time: Past, Present, and Future.

IMPORTANT This stuff is all implementation detail. It has changed radically in the past and it’s likely to change again in the future (indeed, macOS 12 beta has dyld 4, with even more changes). Based on your other thread it sounds like you plan to create a product around this, and that’s not something we’d support.

Share and Enjoy

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

[1] It was back in the day but that’s no longer true.

Accepted Answer

On macOS the exact nature of the dyld shared cache has changed over time. Unless otherwise stated, the following assumes macOS 11.

The dyld shared cache is slightly misnamed because it’s not actually a cache [1]. Rather, it’s part of macOS’s mastering process. When Apple builds macOS we take all the commonly-used dynamic libraries and pre-link them together into a single shared file. This allows for many optimisations that improve app startup time.

The AOT cache relates to dyld 3’s closure formation.

For a bunch of backstory here, see WWDC 2017 Session 413 App Startup Time: Past, Present, and Future.

IMPORTANT This stuff is all implementation detail. It has changed radically in the past and it’s likely to change again in the future (indeed, macOS 12 beta has dyld 4, with even more changes). Based on your other thread it sounds like you plan to create a product around this, and that’s not something we’d support.

Share and Enjoy

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

[1] It was back in the day but that’s no longer true.

I could hypothetically delete it on my intel chip macbook

I’m not going to get into discussions about what is hypothetically possible or not. The shared cache files are considered part of the OS install, and modifying the base OS install is not something that DTS is going to support [1].

Share and Enjoy

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

[1] To be clear, I’m speaking from a DTS perspective here. It is possible for a user to unseal the system volume, modify it, and then re-seal it. I’m not sure whether Apple Support would support that at a user level but speaking for DTS we won’t support products that use this approach because our goal is to help developers create products that are viable in the long term.

dyld shared cache info
 
 
Q