Skip to content

Commit 233e27e

Browse files
committed
feat: Add support to objc4-818.2 #17 #20
1 parent abf556a commit 233e27e

File tree

151 files changed

+6527
-1935
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+6527
-1935
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- 'LICENSE'
77
jobs:
88
build:
9-
runs-on: macos-10.15
9+
runs-on: macos-11.0
1010
strategy:
1111
max-parallel: 2
1212
matrix:

README.md

Lines changed: 85 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Join the chat at https://gitter.im/showxu/objc4](https://badges.gitter.im/showxu/objc4.svg)](https://gitter.im/showxu/objc4?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
44
![support](https://img.shields.io/badge/support-macOS%20%7C%20iOS-orange.svg)
55

6-
This project is a buildable and debuggable version of latest Objective-C runtime (**objc4-787.1**) on [Apple Open Source](https://opensource.apple.com/tarballs/objc4/)
6+
This 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/)
77

88
- [Requirement](#Requirement)
99
- [Installation](#Installation)
@@ -15,11 +15,12 @@ This project is a buildable and debuggable version of latest Objective-C runtime
1515

1616

1717
## **Requirement**
18-
[![Xcode 12](https://img.shields.io/badge/Xcode-12-blue?colorA=1A5DE3&colorB=2A2C3A)](https://developer.apple.com/xcode/)
19-
[![macOS Catalina](https://img.shields.io/badge/macOS-Catalina-blue?colorA=314C78&colorB=181B2D)](https://developer.apple.com/macos/)
18+
[![Xcode 12.3](https://img.shields.io/badge/Xcode-12.3-blue?colorA=1A5DE3&colorB=2A2C3A)](https://developer.apple.com/xcode/)
19+
[![macOS Big Sur](https://img.shields.io/badge/macOS-Big%20Sur-blue?colorA=d23a70&colorB=181B2D)](https://developer.apple.com/macos/)
2020

2121
| macOS | Version | objc4 tarball version |
2222
|------|--------| ---- |
23+
| [![macOS Big Sur](https://img.shields.io/badge/macOS-Big%20Sur-blue?colorA=d23a70&colorB=181B2D)](https://developer.apple.com/macos/) | ![macOS Version](https://img.shields.io/badge/-11.0.1%20-181B2D) | [objc4-818.2](https://github.com/showxu/objc4/releases/tag/objc4-818.2) |
2324
| [![macOS Catalina](https://img.shields.io/badge/macOS-Catalina-blue?colorA=314C78&colorB=181B2D)](https://developer.apple.com/macos/) | ![macOS Version](https://img.shields.io/badge/-10.15.4%20~%2010.15.6-181B2D) | [objc4-787.1](https://github.com/showxu/objc4/releases/tag/objc4-787.1) |
2425
| [![macOS Catalina](https://img.shields.io/badge/macOS-Catalina-blue?colorA=314C78&colorB=181B2D)](https://developer.apple.com/macos/) | ![macOS Version](https://img.shields.io/badge/-10.15.1-181B2D) | [objc4-781](https://github.com/showxu/objc4/releases/tag/objc4-781) |
2526
| [![macOS High Sierra](https://img.shields.io/badge/macOS-High%20Sierra-blue?colorA=CC4027&colorB=181B2D)](https://developer.apple.com/macos/) | ![macOS Version](https://img.shields.io/badge/-10.13.x-181B2D) | [objc4-723](https://github.com/showxu/objc4/releases/tag/objc4-723) |
@@ -35,10 +36,10 @@ After building the **objc scheme**, manually integrate generated `libobjc.A.dyli
3536

3637

3738
## **objc4 tarballs**
38-
- [objc4-787.1](https://opensource.apple.com/tarballs/objc4/objc4-787.1.tar.gz)
39-
- [xnu-6153.41.3](https://opensource.apple.com/tarballs/xnu/xnu-6153.41.3.tar.gz)
40-
- [Libc-1353.41.1](https://opensource.apple.com/tarballs/Libc/Libc-1353.41.1.tar.gz)
41-
- [dyld-733.6](https://opensource.apple.com/tarballs/dyld/dyld-733.6.tar.gz)
39+
- [objc4-818.2](https://opensource.apple.com/tarballs/objc4/objc4-818.2.tar.gz)
40+
- [xnu-7195.50.7.100.1](https://opensource.apple.com/tarballs/xnu/xnu-7195.50.7.100.1.tar.gz)
41+
- [Libc-1439.40.11](https://opensource.apple.com/tarballs/Libc/Libc-1439.40.11.tar.gz)
42+
- [dyld-832.7.1](https://opensource.apple.com/tarballs/dyld/dyld-832.7.1.tar.gz)
4243
- [libauto-187.tar.gz](https://opensource.apple.com/tarballs/libauto/libauto-187.tar.gz)
4344
- [libclosure-74](https://opensource.apple.com/tarballs/libclosure/libclosure-74.tar.gz)
4445
- [libdispatch-1173.40.5](https://opensource.apple.com/tarballs/libdispatch/libdispatch-1173.40.5.tar.gz)
@@ -56,6 +57,7 @@ After building the **objc scheme**, manually integrate generated `libobjc.A.dyli
5657
| objc-os.h | `#include <os/lock_private.h>` | /libplatform-220/private/os/lock_private.h |
5758
| lock_private.h | `#include <os/base_private.h>` | /libplatform-220/private/os/base_private.h |
5859
| objc-os.h | `#include <System/pthread_machdep.h>` | removed in latest Libc tarball (Libc-1353.41.1), this header should be commented-out |
60+
| objc-class.mm | `#include <os/linker_set.h>` | /xnu-7195.50.7.100.1/os/linker_set.h |
5961
| pthread_machdep.h | `#include <System/machine/cpu_capabilities.h>` | /xnu-6153.41.3/osfmk/machine/cpu_capabilities.h |
6062
| objc-os.h | `#include <pthread/workqueue_private.h>` | /libpthread-416.40.3/private/workqueue_private.h |
6163
| objc-os.h | `#include <objc-shared-cache.h>` | /dyld-733.6/include/objc-shared-cache.h |
@@ -65,6 +67,8 @@ After building the **objc scheme**, manually integrate generated `libobjc.A.dyli
6567
| objc-runtime-new.mm | `#include <mach/shared_region.h>` | /xnu-6153.41.3/osfmk/mach/shared_region.h |
6668
| objc-cache.mm | `#include <kern/restartable.h>` | /xnu-6153.41.3/osfmk/mach/restartable.defs, build from xnu kernel |
6769
| objc-os.h | `#include_next <CrashReporterClient.h>` => `#include <CrashReporterClient.h>` | /Libc-825.24/include/CrashReporterClient.h |
70+
| NSObject.mm | `#include <os/reason_private.h>` | /xnu-7195.50.7.100.1/os/reason_private |
71+
| NSObject.mm | `#include <os/variant_private.h>` | /xnu-7195.50.7.100.1/os/reason_private |
6872
| objc-exception.mm | `#include <objc/objc-abi.h>` | removed |
6973
| objc-gdb.h | `#include <objc/maptable.h>` | removed |
7074

@@ -79,7 +83,7 @@ After building the **objc scheme**, manually integrate generated `libobjc.A.dyli
7983

8084
#### Bridge OS
8185

82-
In public macosx sdk (latest Xcode 12.2), bridgeos (e.g. `__has_feature(attribute_availability_bridgeos)`) is unavailable, bridgeos availability should be removed or commented-out.
86+
In 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.
8387

8488
#### dyld
8589

@@ -89,6 +93,79 @@ In latest dyld-733.6 (dyld-421.2 later), apple use this [ruby script](https://op
8993

9094
`<kern/restartable.h>` 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`.
9195

96+
#### Cambria framework
97+
98+
Have no idea about this framework so far, maybe related with `-loah` for lib `oah`. Related Code should be commented out for now.
99+
100+
```objc
101+
// File objc-cache.mm
102+
//
103+
// Line 87 ~ 88
104+
#include <Cambria/Traps.h>
105+
#include <Cambria/Cambria.h>
106+
//
107+
// ···
108+
//
109+
// Line 1121 ~ 1128
110+
if (oah_is_current_process_translated()) {
111+
kern_return_t ret = objc_thread_get_rip(threads[count], (uint64_t*)&pc);
112+
if (ret != KERN_SUCCESS) {
113+
pc = PC_SENTINEL;
114+
}
115+
} else {
116+
pc = _get_pc_for_thread (threads[count]);
117+
}
118+
```
119+
120+
#### `#include <os/feature_private.h>`
121+
122+
Have no idea about this haeder so far. Related Code should be commented out for now.
123+
124+
```objc
125+
// File objc-runtime.mm
126+
//
127+
// Line 87 ~ 88
128+
#include <Cambria/Traps.h>
129+
#include <Cambria/Cambria.h>
130+
//
131+
// ···
132+
//
133+
// Line 36
134+
#include <os/feature_private.h> // os_feature_enabled_simple()
135+
//
136+
// ···
137+
//
138+
// Line 444 ~ 446
139+
if (!os_feature_enabled_simple(objc4, preoptimizedCaches, true)) {
140+
DisablePreoptCaches = true;
141+
}
142+
//
143+
```
144+
145+
#### `dyld_fall_2020_os_versions`, dyld_fall_2018_os_versions
146+
147+
Found releated header in `xnu-7195.50.7.100.1/bsd/kern/kern_mman.c`.
148+
149+
```c
150+
static uint32_t
151+
proc_2020_fall_os_sdk(void)
152+
```
153+
154+
Maybe these function is releated to dyld build-scripts. Comment out for now.
155+
156+
#### `dyld_platform_version_macOS_`, `dyld_platform_version_iOS_`, `dyld_platform_version_tvOS_`, `dyld_platform_version_watchOS_`, `dyld_platform_version_bridgeOS_`
157+
158+
This Marco is generated by [dyld build-scripts](https://opensource.apple.com/source/dyld/dyld-832.7.1/build-scripts/),comment out for now.
159+
160+
161+
#### `STATIC_ASSERT`
162+
163+
```bash
164+
objc4/runtime/objc-runtime-new.mm:176:1: '_static_assert' declared as an array with a negative size
165+
```
166+
167+
Comment out for now.
168+
92169

93170
## **Build Setting**
94171
| Declaration | Value |

0 commit comments

Comments
 (0)