Messages in this thread | | | Date | Tue, 20 May 2008 12:09:49 +0300 | From | Adrian Bunk <> | Subject | Re: [2.6 patch] asm-generic/int-ll64.h: always provide __{s,u}64 |
| |
On Mon, May 19, 2008 at 06:16:29PM -0700, H. Peter Anvin wrote: > Adrian Bunk wrote: >>>> >>> This is a valid point. This should be __i486__ for userspace, which >>> is gcc's way to tell you if you're compiling with -march=i486. >> >> This doesn't help if you're compiling with e.g. -march=pentium > > Yes, it does. -march=pentium defines __i486__ as well as __i586__, and > so on.
$ cat test.c #include <stdio.h>
int main() { #ifdef __i486__ printf("foobarbaz\n"); #endif
return 0; } $ gcc -O2 -march=i486 -Wall test.c; ./a.out foobarbaz $ gcc -O2 -march=pentium -Wall test.c; ./a.out $ gcc --version gcc (Debian 4.3.0-4) 4.3.1 20080501 (prerelease) ... $ /usr/local/DIR/gcc-3.2.3/bin/gcc -O2 -march=i486 -Wall test.c; ./a.out foobarbaz $ /usr/local/DIR/gcc-3.2.3/bin/gcc -O2 -march=pentium -Wall test.c; ./a.out $ /usr/local/DIR/gcc-3.2.3/bin/gcc --version gcc (GCC) 3.2.3
> -hpa
cu Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said. Pearl S. Buck - Dragon Seed
| |