Re: [2.6 patch] asm-generic/int-ll64.h: always provide __{s,u}64

From: Adrian Bunk
Date: Tue May 20 2008 - 05:12:16 EST


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/