[ODE] building on intel OSX
Rodrigo Hernandez
kwizatz at aeongames.com
Thu Apr 6 09:38:26 MST 2006
I think we will also need a platform check here, IIRC, the cpuid
instruction clobbers ebx on standard PCs, and that shoudn't be overlooked.
what's the code to tell whether the CPU is in a Mac?
Hampus Soderstrom wrote:
>Hi,
>
>Here is a patch to get timer.cpp to compile on Intel OS X.
>
>RCS file: /cvsroot/opende/ode/ode/src/timer.cpp,v
>retrieving revision 1.11.2.2
>diff -r1.11.2.2 timer.cpp
>128c128
>< "mov $0,%%eax\n"
>---
> > "mov %%ebx,%%edi\n"
>130c130
>< : : : "%eax","%ebx","%ecx","%edx","cc","memory");
>---
> > : : : "%eax","%edi","%ecx","%edx","cc","memory");
>
>
>6 apr 2006 kl. 01.20 skrev Terry L. Triplett:
>
>
>
>>Hi,
>>
>>I'm trying to build ODE on a Intel OS X machine and get "PIC register
>>'%ebx' clobbered in 'asm'"
>>
>>Any suggestions on how to fix this?
>>regards
>>/Hampa
>>toribash.com
>>
>>Try this patch (from Gentoo Linux). Based on ODE 0.5 - might not
>>apply clean if you're working with the SVN code (position has
>>changed in recent code):
>>
>>----- Cut here ---
>>
>>Make sure we don't clobber %ebx (important with PIC).
>>
>>http://bugs.gentoo.org/77079
>>
>>--- ode-0.5/ode/src/timer.cpp
>>+++ ode-0.5/ode/src/timer.cpp
>>@@ -117,9 +117,11 @@ static inline void getClockCount (unsign
>>static inline void serialize()
>>{
>>asm volatile (
>>+ "mov %%ebx,%%edi\n"
>>"mov $0,%%eax\n"
>>"cpuid\n"
>>+ "mov %%edi,%%ebx\n"
>>- : : : "%eax","%ebx","%ecx","%edx","cc","memory");
>>+ : : : "%eax","%edi","%ecx","%edx","cc","memory");
>>}
>>
>>----- Cut here ---
>>
>>_______________________________________________
>>ODE mailing list
>>ODE at q12.org
>>http://q12.org/mailman/listinfo/ode
>>
>>
>>
>
>_______________________________________________
>ODE mailing list
>ODE at q12.org
>http://q12.org/mailman/listinfo/ode
>
>
>
More information about the ODE
mailing list