Skip to content

Commit

Permalink
Merge pull request #19 from showxu/feature/787_1
Browse files Browse the repository at this point in the history
feat(objc4): Update for objc4-787.1, Xcode 12, Catalina
  • Loading branch information
showxu committed Nov 21, 2020
2 parents 750b3c7 + 5415dd3 commit 79cd5b9
Show file tree
Hide file tree
Showing 53 changed files with 2,464 additions and 823 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
-scheme ${{ matrix.scheme }} \
-configuration ${{ matrix.configuration }} \
-arch ${{ matrix.arch }} \
-sdk ${{ matrix.sdk }}
-sdk ${{ matrix.sdk }}
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![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)
![support](https://img.shields.io/badge/support-macOS%20%7C%20iOS-orange.svg)

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

- [Requirement](#Requirement)
- [Installation](#Installation)
Expand All @@ -15,8 +15,8 @@ This project is a buildable and debuggable version of latest Objective-C runtime


## **Requirement**
[![Xcode 11.3](https://img.shields.io/badge/Xcode-11.3-blue?colorA=3caefc&colorB=24292e)](https://developer.apple.com/xcode/)
[![macOS Catalina](https://img.shields.io/badge/macOS-Catalina-blue?colorA=blueviolet&colorB=24292e)](https://developer.apple.com/macos/)
[![Xcode 12](https://img.shields.io/badge/Xcode-12-blue?colorA=1A5DE3&colorB=2A2C3A)](https://developer.apple.com/xcode/)
[![macOS Catalina](https://img.shields.io/badge/macOS-Catalina-blue?colorA=314C78&colorB=181B2D)](https://developer.apple.com/macos/)


## **Installation**
Expand All @@ -30,7 +30,7 @@ After building the **objc scheme**, manually integrate generated `libobjc.A.dyli


## **objc4 tarballs**
- [objc4-781](https://opensource.apple.com/tarballs/objc4/objc4-781.tar.gz)
- [objc4-787.1](https://opensource.apple.com/tarballs/objc4/objc4-787.1.tar.gz)
- [xnu-6153.41.3](https://opensource.apple.com/tarballs/xnu/xnu-6153.41.3.tar.gz)
- [Libc-1353.41.1](https://opensource.apple.com/tarballs/Libc/Libc-1353.41.1.tar.gz)
- [dyld-733.6](https://opensource.apple.com/tarballs/dyld/dyld-733.6.tar.gz)
Expand Down Expand Up @@ -59,7 +59,7 @@ After building the **objc scheme**, manually integrate generated `libobjc.A.dyli
| objc-os.h | `#include <crt_externs.h>` | /Libc-1353.41.1/include/crt_externs.h |
| objc-runtime-new.mm | `#include <mach/shared_region.h>` | /xnu-6153.41.3/osfmk/mach/shared_region.h |
| objc-cache.mm | `#include <kern/restartable.h>` | /xnu-6153.41.3/osfmk/mach/restartable.defs, build from xnu kernel |
| objc-os.h | `#include <CrashReporterClient.h>` | /Libc-825.24/include/CrashReporterClient.h |
| objc-os.h | `#include_next <CrashReporterClient.h>` => `#include <CrashReporterClient.h>` | /Libc-825.24/include/CrashReporterClient.h |

#### Private Header Included Header
| private header | #include | tarball |
Expand All @@ -69,10 +69,12 @@ After building the **objc scheme**, manually integrate generated `libobjc.A.dyli
| lock_private.h | `#include <pthread/tsd_private.h>` | /libpthread-416.40.3/private/tsd_private.h |
| workqueue_private.h | `#include <pthread/qos_private.h>` | /llibpthread-416.40.3/private/qos_private.h |
| qos_private.h | `#include <sys/qos_private.h>` | /libpthread-416.40.3/sys/qos_private.h |
| objc-exception.mm | `#include <objc/objc-abi.h>` | removed |
| objc-gdb.h | `#include <objc/maptable.h>` | removed |

#### Bridge OS

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

#### dyld

Expand All @@ -86,12 +88,12 @@ In latest dyld-733.6 (dyld-421.2 later), apple use this [ruby script](https://op
## **Build Setting**
| Declaration | Value |
|-------------|-------|
| `HEADER_SEARCH_PATHS` | $(SRCROOT)/../macosx.internal/System/Library/Frameworks/System.framework/PrivateHeaders |
| `GCC_PREPROCESSOR_DEFINITIONS` | LIBC_NO_LIBCRASHREPORTERCLIENT |
| `HEADER_SEARCH_PATHS` | $(SRCROOT)/../macosx.internal/System/Library/Frameworks/System.framework/PrivateHeaders, also append `$(inherited)` to target objc |
| `GCC_PREPROCESSOR_DEFINITIONS` | LIBC_NO_LIBCRASHREPORTERCLIENT, also append `$(inherited)` to target objc |
| `ORDER_FILE` | $(SRCROOT)/libobjc.order |
| `OTHER_LDFLAGS[sdk=macosx*]` | -lc++abi -Xlinker -sectalign -Xlinker __DATA -Xlinker __objc_data -Xlinker 0x1000 -Xlinker -interposable_list -Xlinker interposable.txt |
| `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 -isystem -iframework |
| `OTHER_LDFLAGS[sdk=iphonesimulator*][arch=*]` | -lc++abi -Xlinker -interposable_list -Xlinker interposable.txt |
| `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 |
| `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 |
| `OTHER_LDFLAGS[sdk=iphonesimulator*][arch=*]` | -lc++abi -Xlinker -interposable_list -Xlinker interposable.txt, remove build setting in target objc |

### Run Script
Evidently 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.
Expand Down
13 changes: 10 additions & 3 deletions inspect/objc-inspect.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
335562AE1FE3A17F00BD601B /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1220;
ORGANIZATIONNAME = alchemistxxd;
TargetAttributes = {
33B571A31FE3A49100FCE649 = {
Expand All @@ -124,6 +124,7 @@
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 335562AD1FE3A17F00BD601B;
productRefGroup = 335562AD1FE3A17F00BD601B;
Expand Down Expand Up @@ -162,15 +163,18 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -219,15 +223,18 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -257,7 +264,7 @@
33B571A91FE3A49100FCE649 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "";
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -268,7 +275,7 @@
33B571AA1FE3A49100FCE649 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "";
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1130"
LastUpgradeVersion = "1220"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#else /* !LIBC_NO_LIBCRASHREPORTERCLIENT */

/* Include the real CrashReporterClient.h */
#include_next <CrashReporterClient.h>
#include <CrashReporterClient.h>

#endif /* !LIBC_NO_LIBCRASHREPORTERCLIENT */

Expand Down
2 changes: 1 addition & 1 deletion objc.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ ORDER_FILE = $(SRCROOT)/libobjc.order
// resolve ld: library not found for -lCrashReporterClient clang: error: linker command failed with exit code 1 (use -v to see invocation)
// OTHER_LDFLAGS[sdk=macosx*] = -lCrashReporterClient -lc++abi -Xlinker -sectalign -Xlinker __DATA -Xlinker __objc_data -Xlinker 0x1000 -Xlinker -interposable_list -Xlinker interposable.txt
OTHER_LDFLAGS[sdk=macosx*] = -lc++abi -Xlinker -sectalign -Xlinker __DATA -Xlinker __objc_data -Xlinker 0x1000 -Xlinker -interposable_list -Xlinker interposable.txt
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 -isystem -iframework
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
OTHER_LDFLAGS[sdk=iphonesimulator*][arch=*] = -lc++abi -Xlinker -interposable_list -Xlinker interposable.txt
2 changes: 0 additions & 2 deletions objc4/libobjc.order
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ __objc_update_stubs_in_mach_header
_sel_init
___sel_registerName
__objc_search_builtins
__ZNK8objc_opt13objc_selopt_t3getEPKc
__ZNK8objc_opt13objc_selopt_t4hashEPKc
_sel_registerName
_arr_init
__ZN4objc8DenseMapIP11objc_objectmLb1ENS_12DenseMapInfoIS2_EENS3_ImEEE4initEj
Expand Down
Loading

0 comments on commit 79cd5b9

Please sign in to comment.