[ODE] building on intel OSX

Terry L. Triplett c0d3g33k at gmail.com
Wed Apr 5 11:20:34 MST 2006


>
> 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 ---
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://q12.org/pipermail/ode/attachments/20060405/db79fc80/attachment.htm


More information about the ODE mailing list