All Projects → 0xxd0 → Objc4

0xxd0 / Objc4

Licence: mit
A latest buildable and debuggable Objective-C runtime (objc4-818.2) project.

Programming Languages

objc
23 projects

Labels

Projects that are alternatives of or similar to Objc4

therapi-runtime-javadoc
Read Javadoc comments at run time.
Stars: ✭ 50 (-84.89%)
Mutual labels:  runtime
Dynamic Struct
Golang package for editing struct's fields during runtime and mapping structs to other structs.
Stars: ✭ 257 (-22.36%)
Mutual labels:  runtime
Unityruntimespritesheetsgenerator
Unity – generate SpriteSheets at runtime!
Stars: ✭ 286 (-13.6%)
Mutual labels:  runtime
ph-commons
Java 1.8+ Library with tons of utility classes required in all projects
Stars: ✭ 23 (-93.05%)
Mutual labels:  runtime
Urde
Data interchange and engine re-implementation for games by Retro Studios | Mirror
Stars: ✭ 253 (-23.56%)
Mutual labels:  runtime
Charm4py
Parallel Programming with Python and Charm++
Stars: ✭ 259 (-21.75%)
Mutual labels:  runtime
Corium
Corium is a modern scripting language which combines simple, safe and efficient programming.
Stars: ✭ 18 (-94.56%)
Mutual labels:  runtime
Weave
A state-of-the-art multithreading runtime: message-passing based, fast, scalable, ultra-low overhead
Stars: ✭ 305 (-7.85%)
Mutual labels:  runtime
Ddetours
Delphi Detours Library
Stars: ✭ 256 (-22.66%)
Mutual labels:  runtime
Cortex M Rt
Minimal startup / runtime for Cortex-M microcontrollers
Stars: ✭ 286 (-13.6%)
Mutual labels:  runtime
PyChakra
🔥✨🚀Python binding to Microsoft Chakra JavaScript Engine.
Stars: ✭ 27 (-91.84%)
Mutual labels:  runtime
ms-rest-js
Runtime for isomorphic javascript libraries generated by Autorest
Stars: ✭ 54 (-83.69%)
Mutual labels:  runtime
Dvm
Deno Version Manager - Easy way to manage multiple active deno versions.
Stars: ✭ 271 (-18.13%)
Mutual labels:  runtime
SharpLoader
🔮 [C#] Source code randomizer and compiler
Stars: ✭ 36 (-89.12%)
Mutual labels:  runtime
Ios Runtime
iOS Runtime for NativeScript
Stars: ✭ 288 (-12.99%)
Mutual labels:  runtime
typesentry
Python 2.7 & 3.5+ runtime type-checker
Stars: ✭ 19 (-94.26%)
Mutual labels:  runtime
Ios Interview Questions
iOS面试题整理,在线查看地址:https://ios.nobady.cn
Stars: ✭ 258 (-22.05%)
Mutual labels:  runtime
Gtk For Windows Runtime Environment Installer
GTK+ for Windows Runtime Environment Installer (fork from http://gtk-win.sourceforge.net)
Stars: ✭ 325 (-1.81%)
Mutual labels:  runtime
Aecor
Pure functional event sourcing runtime
Stars: ✭ 299 (-9.67%)
Mutual labels:  runtime
Runtimesummary
一个集合了常用 Objective-C Runtime 使用方法的 Playground。
Stars: ✭ 281 (-15.11%)
Mutual labels:  runtime

hero

简体中文

build_status Join the chat at https://gitter.im/0xxd0/objc4 support

This project is a buildable and debuggable version of latest Objective-C runtime (objc4-818.2) on Apple Open Source

Which Version To Use

macOS macOS Version Xcode Version objc4 tarball version
macOS Big Sur macOS Version Xcode 12.3 objc4-818.2
macOS Catalina macOS Version Xcode 12.0 objc4-787.1
macOS Catalina macOS Version Xcode 11.1 objc4-781
macOS High Sierra macOS Version Xcode 10.1 objc4-723

Installation

Manually

Download zip or clone this repo, select objc scheme and build.

Usage

After 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.

objc4 tarballs

Build Phases

Private Header

objc header #include tarball
objc-os.h #include <sys/reason.h> /xnu-6153.41.3/bsd/sys/reason.h
objc-os.h #include <mach-o/dyld_priv.h> /dyld-733.6/include/mach-o/dyld_priv.h
objc-os.h #include <os/lock_private.h> /libplatform-220/private/os/lock_private.h
lock_private.h #include <os/base_private.h> /libplatform-220/private/os/base_private.h
objc-os.h #include <System/pthread_machdep.h> removed in latest Libc tarball (Libc-1353.41.1), this header should be commented-out
objc-class.mm #include <os/linker_set.h> /xnu-7195.50.7.100.1/os/linker_set.h
pthread_machdep.h #include <System/machine/cpu_capabilities.h> /xnu-6153.41.3/osfmk/machine/cpu_capabilities.h
objc-os.h #include <pthread/workqueue_private.h> /libpthread-416.40.3/private/workqueue_private.h
objc-os.h #include <objc-shared-cache.h> /dyld-733.6/include/objc-shared-cache.h
objc-errors.mm #include <_simple.h> /libplatform-220/private/_simple.h
objc-block-trampolines.mm #include <Block_private.h> /libclosure-74/Block_private.h
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_next <CrashReporterClient.h> => #include <CrashReporterClient.h> /Libc-825.24/include/CrashReporterClient.h
NSObject.mm #include <os/reason_private.h> /xnu-7195.50.7.100.1/os/reason_private
NSObject.mm #include <os/variant_private.h> /xnu-7195.50.7.100.1/os/reason_private
objc-exception.mm #include <objc/objc-abi.h> removed
objc-gdb.h #include <objc/maptable.h> removed

Private Header Included Header

private header #include tarball
tsd_private.h #include <os/tsd.h> /xnu-6153.41.3/libsyscall/os/tsd.h
tsd_private.h #include <pthread/spinlock_private.h> /libpthread-416.40.3/private/spinlock_private.h
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

Bridge OS

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.

dyld

In latest dyld-733.6 (dyld-421.2 later), apple use this ruby script to expand versions, platfrom versions from a versionSets which defined in a YAML file, code generated by this script will be inserted after @[email protected], @[email protected], @[email protected], @[email protected] and @[email protected] in dyld_priv.h. For more detail please refer to dyld.

XNU

<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.

Cambria framework

Have no idea about this framework so far, maybe related with -loah for lib oah. Related Code should be commented out for now.

// File objc-cache.mm
// 
// Line 87 ~ 88
#include <Cambria/Traps.h>
#include <Cambria/Cambria.h>
// 
// ···
//
// Line 1121 ~ 1128 
if (oah_is_current_process_translated()) {
    kern_return_t ret = objc_thread_get_rip(threads[count], (uint64_t*)&pc);
    if (ret != KERN_SUCCESS) {
        pc = PC_SENTINEL;
    }
} else {
    pc = _get_pc_for_thread (threads[count]);
}

#include <os/feature_private.h>

Have no idea about this haeder so far. Related Code should be commented out for now.

// File objc-runtime.mm
// 
// ···
//
// Line 36
#include <os/feature_private.h> // os_feature_enabled_simple()
//
// ···
//
// Line 444 ~ 446
if (!os_feature_enabled_simple(objc4, preoptimizedCaches, true)) {
    DisablePreoptCaches = true;
}
// 

dyld_fall_2020_os_versions, dyld_fall_2018_os_versions

Found releated source in xnu-7195.50.7.100.1/bsd/kern/kern_mman.c.

static uint32_t
proc_2020_fall_os_sdk(void)

Maybe these function is releated to dyld build-scripts. Comment out for now.

dyld_platform_version_macOS_, dyld_platform_version_iOS_, dyld_platform_version_tvOS_, dyld_platform_version_watchOS_, dyld_platform_version_bridgeOS_

This Marco is generated by dyld build-scripts, comment out for now.

STATIC_ASSERT

objc4/runtime/objc-runtime-new.mm:176:1: '_static_assert' declared as an array with a negative size

Comment out for now.

Build Setting

Declaration Value
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, 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.

License

This project is released under the MIT License. The objc4 project is released under the APPLE PUBLIC SOURCE LICENSE Version 2.0.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].