[Gc] Status of gc on Mac OS X running on intel proc ?

Allan Hsu allan at counterpop.net
Fri Sep 29 12:30:08 PDT 2006


On Sep 29, 2006, at 6:01 AM, Renaud Blanch wrote:

> I have investigated this issue.
> thread_get_state returns KERN_INVALID_ARGUMENT.
> It seems related to the usage of the generic MACHINE_THREAD_STATE*  
> constants.
> When replaced with specific i386_THREAD_STATE* constant, every  
> thing works on my machine (configured with --enable-threads=posix).
> You will find below a patch that replace MACHINE_* with PPC_* or  
> i386_ constants according to he POWERPC or I386 defines.
> I don't understand why MACHINE_* constants are not defined properly  
> (is it related to my system, a bug in Apple headers, or a problem  
> with configure), but the patch does the work and should work with  
> PPC architecture (not tested).

I've actually been aware of this problem for a few weeks and I  
apologize for not posting to the list earlier, but I was waiting on  
more information and possibly the "proper" solution.

This is a recent change to the 10.4u SDK headers. Before XCode 2.4,  
MACHINE_THREAD_STATE worked fine on i386. The value of  
MACHINE_THREAD_STATE used to be 1 on both platforms, but since XCode  
2.4, it is now 7 on i386. It looks like currently shipping OS X  
kernels still speak the pre-XCode 2.4 values on x86 machines. I'm  
currently asking around the about why the constants have changed.

I just heard from an Apple developer (while writing this email) that  
the header change is in order to accommodate 64-bit systems and it is  
binary compatible, but not source compatible. According to him: "If  
you need source code built with the latest SDK to run on Intel Macs  
running versions of Mac OS X which shipped before the Mac Pro, use  
i386_THREAD_STATE."

Additional testing shows that today's 10.4.8 update still has  
problems with the new MACHINE_THREAD_STATE, so I can only assume that  
"versions of Mac OS X which shipped before the Mac Pro" means a full  
10.X release and not minor updates.

-Allan


--
Allan Hsu <allan at counterpop dot net>
1E64 E20F 34D9 CBA7 1300  1457 AC37 CBBB 0E92 C779





More information about the Gc mailing list