This is an Objective-C compiler based on clang 3.9, written for the mulle-objc runtime.
See README.txt for more information about clang
The compiler can be used to:
- compile Objective-C code for mulle-objc
- compile C code
It is not recommended to use it for C++, since that is not tested. It is not recommended to use it for other Objective-C runtimes, since there have been some changes, that could affect other runtimes.
The compiler compiles Objective-C source for the mulle-objc runtime by default. When compiling for mulle-objc the compiler will use the meta-ABI for all method calls. The resultant
.o files should be linkable like any other compiled C code.
AAM - Always Autorelease Mode
The compiler has a special mode called AAM. This changes the Objective-C language in the following ways:
There is a tranformation done on selector names
Name Transformed Name alloc instantiate new instantiatedObject copy immutableInstance mutableCopy mutableInstance
- You can not access instance variables directly, but must use properties (or methods)
- You can not do explicit memory management (like
The transformed methods will return objects that are autoreleased. Hence the name of the mode. The net effect is, that you have a mode that is ARC-like, yet understandable and much simpler.
Your ARC code may not run in AAM, but AAM code should run in ARC with no problems. If you can't do something in AAM, put it in a category in regular Objective-C style.
Additional File Types
The compiler handles
.aam files, which enables AAM ("Always Autoreleased Mode").
|-fno-objc-tps||Disable tagged pointers|
Additional Compiler defined Macros
||Compiling for mulle-objc|
||AAM is enabled|
Macros used in Code Generation
The compiler output can be tweaked with the following preprocessor macros. All macros must be defined with a simple integer, no expressions. All of them are optional, unless indicated otherwise. The runtime, the Objective-C Foundation on top of the runtime and the user application, will define them.
||Major version of the runtime|
||Minor version of the runtime|
||Patch version of the runtime|
||Major version of the Foundation|
||Minor version of the Foundation|
||Patch version of the Foundation|
||User supplied version|
||User supplied of the Foundation|
||User supplied of the Foundation, all these version information values will be stored in the emitted object file.|
||Disable the emission of tagged pointer code|
||First unique ID of a fast class|
||Last unique ID of a fast class|
Functions used in Code Generation
These are the runtime functions used for method calling, retain/release management, class lookup and exception handling. They are defined in the runtime.
You can use homebrew to install the library:
brew install codeon-gmbh/software/mulle-clang
If for some reason homebrew can not use the bottle, the compiler must be built from source. This takes a long time! On my Macbook Air the build took about 30 minutes, even with the prerequisite llvm downloaded as a bottle.
This will install the compiler into
/opt/mulle-clang and a symlink
Ubuntu 16.04 LTS / Debian xenial 64 bit
curl -O -L http://download.codeon.de/bottles/mulle-clang-3.9.0-xenial-amd64.deb sudo dpkg --install mulle-clang-3.9.0-xenial-amd64.deb
Ubuntu 14.04 LTS / Debian trusty 64 bit
curl -O -L http://download.codeon.de/bottles/mulle-clang-3.9.0-trusty-amd64.deb sudo dpkg --install mulle-clang-3.9.0-trusty-amd64.deb
Afterwards head on over to mulle-objc to get the Objective-C libraries.