Here's what actually happens with the rdtsc() inline function in the
in-common header file:
[root@eaarl lidar_acq]# make et
gcc -O2 -ggdb -c -o et.o et.c
gcc -ggdb -c formatter.c
gcc -O2 -ggdb -c -o eaarl_userspace_pci.o eaarl_userspace_pci.c
gcc -O2 -ggdb -O2 -ggdb -Wall et.o formatter.o eaarl_userspace_pci.o
-o et
formatter.o: In function `rdtsc':
/home/wright/eaarl/src/lidar_acq/eaarl.h:102: multiple definition of
`rdtsc'
et.o:/home/wright/eaarl/src/lidar_acq/eaarl.h:102: first defined here
/usr/bin/ld: Warning: size of symbol `rdtsc' changed from 7 to 32 in
formatter.o
eaarl_userspace_pci.o:/home/wright/eaarl/src/lidar_acq/eaarl.h:102:
multiple definition of `rdtsc'
et.o:/home/wright/eaarl/src/lidar_acq/eaarl.h:102: first defined here
/usr/bin/ld: Warning: size of symbol `rdtsc' changed from 32 to 7 in
eaarl_userspace_pci.o
collect2: ld returned 1 exit status
make: *** [et] Error 1
Both of Cort's suggested fixes, shown below, worked. Thanks Cort.
extern __inline__ unsigned long long int rdtsc(void)
//static __inline__ unsigned long long int rdtsc(void)
// __inline__ unsigned long long int rdtsc(void)
{
unsigned long long int x;
__asm__ volatile (".byte 0x0f, 0x31" : "=A" (x));
return x;
}
[root@eaarl lidar_acq]# !ma
make et
gcc -O2 -ggdb -c -o et.o et.c
gcc -ggdb -c formatter.c
gcc -O2 -ggdb -c -o eaarl_userspace_pci.o eaarl_userspace_pci.c
gcc -O2 -ggdb -O2 -ggdb -Wall et.o formatter.o eaarl_userspace_pci.o
-o et
[root@eaarl lidar_acq]# !to
touch *.c
[root@eaarl lidar_acq]# make et
gcc -O2 -ggdb -c -o et.o et.c
gcc -ggdb -c formatter.c
gcc -O2 -ggdb -c -o eaarl_userspace_pci.o eaarl_userspace_pci.c
gcc -O2 -ggdb -O2 -ggdb -Wall et.o formatter.o eaarl_userspace_pci.o
-o et
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/