Re: Compile Objective C 2.0 code on Linux
Re: Compile Objective C 2.0 code on Linux
- Subject: Re: Compile Objective C 2.0 code on Linux
- From: "Jake McMahon" <email@hidden>
- Date: Thu, 18 Dec 2008 11:48:52 -0500
or puredarwin
On Thu, Dec 18, 2008 at 11:47 AM, Jake McMahon <email@hidden> wrote:
> I hate to bring this up now but you guys have been so helpful.
>
> What about getting trying to accomplish this on the last binary
> version of Darwin released by Apple
>
> On Thu, Dec 18, 2008 at 11:44 AM, Benjamin Huntsman
> <email@hidden> wrote:
>> autozone is a garbage collector that garbage collects a specific region of memory, the AutoZone... :) I'd think it'd be a major horror to port to Linux, given that it's memory model is different, and I doubt you want to monkey with that anyway.
>> I'd start by looking at the older PureDarwin releases (puredwarin.googlecode.com). They had a patch for objc4 that eliminated the dependency on autozone. They got removed from the distribution after Apple open-sourced autozone, though. If you can't find 'em, I'll e-mail the diffs to you. I'd start by applying the patches, then try to get objc4 ported. Contrary to what someone mentioned earlier, it -does not- depend on Foundation. It does however depend on CoreFoundation, which is open source and has been successfully compiled on Linux...
>> objc4 used to run on several UNIXes, and Windows, so it should be possible to port, though it'll be some heavy-duty work, as Apple stripped out all the cross-platform stuff. While I think it'd be a great service to the community to have Apple's runtime available on other platforms (after all, they pretty much own obj-c), it might be easier to implement objc 2.0 features in the GNU runtime...
>>
>> Good luck!!
>>
>> -Ben
>>
>>
>> -----Original Message-----
>> From: Jake McMahon [mailto:email@hidden]
>> Sent: Thu 12/18/2008 8:29 AM
>> To: Benjamin Huntsman
>> Subject: Re: Compile Objective C 2.0 code on Linux
>>
>> I'm out on a limb here. Have any idea where I should begin with this?
>>
>> On Thu, Dec 18, 2008 at 11:26 AM, Benjamin Huntsman
>> <email@hidden> wrote:
>>> objc4 also depends on autozone. You'd have to get that running on Linux too, or patch objc4 to not use it...
>>>
>>>
>>> -----Original Message-----
>>> From: darwin-dev-bounces+bhuntsman=email@hidden on behalf of Jake McMahon
>>> Sent: Thu 12/18/2008 8:23 AM
>>> To: Darwin Dev
>>> Subject: Re: Compile Objective C 2.0 code on Linux
>>>
>>> I can't just move the libobjc folder to a recent gcc release install
>>> dir can I? I read somewhere that Apple's gcc release is much different
>>> from the standard one.
>>>
>>> On Thu, Dec 18, 2008 at 11:16 AM, Jake McMahon <email@hidden> wrote:
>>>> I'm trying to write, compile, and run Objective C 2.0 code on Linux.
>>>> I'm not interested in targeting the Mac at all.
>>>>
>>>> So that leaves me with just working with the available source packages.
>>>>
>>>> On this page: http://www.opensource.apple.com/darwinsource/10.5.6/
>>>>
>>>> -gcc-5465
>>>> -gcc_42-5531
>>>>
>>>> What are the differences between these two? And which would I have the
>>>> best luck compiling on Linux? There are also tar.gz files as part of
>>>> the October 2008 Developer Tools.
>>>>
>>>> -gcc-5490
>>>> -gcc_42-5566
>>>>
>>>>
>>>> Besides grabbing one of the four above, and the obj4 package, is there
>>>> anything else that I really need? I mean, is it even possible to build
>>>> Apple's gcc packages on a computer that's not running Mac OS and get
>>>> it to compile and run Objective-C 2.0 apps.
>>>>
>>>> On Thu, Dec 18, 2008 at 11:05 AM, Jean-Daniel Dupas
>>>> <email@hidden> wrote:
>>>>> It depends what you want. Do you want to compile Mac OS X binary on Linux
>>>>> (and run them on OS X) or produce a Linux binary.
>>>>>
>>>>> To run, an objc application need a runtime library (libobjc). When you
>>>>> compile objc sources, the compiler generate call to this library and create
>>>>> structure to represent class and other objc info in a format defined by
>>>>> this library.
>>>>> Actually there is two major runtime. The GNU one (provided with GCC), and
>>>>> the Apple one (aka Next Runtime for historical raison) provided on Darwin
>>>>> source as the obj4 package.
>>>>>
>>>>> AFAK, the GNU runtime does not support properties, and other Obj-C 2
>>>>> features. (I'm not sure it even support @try/@catch and @synchronize)
>>>>> And the Next/Apple Runtime is not available on Linux.
>>>>>
>>>>> When you define and access properties in an objc 2 application, the compiler
>>>>> generate call to the runtime (like call to objc_getProperty() or
>>>>> objc_setProperty()). If the installed libobjc does not provide theses
>>>>> functions, you will not be able pass the linker step.
>>>>>
>>>>> Le 18 déc. 08 à 16:33, Jake McMahon a écrit :
>>>>>
>>>>>> The run time has been released though. So advanced stuff aside, a
>>>>>> basic 2.0 app that utilizes accessors should work, no?
>>>>>>
>>>>>> On Thu, Dec 18, 2008 at 10:07 AM, Jean-Daniel Dupas
>>>>>> <email@hidden> wrote:
>>>>>>>
>>>>>>> Le 18 déc. 08 à 15:50, Jake McMahon a écrit :
>>>>>>>
>>>>>>>> I'm trying to install all the necessary tools needed to compile
>>>>>>>> Objective C 2.0 code on a Linux workstation. I've downloaded the
>>>>>>>> gcc-5465 package off the Apple website and executed:
>>>>>>>>
>>>>>>>>> ../configure --prefix=/tmp/123/ --enable-languages=objc
>>>>>>>>
>>>>>>>> followed by: make bootstrap
>>>>>>>>
>>>>>>>>> /usr/include/limits.h:125:26: error: no include path in which to search
>>>>>>>>> for limits.h
>>>>>>>>> make[2]: *** [crtbegin.o] Error 1
>>>>>>>>> make[2]: Leaving directory `/home/user/Download/gcc-5465/xxx/gcc'
>>>>>>>>> make[1]: *** [stage1_build] Error 2
>>>>>>>>> make[1]: Leaving directory `/home/user/Download/gcc-5465/xxx/gcc'
>>>>>>>>> make: *** [bootstrap] Error 2
>>>>>>>>
>>>>>>>>
>>>>>>>> if I do
>>>>>>>>
>>>>>>>> make (note, no bootstrap)
>>>>>>>>
>>>>>>>>> ../../gcc/objc/objc-act.c: In function 'objc_init':
>>>>>>>>> ../../gcc/objc/objc-act.c:716: warning: suggest braces around empty
>>>>>>>>> body
>>>>>>>>> in an 'if' statement
>>>>>>>>> ../../gcc/objc/objc-act.c: In function 'objc_init_exceptions':
>>>>>>>>> ../../gcc/objc/objc-act.c:7745: error: 'darwin_macosx_version_min'
>>>>>>>>> undeclared (first use in this function)
>>>>>>>>> ../../gcc/objc/objc-act.c:7745: error: (Each undeclared identifier is
>>>>>>>>> reported only once
>>>>>>>>> ../../gcc/objc/objc-act.c:7745: error: for each function it appears
>>>>>>>>> in.)
>>>>>>>>> ../../gcc/objc/objc-act.c: In function 'objc_create_init_utf16_var':
>>>>>>>>> ../../gcc/objc/objc-act.c:19227: warning: implicit declaration of
>>>>>>>>> function 'objc_cvt_utf8_utf16'
>>>>>>>>> make[1]: *** [objc/objc-act.o] Error 1
>>>>>>>>> make[1]: Leaving directory `/home/user/Download/gcc-5465/xxx/gcc'
>>>>>>>>> make: *** [all-gcc] Error 2
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Is there something I'm missing here? I know there is already a gnu
>>>>>>>> implementation of objc but I want to use the features of version 2.0.
>>>>>>>> Any help or suggestions would be GREATLY! appreciated.
>>>>>>>
>>>>>>> Compiling objc 2 on linux is one thing. Running it is another.
>>>>>>> Without the Next Runtime on your linux box, you will not be able to use
>>>>>>> Obj-C 2. The Next Runtime and the Gnu Runtime are not compatibles.
>>>>>>> Not to mention that a part of the Apple runtime is in the Foundation
>>>>>>> framework (like exception handling),
>>>>>>> and even if you managed to port the Next Runtime on Linux, you will not
>>>>>>> be
>>>>>>> able to use it for advanced features.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Darwin-dev mailing list (email@hidden)
>>> Help/Unsubscribe/Update your Subscription:
>>>
>>> This email sent to email@hidden
>>>
>>>
>>
>>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden