[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080520090949.GI17716@cs181133002.pp.htv.fi>
Date: Tue, 20 May 2008 12:09:49 +0300
From: Adrian Bunk <bunk@...sta.de>
To: "H. Peter Anvin" <hpa@...or.com>
Cc: Harvey Harrison <harvey.harrison@...il.com>,
linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists