autotest/autotest — Issue #82: monotonic_time compile problem
Author: cevich
Created: 2011-11-22 16:00:24+00:00
State: open

When running make in client/tests/monotonic_time/src on a Fedora 16 box I get problem with some in-line assembly:

cc -g -O -std=gnu99 -Wall -c -o time_test.o time_test.c
spinlock.h: Assembler messages:
spinlock.h:17: Error: incorrect register `%rax' used with `l' suffix
spinlock.h:25: Error: incorrect register `%rax' used with `l' suffix
...repeat...

I tried sticking some #ifdef's around it to remove the 'l' suffix when '_LP64' is defined. That let's it compile, but running the resulting binary produces: "Illegal Instruction". I also tried redefining spinlock_t as uint32_t with the same results.

I downloaded the original time-warp-test.c by Ingo Molnar and it complains about the same thing.

I'm told this test compiles/runs and is used extensively on RHEL 5, 6, and Fedora 15. The F16 KVM guest has:

[root@localhost src]# uname -a
Linux localhost.localdomain 3.1.0-7.fc16.x86_64 #1 SMP Tue Nov 1 21:10:48 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost src]# gcc --version
gcc (GCC) 4.6.2 20111027 (Red Hat 4.6.2-1)
...

I'm not sure what other info. would be helpful.