{"id":13992784,"url":"https://github.com/showxu/objc4","last_synced_at":"2026-01-27T03:37:15.656Z","repository":{"id":41085124,"uuid":"113964276","full_name":"showxu/objc4","owner":"showxu","description":"A latest buildable and debuggable Objective-C runtime (objc4-818.2) project. ","archived":false,"fork":false,"pushed_at":"2022-05-14T10:22:50.000Z","size":1279,"stargazers_count":541,"open_issues_count":6,"forks_count":92,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-02T11:18:14.615Z","etag":null,"topics":["dyld","objc","objc-723","objc-779","objc-781","objc-787","objc-818","objc-818-2","objc-runtime","objc4","objc4-723","objc4-779","objc4-781","objc4-787","objc4-818","objc4-818-2","objc4-runtime","runtime","xnu"],"latest_commit_sha":null,"homepage":"https://opensource.apple.com/tarballs/objc4/","language":"Objective-C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/showxu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"showxdxu","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2017-12-12T08:32:36.000Z","updated_at":"2025-02-23T09:33:38.000Z","dependencies_parsed_at":"2022-08-03T12:20:34.846Z","dependency_job_id":null,"html_url":"https://github.com/showxu/objc4","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/showxu/objc4","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/showxu%2Fobjc4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/showxu%2Fobjc4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/showxu%2Fobjc4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/showxu%2Fobjc4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/showxu","download_url":"https://codeload.github.com/showxu/objc4/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/showxu%2Fobjc4/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28799861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T03:37:11.304Z","status":"ssl_error","status_checked_at":"2026-01-27T03:37:10.427Z","response_time":168,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dyld","objc","objc-723","objc-779","objc-781","objc-787","objc-818","objc-818-2","objc-runtime","objc4","objc4-723","objc4-779","objc4-781","objc4-787","objc4-818","objc4-818-2","objc4-runtime","runtime","xnu"],"created_at":"2024-08-09T14:02:08.145Z","updated_at":"2026-01-27T03:37:15.639Z","avatar_url":"https://github.com/showxu.png","language":"Objective-C++","readme":"\r\n# objc4 runtime\r\n\r\n### [简体中文](README_zh-CN.md)\r\n\r\n![build_status](https://github.com/showxu/objc4/workflows/build/badge.svg) \r\n[![Join the chat at https://gitter.im/showxu/objc4](https://badges.gitter.im/showxu/objc4.svg)](https://gitter.im/showxu/objc4?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge) \r\n![support](https://img.shields.io/badge/support-macOS%20%7C%20iOS-orange.svg)\r\n\r\nThis project is a buildable and debuggable version of latest Objective-C runtime (**objc4-818.2**) on [Apple Open Source](https://opensource.apple.com/tarballs/objc4/)\r\n\r\n- [Which version to use](#Which-Version-To-Use)\r\n- [Installation](#Installation)\r\n- [Usage](#Usage)\r\n- [objc4 tarballs](#objc4-tarballs)\r\n- [Build Phases](#Build-Phases)\r\n- [Build Setting](#build-setting)\r\n- [License](#license)\r\n\r\n\r\n## **Which Version To Use**\r\n\r\n| macOS | macOS Version | Xcode Version | objc4 tarball version |\r\n| - | - | - | - |\r\n| [![macOS Big Sur](https://img.shields.io/badge/macOS-Big%20Sur-blue?colorA=d23a70\u0026colorB=181B2D)](https://developer.apple.com/macos/) | ![macOS Version](https://img.shields.io/badge/-11.0.1%20-181B2D) | [![Xcode 12.3](https://img.shields.io/badge/Xcode-12.3-blue?colorA=1A5DE3\u0026colorB=2A2C3A)](https://developer.apple.com/xcode/) | [objc4-818.2](https://github.com/showxu/objc4/releases/tag/objc4-818.2) |\r\n| [![macOS Catalina](https://img.shields.io/badge/macOS-Catalina-blue?colorA=314C78\u0026colorB=181B2D)](https://developer.apple.com/macos/) | ![macOS Version](https://img.shields.io/badge/-10.15.4%20~%2010.15.6-181B2D) | [![Xcode 12.0](https://img.shields.io/badge/Xcode-12.0-blue?colorA=1A5DE3\u0026colorB=2A2C3A)](https://developer.apple.com/xcode/) | [objc4-787.1](https://github.com/showxu/objc4/releases/tag/objc4-787.1) |\r\n| [![macOS Catalina](https://img.shields.io/badge/macOS-Catalina-blue?colorA=314C78\u0026colorB=181B2D)](https://developer.apple.com/macos/) | ![macOS Version](https://img.shields.io/badge/-10.15.1-181B2D) | [![Xcode 11.1](https://img.shields.io/badge/Xcode-11.1-blue?colorA=1A8DF8\u0026colorB=2A2C3A)](https://developer.apple.com/xcode/) | [objc4-781](https://github.com/showxu/objc4/releases/tag/objc4-781) | \r\n| [![macOS High Sierra](https://img.shields.io/badge/macOS-High%20Sierra-blue?colorA=CC4027\u0026colorB=181B2D)](https://developer.apple.com/macos/) | ![macOS Version](https://img.shields.io/badge/-10.13.x-181B2D) | [![Xcode 10.1](https://img.shields.io/badge/Xcode-10.1-blue?colorA=1A8DF8\u0026colorB=2A2C3A)](https://developer.apple.com/xcode/) | [objc4-723](https://github.com/showxu/objc4/releases/tag/objc4-723) |\r\n\r\n\r\n## **Installation**\r\n\r\n#### Manually\r\n\r\nDownload zip or clone this repo, select **objc scheme** and build.\r\n\r\n\r\n## **Usage**\r\n\r\nAfter building the **objc scheme**, manually integrate generated `libobjc.A.dylib` into your project manually. Or you can use **objc-inspect** scheme which is a preset inspector for debugging objc4 runtime.\r\n\r\n\r\n## **objc4 tarballs**\r\n\r\n- [objc4-818.2](https://opensource.apple.com/tarballs/objc4/objc4-818.2.tar.gz)\r\n- [xnu-7195.50.7.100.1](https://opensource.apple.com/tarballs/xnu/xnu-7195.50.7.100.1.tar.gz)\r\n- [Libc-1439.40.11](https://opensource.apple.com/tarballs/Libc/Libc-1439.40.11.tar.gz)\r\n- [dyld-832.7.1](https://opensource.apple.com/tarballs/dyld/dyld-832.7.1.tar.gz)\r\n- [libauto-187.tar.gz](https://opensource.apple.com/tarballs/libauto/libauto-187.tar.gz)\r\n- [libclosure-74](https://opensource.apple.com/tarballs/libclosure/libclosure-74.tar.gz)\r\n- [libdispatch-1173.40.5](https://opensource.apple.com/tarballs/libdispatch/libdispatch-1173.40.5.tar.gz)\r\n- [libplatform-220](https://opensource.apple.com/tarballs/libplatform/libplatform-220.tar.gz)\r\n- [libpthread-416.40.3](https://opensource.apple.com/tarballs/libpthread/libpthread-416.40.3.tar.gz)\r\n\r\n\r\n## **Build Phases**\r\n\r\n#### Private Header \r\n\r\n| objc header | #include | tarball |\r\n|------|--------|---------|\r\n| objc-os.h | `#include \u003csys/reason.h\u003e` | /xnu-6153.41.3/bsd/sys/reason.h |\r\n| objc-os.h | `#include \u003cmach-o/dyld_priv.h\u003e` | /dyld-733.6/include/mach-o/dyld_priv.h |\r\n| objc-os.h | `#include \u003cos/lock_private.h\u003e` | /libplatform-220/private/os/lock_private.h |\r\n| lock_private.h | `#include \u003cos/base_private.h\u003e` | /libplatform-220/private/os/base_private.h |\r\n| objc-os.h | `#include \u003cSystem/pthread_machdep.h\u003e` | removed in latest Libc tarball (Libc-1353.41.1), this header should be commented-out |\r\n| objc-class.mm | `#include \u003cos/linker_set.h\u003e` | /xnu-7195.50.7.100.1/os/linker_set.h |\r\n| pthread_machdep.h | `#include \u003cSystem/machine/cpu_capabilities.h\u003e` | /xnu-6153.41.3/osfmk/machine/cpu_capabilities.h |\r\n| objc-os.h | `#include \u003cpthread/workqueue_private.h\u003e` | /libpthread-416.40.3/private/workqueue_private.h | \r\n| objc-os.h | `#include \u003cobjc-shared-cache.h\u003e` | /dyld-733.6/include/objc-shared-cache.h | \r\n| objc-errors.mm | `#include \u003c_simple.h\u003e` | /libplatform-220/private/_simple.h | \r\n| objc-block-trampolines.mm | `#include \u003cBlock_private.h\u003e` | /libclosure-74/Block_private.h |\r\n| objc-os.h | `#include \u003ccrt_externs.h\u003e` | /Libc-1353.41.1/include/crt_externs.h |\r\n| objc-runtime-new.mm | `#include \u003cmach/shared_region.h\u003e` | /xnu-6153.41.3/osfmk/mach/shared_region.h |\r\n| objc-cache.mm  | `#include \u003ckern/restartable.h\u003e` | /xnu-6153.41.3/osfmk/mach/restartable.defs, build from xnu kernel |\r\n| objc-os.h | `#include_next \u003cCrashReporterClient.h\u003e` =\u003e `#include \u003cCrashReporterClient.h\u003e` | /Libc-825.24/include/CrashReporterClient.h | \r\n| NSObject.mm | `#include \u003cos/reason_private.h\u003e` | /xnu-7195.50.7.100.1/os/reason_private |\r\n| NSObject.mm | `#include \u003cos/variant_private.h\u003e` | /xnu-7195.50.7.100.1/os/reason_private |\r\n| objc-exception.mm | `#include \u003cobjc/objc-abi.h\u003e` | removed |\r\n| objc-gdb.h | `#include \u003cobjc/maptable.h\u003e` | removed |\r\n\r\n\r\n#### Private Header Included Header\r\n\r\n| private header | #include | tarball |\r\n|------|--------|---------|\r\n| tsd_private.h | `#include \u003cos/tsd.h\u003e` | /xnu-6153.41.3/libsyscall/os/tsd.h |\r\n| tsd_private.h | `#include \u003cpthread/spinlock_private.h\u003e` | /libpthread-416.40.3/private/spinlock_private.h |\r\n| lock_private.h | `#include \u003cpthread/tsd_private.h\u003e` | /libpthread-416.40.3/private/tsd_private.h |\r\n| workqueue_private.h | `#include \u003cpthread/qos_private.h\u003e` | /llibpthread-416.40.3/private/qos_private.h |\r\n| qos_private.h | `#include \u003csys/qos_private.h\u003e`  | /libpthread-416.40.3/sys/qos_private.h |\r\n\r\n\r\n#### Bridge OS\r\n\r\nIn public macosx sdk (latest Xcode 12.3), bridgeos (e.g. `__has_feature(attribute_availability_bridgeos)`) is unavailable, bridgeos availability should be removed or commented-out.\r\n\r\n\r\n#### dyld\r\n\r\nIn latest dyld-733.6 (dyld-421.2 later), apple use this [ruby script](https://opensource.apple.com/source/dyld/dyld-733.6/bin/expand.rb) to expand versions, platfrom versions from a `versionSets` which defined in a YAML file, code generated by this script will be inserted after `@MAC_VERSION_DEFS@`, `@IOS_VERSION_DEFS@`, `@WATCHOS_VERSION_DEFS@`, `@TVOS_VERSION_DEFS@` and `@BRIDGEOS_VERSION_DEFS@` in `dyld_priv.h`. For more detail please refer to [dyld](https://opensource.apple.com/source/dyld).\r\n\r\n\r\n#### XNU\r\n\r\n`\u003ckern/restartable.h\u003e` is generated form `restartable.defs` in xnu tarball during building xun kernel, which is a little different from the one that shipped with public sdk that located in `/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/kern/restartable.h`.\r\n\r\n\r\n#### Cambria framework\r\n\r\nHave no idea about this framework so far, maybe related with `-loah` for lib `oah`. Related Code should be commented out for now.\r\n\r\n```objc\r\n// File objc-cache.mm\r\n// \r\n// Line 87 ~ 88\r\n#include \u003cCambria/Traps.h\u003e\r\n#include \u003cCambria/Cambria.h\u003e\r\n// \r\n// ···\r\n//\r\n// Line 1121 ～ 1128 \r\nif (oah_is_current_process_translated()) {\r\n    kern_return_t ret = objc_thread_get_rip(threads[count], (uint64_t*)\u0026pc);\r\n    if (ret != KERN_SUCCESS) {\r\n        pc = PC_SENTINEL;\r\n    }\r\n} else {\r\n    pc = _get_pc_for_thread (threads[count]);\r\n}\r\n```\r\n\r\n\r\n#### `#include \u003cos/feature_private.h\u003e`\r\n\r\nHave no idea about this haeder so far. Related Code should be commented out for now.\r\n\r\n```objc\r\n// File objc-runtime.mm\r\n// \r\n// ···\r\n//\r\n// Line 36\r\n#include \u003cos/feature_private.h\u003e // os_feature_enabled_simple()\r\n//\r\n// ···\r\n//\r\n// Line 444 ～ 446\r\nif (!os_feature_enabled_simple(objc4, preoptimizedCaches, true)) {\r\n    DisablePreoptCaches = true;\r\n}\r\n// \r\n```\r\n\r\n\r\n#### `dyld_fall_2020_os_versions`, `dyld_fall_2018_os_versions`\r\n\r\nFound releated source in `xnu-7195.50.7.100.1/bsd/kern/kern_mman.c`. \r\n\r\n```c\r\nstatic uint32_t\r\nproc_2020_fall_os_sdk(void)\r\n```\r\n\r\nMaybe these function is releated to dyld build-scripts. Comment out for now.\r\n\r\n\r\n#### `dyld_platform_version_macOS_`, `dyld_platform_version_iOS_`, `dyld_platform_version_tvOS_`, `dyld_platform_version_watchOS_`, `dyld_platform_version_bridgeOS_`\r\n\r\nThis Marco is generated by [dyld build-scripts](https://opensource.apple.com/source/dyld/dyld-832.7.1/build-scripts/), comment out for now.\r\n\r\n\r\n#### `STATIC_ASSERT`\r\n\r\n```bash\r\nobjc4/runtime/objc-runtime-new.mm:176:1: '_static_assert' declared as an array with a negative size\r\n```\r\n\r\nComment out for now.\r\n\r\n\r\n## **Build Setting**\r\n| Declaration | Value |\r\n|-------------|-------|\r\n| `HEADER_SEARCH_PATHS` | $(SRCROOT)/../macosx.internal/System/Library/Frameworks/System.framework/PrivateHeaders, also append `$(inherited)` to target objc |\r\n| `GCC_PREPROCESSOR_DEFINITIONS` | LIBC_NO_LIBCRASHREPORTERCLIENT, also append `$(inherited)` to target objc |\r\n| `ORDER_FILE` | $(SRCROOT)/libobjc.order |\r\n| `OTHER_LDFLAGS[sdk=macosx*]` | -lc++abi -Xlinker -sectalign -Xlinker __DATA -Xlinker __objc_data -Xlinker 0x1000 -Xlinker -interposable_list -Xlinker interposable.txt, remove build setting in target objc |\r\n| `OTHER_LDFLAGS[sdk=iphoneos*][arch=*]` | -lc++abi -Wl,-segalign,0x4000 -Xlinker -sectalign -Xlinker __DATA -Xlinker __objc_data -Xlinker 0x1000 -Xlinker -interposable_list -Xlinker interposable.txt, remove build setting in target objc |\r\n| `OTHER_LDFLAGS[sdk=iphonesimulator*][arch=*]` | -lc++abi -Xlinker -interposable_list -Xlinker interposable.txt, remove build setting in target objc |\r\n\r\n\r\n### Run Script\r\nEvidently public macosx sdk is our only choice, we need to update value of parameter `-sdk` from `macosx.internal` to `macosx` in run script of objc target. \r\n\r\n\r\n## License\r\nThis project is released under the **MIT License**. The objc4 project is released under the **APPLE PUBLIC SOURCE LICENSE Version 2.0**.\r\n","funding_links":["https://ko-fi.com/showxdxu"],"categories":["Objective-C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshowxu%2Fobjc4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshowxu%2Fobjc4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshowxu%2Fobjc4/lists"}