[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MacOSX] gcc3.1-1145 for downloading
From: |
Scott Christley |
Subject: |
Re: [MacOSX] gcc3.1-1145 for downloading |
Date: |
Wed, 3 Jul 2002 18:06:04 -0700 |
On Tuesday, July 2, 2002, at 03:28 PM, address@hidden wrote:
I am very much trying to work
towards a version of Swarm which will compile and run on a MacOS X
system
with the minimum modification. Nirvana would be to end up with a Swarm
framework which can be installed and then used to build apps in Project
Builder using it, the AppKit framework and not much else.
If only it would be this easy, but unfortunately it will not. Despite
the fact that objc is the same, the different objc runtimes cannot
intermix so easily. It is more than just a linking issue; the actual
compiled code is explicitly tied to the specific objc runtime.
When you compile objc code, every time the compiler sees a method call,
it translates it into a bit a code that looks somewhat like this:
// 1. Have the objc runtime lookup the method.
// 2. Prepare the registers/stack with the method arguments.
// 3. Call the method
// 4. Clean up the stack and retrieve the return argument.
It looks all fine but operation #1 calls objc_msgSend() for the Apple
runtime and objc_msg_lookup() for the GNU runtime. GCC has two flags;
-fgnu-runtime and -fnext-runtime which generates code for one or the
other. With the current gcc architecture, this flag operates on a file
by file basis, so it is not possible to intermix calls with the two
runtimes in the same file. This was why I was trying to get Swarm to
work with the Apple runtime, to avoid having to deal with this dual
runtime system.
If we do get it to work, I suspect that there will need to be a proxy
connection between the two runtimes, probably written in C. In some
ways, the Apple runtime has to be considered similar to how Java
interacts with Swarm. Swarm code won't be able to directly utilize any
of the Cocoa classes and Cocoa code won't be able to directly
create/call Swarm code. All Swarm classes, including your agent code,
will need to be compiled with the GNU runtime; while all the Cocoa code
is compiled with the Apple runtime. yucko...
cheers
Scott
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.