[ODE] gcc 3.3 compile problem
John DeWeese
deweese at ict.usc.edu
Wed Jun 4 15:01:02 2003
Thanks Chris, I split the multi-line string as you suggested, and I
also had to add semicolons to the end of each assembly statement. I've
compiled the altered file with gcc 3.3 and gcc 3.2.3, and the tests
seem to run fine. Somebody please volunteer and apply the following
patch and test with other compilers. If everything works, then somebody
else with write access to CVS should commit the patch. Thanks!
In ode/src/timer.cpp from ode version 0.035:
109,112c109,112
< asm volatile ("
< rdtsc
< movl %%eax,(%%esi)
< movl %%edx,4(%%esi)"
---
> asm volatile (
> "rdtsc;"
> "movl %%eax,(%%esi);"
> "movl %%edx,4(%%esi);"
119,121c119,121
< asm volatile ("
< mov $0,%%eax
< cpuid"
---
> asm volatile (
> "mov $0,%%eax;"
> "cpuid;"
> John DeWeese wrote:
>
> > Compiling ODE with gcc 3.3 generates an error in some inline
> assembly chunk. I can't decipher it. Anyone have a similar experience?
> >
> > -bash$ gcc -v
> > ...
> > gcc version 3.3 (Debian)
> >
> > -bash$ make
> > gcc -c -Wall -fno-rtti -fno-exceptions -Wall -fomit-frame-pointer
> -ffast-math -Iinclude -DdNODEBUG -O2 -o ode/src/timer.o
> ode/src/timer.cpp
> > ode/src/timer.cpp:109:17: missing terminating " character
> > ode/src/timer.cpp: In function `void getClockCount(long unsigned
> int*)':
> > ode/src/timer.cpp:110: error: parse error before `movl'
> > ode/src/timer.cpp:112:28: missing terminating " character
> > ode/src/timer.cpp:119:17: missing terminating " character
> > ode/src/timer.cpp: In function `void serialize()':
> > ode/src/timer.cpp:120: error: parse error before `$0'
> > ode/src/timer.cpp:121:14: missing terminating " character
> > make: *** [ode/src/timer.o] Error 1
> >
> > _______________________________________________
> > ODE mailing list
> > ODE@q12.org
> > http://q12.org/mailman/listinfo/ode
>
>
> without looking at the code I suspect it could be due to the fact that
> gcc 3.3 no longer allows multi-line string literals. So you can write
> things like
>
> inline asm {
> "some asm
> some more asm
> yet more asm"
> }
>
> you have to write:
>
> inline asm {
> "some asm"
> "some more asm"
> "yet more asm"
> }
>
> (can't remember exact notation off the top of my head, but you get the
> idea)