GithubHelp home page GithubHelp logo

jadite / objc4 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from showxu/objc4

0.0 1.0 0.0 17.68 MB

A buildable and debuggable latest Objective-C runtime objc4 (objc-781) project.

Home Page: https://opensource.apple.com/tarballs/objc4/

License: MIT License

C++ 14.60% Batchfile 0.07% Assembly 7.55% Objective-C 28.18% Objective-C++ 38.20% C 8.24% DTrace 0.01% Rich Text Format 0.69% MATLAB 0.23% Forth 0.09% Shell 0.03% Perl 1.90% SWIG 0.22%

objc4's Introduction

objc4

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-781) on Apple Open Source

Requirement

Xcode 11.3 macOS 10.15

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
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 <CrashReporterClient.h> /Libc-825.24/include/CrashReporterClient.h

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 11.3.1), 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 @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.

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.

Build Setting

Declaration Value
HEADER_SEARCH_PATHS $(SRCROOT)/../macosx.internal/System/Library/Frameworks/System.framework/PrivateHeaders
GCC_PREPROCESSOR_DEFINITIONS LIBC_NO_LIBCRASHREPORTERCLIENT
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

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.

objc4's People

Contributors

showxdxu avatar showxu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.