[cfe-dev] ObjectiveC on Windows using the Apple Obj C runtime

Jim Crafton jim.crafton at gmail.com
Thu Jan 21 10:28:35 PST 2010


First off I just want to say congratulations to you guys - I've been
watching the project (LLVM & clang) for a couple of years now, and I
can't say loudly enough what a great job you guys have done and what a
potentially fantastic project something like this is!

I've recently pulled down the latest LLVM build on windows and built
it successfully with Visual Studio 2008. Woot.
What I'd like to do is some Objective C programming without *any* use
or dependance on GCC. I tried a few simple tests, which clang was able
to emit apparently valid bitcode for. When I try and run them with
lli, I get an error
"LLVM ERROR: Program used external function '__objc_exec_class' which
could not be resolved!"

Not surprising, it doesn't know where the runtime is. Apple provides
the source, plus Visual Studio projects, for their objcrt, and after a
few tweaks I was able to build it successfully, and ended up with
objc.dll, and a whole bunch of runtime functions.

Now my question is: how do I get LLVM to use this? I'm not interested
in Cocoa whatsoever, I'd just be curious to use bare bones objective
C, and even build my own framework if I get really ambitious. I notice
 that there are two files in clang, CGObjCGNU.cpp, and CGObjCMac.cpp -
would I need something like CGObjCWin32.cpp that implements the
appropriate code? Is there something else involved? Has anyone else
tried this, or even interested in this?

Thanks

Jim



More information about the cfe-dev mailing list