pc386 benchmark timer driver Re: Timers problem
Ralf Corsepius
corsepiu at faw.uni-ulm.de
Sat Jan 11 03:49:36 UTC 2003
Am Sam, 2003-01-11 um 00.27 schrieb Ilian Donev:
> Hi all,
>
> After a little research and a good direction given me by Joel, it seems to
> me that the *pentium* macro is never passed to the compiler.
> Here are the compiler flags when building RTEMS ( gcc 3.2.1,
> rtems-ss-20021118 ):
>
> ...
> i386-rtems-gcc --pipe -B../../../../../../../lib/ -B../../../../../../../pc5
> 86/lib/
> -specs
> bsp_specs -qrtems -DHAVE_CONFIG_H -ansi -fasm -O4 -g -O2 -mcpu=pentium
> -o o-optimize/timer.o -c
> /home/library/rtems-src/rtems-ss-20021118/c/src/lib/libbsp/i386/pc386/timer/
> timer.c
> ...
>
> The -mcpu is correct, but there's no defines for pentium nor __pentium__.
There are some, except that pentium or __pentium__ is not what gcc
defines ;)
# /opt/rtems/bin/i386-rtems-gcc -v -mcpu=pentium -o tmp.o tmp.c
..
gcc version 3.2 (OAR Corporation gcc-3.2-20021114/newlib-1.10.0-20021114
4a)
/opt/rtems/lib/gcc-lib/i386-rtems/3.2/cc1 -lang-c -v -D__GNUC__=3
-D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=0 -D__GXX_ABI_VERSION=102
-D__rtems__ -D__ELF__ -D__i386__ -D__USE_INIT_FINI__ -D__rtems__
-D__ELF__ -D__i386__ -D__USE_INIT_FINI__
-Asystem=rtems -D__NO_INLINE__ -D__STDC_HOSTED__=1 -Acpu=i386
-Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i586__
-D__tune_pentium__ tmp.c -quiet -dumpbase tmp.c -mcpu=pentium -version
-o /tmp/ccW8xY5J.s
..
Note the __tune_pentium___
# /opt/rtems/bin/i386-rtems-gcc -v -march=pentium -o tmp.o tmp.c
..
gcc version 3.2 (OAR Corporation gcc-3.2-20021114/newlib-1.10.0-20021114
4a)
/opt/rtems/lib/gcc-lib/i386-rtems/3.2/cc1 -lang-c -v -D__GNUC__=3
-D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=0 -D__GXX_ABI_VERSION=102
-D__rtems__ -D__ELF__ -D__i386__ -D__USE_INIT_FINI__ -D__rtems__
-D__ELF__ -D__i386__ -D__USE_INIT_FINI__
-Asystem=rtems -D__NO_INLINE__ -D__STDC_HOSTED__=1 -Acpu=i386
-Amachine=i386 -Di386 -D__i386 -D__i386__ -D__i586 -D__i586__
-D__pentium -D__pentium__ -D__tune_i586__ -D__tune_pentium__ tmp.c
-quiet -dumpbase tmp.c -march=pentium -version -o /tmp/ccwYefwb.s
Note: __i586__ and __pentium__ and __tune_pentium__
I am far from being an i386 expert, but all this lets me think you would
want to use -march=pentium instead of -mcpu=pentium.
> My solution to that, without modifying any source file,
IMO, the "pentium" inside of the source code must be changed into a
"__pentium__" or "__i585__" rsp. "__tune_i585__" or "__tune_pentium__",
depending on what the objective of using the define is.
(I didn't follow this thread closely enough.)
> is to pass the
> macros as argument to Make when building RTEMS:
Ralf
More information about the users
mailing list