Native building on Linux using Clang and with support for blocks

143 views
Skip to first unread message

Tilo Prütz

unread,
Apr 19, 2012, 1:20:50 AM4/19/12
to cocotr...@googlegroups.com
Hi all,

http://code.google.com/r/tilopruetz-cocotron/source/detail?r=496c7bb6a9b6116b9176a2bd4a97732729d66547 can now be build nativly on Linux using Clang with block support ('-fblocks').
And it's easy as

    cd linux_native; make

Well, almost. You may need a “unistd.h”-patch at <clang-dir>/include and you may need libBlocksRuntime.a in a visible library directory (like /usr/lib).
But these prerequisites are easy to obtain. For details on them see


and



Best Regards

Tilo Prütz


P.S.:
I did not use any code from the existing clang branches which focus on compiling with XCode.
My solutions differ from them. Especially the constant object handling: I removed the whole hack because it is unreliable. As Jens Ayton (the implementor of the hack) stated in http://jens.ayton.se/blag/objc-constant-objects it is also not intended to work with the 64bit runtime. I think he meant the Apple runtime but the statement is true for any “modern” runtime because the implementation relies on runtime implementation details that are not longer exposed.
Reply all
Reply to author
Forward
0 new messages