bogdan celer
12/31/2009 7:17 AM
post44468
|
An Objective-C implementation comes in two components; a compiler and a runtime library.
If you are using a GCC 4.4.2 to compile objc code then you should use a GCC 4.4.2 of the Objective-C runtime library
that came with compiler.
Currently, no features of Objective-C 2 work with GCC.
But if we want to compile Objective-C 2 programm you should use runtime libobjc2 from GNUstep or Étoilé's ObjectiveC2
framework.
For more advanced features, currently only supported if you compile with Clang, you will need the GNUstep runtime.
The GNUstep runtime supports two ABIs. One is compatible with the GCC runtime, the other is new and is designed to
support Objective-C 2.
Clang is a new front end for LLVM( Low-Level Virtual Machine ).
If you compile with Clang then you have access to declared properties, fast enumeration, and blocks.
If you compile with the -fobjc-nonfragile-abi flag then you will use the new ABI. This is only supported with the
GNUstep runtime. This adds:
1. Property introspection
2. Introspection on optional protocol methods
3. Non-fragile instance variables
4. Forwarding proxy support
I compiled on QNX 6.4.1 libobjc2 from GNUstep how also LLVM and Clang.
Clang compiles both programmes in C and objc.
It for compilation objc was one should add ADDITIONAL_CFLAGS = -D__QNXNTO__ -D__X86__ -D__LITTLEENDIAN__ in GNUmakefile
or
to use:
clang -D__QNXNTO__ -D__X86__ -D__LITTLEENDIAN__ prg.m -L / usr / pkg / lib -lobjc
Catalogue / usr / pkg / lib is to runtime path libobjc2 from GNUstep - libobjc.so.4 and clang will use this library and
not GCC runtime.
I compiled on QNX 6.4.1 libobjc2 from GNUstep how also LLVM and clang.
clang compiles both programmes in C and objc.
For compilation objc we should add ADDITIONAL_CFLAGS = -D__QNXNTO__ -D__X86__ -D__LITTLEENDIAN__ in GNUmakefile or
to use:
clang -D__QNXNTO__ -D__X86__ -D__LITTLEENDIAN__ prg.m -L / usr / pkg / lib -lobjc
/usr/pkg/lib is directory to runtime libobjc2 from GNUstep - libobjc.so.4 and clang will use this library and not GCC
runtime.
I do not know or someone this will interest but on http://www.ajam.org.pl I will place the description of how to compile
LLVM, clang and libobjc2 tomorrow.
|
|
|