Allow you to use objc feature in Cosmopolitan Libc.
Only support legacy gcc's objective-c runtime for now.
- You need cosmocc SDK from https://cosmo.zip/pub/cosmocc, it currently use the 3.1.3 version
- You also need my patched version of the superconfigure (https://github.com/codehz/superconfigure) just download the aarch64-gcc.zip and x86_64-gcc.zip and unzip into the cosmocc sdk (overwrite)
Put objc folder in release.zip to your include path And put libobjc.o and .aarch64/libobjc.o into your library path
Use command cosmocc -fobjc-exceptions -I<path-to-libobjc-inc> -L<path-to-libobjc-lib> -lobjc <source>.c -o <target>
to build
Feature | State |
---|---|
GC | ❌ Not enabled |
Exceptions | ✅ Yes, require -fobjc-exceptions options, it will use SJLJ model of exceptions |
Just because I can, and it is fun to play legacy stuff like objc 1.0 with Cosmopolitan Libc
Since it is copied from gcc, it follows GCC's license (GPLv3) with GCC Runtime Library Exception.