[ODE] Compile failure in timer.cpp with GCC 3.3
John Battles
capgadget at yahoo.com
Sat Jul 5 16:15:02 2003
The problem here is that GCC in the 3.3 release no
longer
supports strings spanning lines. I have his this in
lots
of code including building the Linux kernel. Normally
the fix is simple, Just move all the lines onto 1
line.
In this case I am not so sure since I am not familiar
with the asm statement. I did manage to get it
compile with the changes to timer.cpp listed below. I
have not tested this yet since I am building blender
(blender.org) with ode and have not had time
tocomplete and test the blender build.
Original timer.cpp code starting at line 104 (Note
that I
set the clock speed to 797 for my 800 Mhz PIII runs at
796-797 for some reason. This has nothing to do with
the fix, just an FYI)
=========================================================
#define PENTIUM_HZ (500e6)
static inline void getClockCount (unsigned long cc[2])
{
asm volatile ("
rdtsc
movl %%eax,(%%esi)
movl %%edx,4(%%esi)"
: : "S" (cc) : "%eax","%edx","cc","memory");
}
static inline void serialize()
{
asm volatile ("
mov $0,%%eax
cpuid"
: : : "%eax","%ebx","%ecx","%edx","cc","memory");
}
==========================================================
Replacement code:
==========================================================
#define PENTIUM_HZ (797e6)
static inline void getClockCount (unsigned long cc[2])
{
asm volatile (" rdtsc\n movl %%eax,(%%esi)\n movl
%%edx,4(%%esi)\n"
: : "S" (cc) : "%eax","%edx","cc","memory");
}
static inline void serialize()
{
asm volatile (" mov $0,%%eax\n cpuid\n" : : :
"%eax","%ebx","%ecx","%edx","cc","memory");
}
==========================================================
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com