This is a minimal Objective C runtime written in C, designed to be portable across different platforms, including ARM and x86 architectures, mostly targeting embedded systems. It uses the "gcc" ABI for the moment, as that is the most portable across different platforms.
You will minimally need the following tools to build the runtime:
make
and cmake
- for the build systemclang
or gcc
- for compiling the runtime (clang
is not supported on Apple Silicon). If you want to cross-compile for ARM, you will need the ARM LLVM toolchain (see below).For cross-compilation for embedded systems based on some ARM variant, get the ARM LLVM toolchain:\ https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases
Install this to the /opt
directory.
Download the source code from GitHub:
The TOOLCHAIN_PATH
environment variable should point to the directory where the toolchain is installed. For example,
Use the make tests
target to run the unit .tests
For the RP2040 Pico board, you can use the clang
compiler with the ARM toolchain. The TARGET
environment variable should be set to the target architecture, such as armv6m-none-eabi
for the RP2040 Pico board:
NXConstantString
[super init]
for example+[initialise]
for categoriesrespondsToSelector:
and +[Class load]
NXZone
NXString
- mutable stringsNXArray
and NXDictionary
NXApplication
and NXRunLoop
conformsToProtocol:
@synchronized
supportHere are some references that may be useful for understanding the Objective C runtime and its implementation: