3 ms·
FWIW I took a recent look at porting the Apple Objective-C runtime to Linux (with the vague idea that if Apple open source Swift, it might be easier to get it w
by lukeh 12y ago
FWIW I took a recent look at porting the Apple Objective-C runtime to Linux (with the vague idea that if Apple open source Swift, it might be easier to get it working with their own runtime rather than the GNUstep one).
One nice thing about clang is that there's no problem outputting Objective-C code that uses the Apple runtime on other platforms: just use -fobjc-runtime=macosx. The catch is that because class, protocol, etc definitions are just data, you need a way to get notified by the runtime linker when an object is mapped into the process address space. (You could scan the current address space at startup, but that makes it difficult to support dynamic loading, although probably not impossible now that I think about it. I thought I was nearly there with ld.so audit interface, but audit modules are loaded into their own namespace, so you can't easily communicate with the global libobjc.)