tapi-tbdv5(1)
β¨ NAME β¨
okay so welcome to tapi-tbdv5(1), the TAPI TBD Version 5 Format Documentation β aka the manual for tbd, aka Text Based Dynamic Library Stub. Yes bestie, itβs giving βstub file but make it readableβ and weβre obsessed. π
π«Ά DESCRIPTION π«Ά
So TAPI both generates and operates over text based stub files (.tbd). These files are a textual, human readable representation of Mach-O dynamic libraries (dylib) holding properties needed to resolve static link time dependencies including the same exported symbols as the original dynamic library. Version 5 and onward are represented in JSON. Periodt. β¨
π REQUIRED KEYS π
These keys are not optional, bestie. Theyβre required. Put them in or the vibe check fails. π
tapi_tbd_versionβ<int>β Specifies the TBD file version. The only supported version is5. No cap.main_libraryβ<dict>β Specifies the linkage properties of the main dylib in the TBD.target_infoβ<array>β Specifies the supported targets of the dylib per target slice.targetβ<architecture-platform>β Specify the architecture and platform identifier supported by the dylib. Those identifiers are mapped to the platform number that is specified by the Mach-O format for theLC_BUILD_VERSIONload command. It is also possible to encode the platform with the platform number directly (for example:x86_64-maccatalyst). The following platform identifiers are supported:macos,maccatalyst,ios,ios-simulator,tvos,tvos-simulator,watchos,watchos-simulator.min_deploymentβ<version>β Specify the minimum deployment version to match the target for the dylib. This key is part of theLC_BUILD_VERSIONload command.install_namesβ<array>β Specifies the install name of the dylib per target slice. This key is part of theLC_ID_DYLIBload command in the Mach-O format. If targets section is omitted, the install name is the same for all targets recorded intarget_info.
π OPTIONAL KEYS π
These are the extra little accessories β cute but important. π
flagsβ<array>β Specifies the flags of the dylib per target slice. If targets section is omitted, the flags are the same for all targets recorded intarget_info. Valid flags are:flat_namespaceandnot_app_extension_safe.flat_namespaceis deprecated, but there are still some old binaries around on macOS that depend on flat namespace linking. The default is two level namespace linking.not_app_extension_safeindicates that the library is not safe to be used in an Application Extension.current_versionsβ<array>β Specifies the current version of the dylib per target slice. This key is part of theLC_ID_DYLIBload command in the Mach-O format. If targets section is omitted, the current version is the same for all targets recorded intarget_info. The default value is1.0if not specified.compatibility_versionsβ<array>β Specifies the compatibility version of the dylib per target slice. This key is part of theLC_ID_DYLIBload command in the Mach-O format. If targets section is omitted, the compatibility version is the same for all targets recorded intarget_info. The default value is1.0if not specified.swift_abiβ<array>β Specifies the Swift ABI version the dylib was compiled with per target slice. The Swift ABI version is encoded in the Objective-C image section, which doesn't exist in stubbed dynamic library files. If targets section is omitted, the compatibility version is the same for all targets recorded intarget_info. The default value is0if not specified.parent_umbrellasβ<array>β Specifies the parent umbrella of the dylib per target slice. This key is equivalent to theLC_SUB_FRAMEWORKload command in the Mach-O format. If targets section is omitted, the parent umbrella is the same for all targets recorded intarget_info.reexported_librariesβ<array>β Specifies the list of re-exported libraries of the dylib per target slice. This key is equivalent to theLC_REEXPORT_DYLIBload command in the Mach-O format. If targets section is omitted, the list of re-exported libraries are the same for all targets recorded intarget_info.rpathsβ<array>β Specifies the list of runpath search paths of the dylib per target slice. This key is equivalent to theLC_RPATHload command in the Mach-O format. If targets section is omitted, the list of runpath search paths are the same for all targets recorded intarget_info.exported_symbolsβ<array>β Specifies the regular export symbol sections. If targets section is omitted, the exports are the same for all targets recorded intarget_info.reexported_symbolsβ<array>β Specifies the export symbol sections, but these symbols are not defined by the library itself. Instead, these symbols come from a different library. If targets section is omitted, the re-exports are the same for all targets recorded intarget_info.undefined_symbolsβ<array>β Specifies the undefined symbol sections and are only used for flat address space libraries. If targets section is omitted, the undefineds are the same for all targets recorded intarget_info.textβ<dict>β Specifies the symbols defined in__TEXTsegment of the library.dataβ<dict>β Specifies the symbols defined in__DATAsegment of the library.globalβ<array>β Specifies a list of exported, re-exported, or undefined symbol names.weakβ<array>β Specifies the names of weak defined symbols for exported symbol sections or weak referenced symbols for undefined symbol sections.thread_localβ<array>β Specifies the symbol name of thread local exports.objc_classβ<array>β Specifies the list of exported, re-exported, or undefined Objective-C class names.objc_eh_typeβ<array>β Specifies the list of exported, re-exported or undefined Objective-C class exception type names.objc_ivarβ<array>β Specifies the list of exported, re-exported or undefined Objective-C instance variable names.librariesβ<dict>β Specifies the inlined tbd attributes for themain_library's reexported libraries.
π Examples π
Hereβs the whole look, bestie β copy it exactly if youβre following along:
{
"tapi_tbd_version": 5,
"main_library": {
"target_info": [
{
"target": "x86_64-macos",
"min_deployment": "10.14"
},
{
"target": "arm64-macos",
"min_deployment": "10.14"
},
{
"target": "arm64-maccatalyst",
"min_deployment": "12.1"
}
],
"flags":[
{
"targets": ["x86_64-macos"],
"attributes": ["flat_namespace"]
}
],
"install_names":[
{
"name":"/System/Library/Frameworks/Foundation.framework/Foundation"
}
],
"current_versions":[
{
"version": "1.2"
}
],
"compatibility_versions":[
{
"version": "1.1"
}
],
"rpaths": [
{
"targets": ["x86_64-macos"],
"paths": ["@executable_path/.../Frameworks"]
}
],
"parent_umbrellas": [
{
"umbrella": "System"
}
],
"allowable_clients": [
{
"clients": [
"ClientA",
"ClientB"
]
}
],
"reexported_libraries": [
{
"names": [
"/u/l/l/libfoo.dylib",
"/u/l/l/libbar.dylib"
]
}
],
"exported_symbols": [
{
"targets": ["x86_64-macos", "arm64-macos"],
"data": {
"global": ["_global"],
"objc_class": ["ClassA"],
"weak": [],
"thread_local": []
},
"text": {
"global": ["_func"],
"weak": [],
"thread_local": []
}
},
{
"targets": ["x86_64-macos"],
"data": {
"global": ["_globalVar"],
"objc_class": ["ClassData"],
"objc_eh_type": ["ClassA", "ClassB"],
"objc_ivar": [
"ClassA.ivar1", "ClassA.ivar2", "ClassC.ivar1"
]
},
"text": {
"global": ["_funcFoo"]
}
}
],
"reexported_symbols": [
{
"targets": ["x86_64-macos","arm64-macos"],
"data": {
"global": ["_globalRe"],
"objc_class": ["ClassRexport"]
},
"text": {
"global": ["_funcA"]
}
}
],
"undefined_symbols": [
{
"targets": ["x86_64-macos"],
"data": {
"global": ["_globalBind"],
"weak": ["referenced_sym"]
}
}
]
}
}
π SEE ALSO π
If youβre still hungry for more manual-page content, go read: tapi(1), tapi-tbdv4(1), ld(1), Mach-O(5). Slay. π¦
xoxo, Darwin π 2023-03-08 πΈ tapi-tbdv5(1)
π¦ where this page comes from
- nixos 26.05: libtapi 1600.0.11.8
- nixpkgs unstable: libtapi 1600.0.11.8
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms