llvm + mingw

Hi,

I would like to know if it would be possible to developp on Mac an
objective-C 2.0
program and targeting mingw.
IS it possible to tell clang to compile objective-C code and then do the
final link
with mingw ?

Hello

IS it possible to tell clang to compile objective-C code and then do the
final link with mingw ?

In theory - yes. Some problems / challenges:

1. You need to have an objc runtime on mingw compatible with the one
clang generates the code for.
2. clang on mingw might not be pretty stable - it wasn't thoroughly used there.

There are several issues here. Clang can generate LLVM IR for the GNU runtime (if you are using Objective-C 2 then you will want libobjc2 from GNUstep svn), assuming that you have the headers available and LLVM can emit assembly for mingw. I don't think the Darwin assembler can emit object code that is compatible with mingw, so you'll need to install a different assembler.

Given that you're linking on mingw anyway, is there a reason why you want to compile on OS X? If the issue is XCode, then you should look at GNUstep's pbxbuild tool, which runs on mingw and can build XCode projects.

David

-- Sent from my PDP-11

Hello

There are several issues here. Clang can generate LLVM IR for the GNU
runtime (if you are using Objective-C 2 then you will want libobjc2
from GNUstep svn), assuming that you have the headers available and
LLVM can emit assembly for mingw. I don't think the Darwin assembler
can emit object code that is compatible with mingw, so you'll need to
install a different assembler.

This is not a problem - just build & install cross assembler.

Hi,

I would like to know if it would be possible to developp on Mac an
objective-C 2.0
program and targeting mingw.
IS it possible to tell clang to compile objective-C code and then do
the
final link
with mingw ?

There are several issues here. Clang can generate LLVM IR for the GNU
runtime (if you are using Objective-C 2 then you will want libobjc2
from GNUstep svn), assuming that you have the headers available and
LLVM can emit assembly for mingw. I don't think the Darwin assembler
can emit object code that is compatible with mingw, so you'll need to
install a different assembler.

You are talking about libobjc2 but I can see that apple is releasing an
objc4
folder(http://www.opensource.apple.com/source/objc4/objc4-371/runtime/).
Would it be possible to use it and would it be compatible ?

Given that you're linking on mingw anyway, is there a reason why you
want to compile on OS X? If the issue is XCode, then you should look
at GNUstep's pbxbuild tool, which runs on mingw and can build XCode
projects.

Actually I don't care where I am compiling, it could be on windows as long
as it works.

And if you don't want to bother to build it, you can get it in the Cocotron project's tools (which provide a full gcc tool suite to build Windows/mingw exec using Xcode).

http://www.cocotron.org/Tools/InstallCDT

-- Jean-Daniel