This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] always define __sparc64__ on ultrasparc
- From: "David O'Brien" <obrien at freebsd dot org>
- To: "David S. Miller" <davem at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, jhb at freebsd dot org
- Date: Fri, 17 May 2002 00:28:30 -0700
- Subject: Re: [PATCH] always define __sparc64__ on ultrasparc
- Organization: The NUXI BSD group
- References: <20020516210458.A85424@dragon.nuxi.com> <20020516.210824.119537595.davem@redhat.com>
- Reply-to: obrien at freebsd dot org
On Thu, May 16, 2002 at 09:08:24PM -0700, David S. Miller wrote:
> Since __sparc64__ is in the compilers namespace, I don't think this patch
> will cause a problem for anyone.
>
> The standard thing to do is use __sparc__ && __arch64__, __sparc64__
> does not exist.
Where does __arch64__ come from? I only see it used in config/sparc, so
I wouldn't say it is a GCC standard. I don't see it being used by SunPro
5.0 either.
$ cc -# foo.c
/opt/SUNWspro/bin/../SC5.0/bin/acomp -i foo.c -y-fbe -y/opt/SUNWspro/bin/../SC5.0/bin/fbe -y-xarch=v7 -y-o -yfoo.o -y-s -y-verbose -Qy -D__SunOS_5_8 -D__SUNPRO_C=0x500 -D__SVR4 -D__unix -D__sun -D__sparc -D__BUILTIN_VA_ARG_INCR -Xa -D__PRAGMA_REDEFINE_EXTNAME -Dunix -Dsun -Dsparc -D__RESTRICT -I/opt/SUNWspro/SC5.0/include/cc "-g/opt/SUNWspro/bin/../SC5.0/bin/cc -c "
$ cc -# -xarch=v9 foo.c
/opt/SUNWspro/bin/../SC5.0/bin/acomp -i foo.c -y-fbe -y/opt/SUNWspro/bin/../SC5.0/bin/fbe -y-xarch=v9 -y-o -yfoo.o -y-s -y-verbose -Qy -D__SunOS_5_8 -D__SUNPRO_C=0x500 -D__SVR4 -D__unix -D__sun -D__sparcv9 -D__sparc -D__BUILTIN_VA_ARG_INCR -Xa -D__PRAGMA_REDEFINE_EXTNAME -Dunix -Dsun -Dsparc -D__RESTRICT -I/opt/SUNWspro/SC5.0/include/cc -xarch=v9 -fparam_ir "-g/opt/SUNWspro/bin/../SC5.0/bin/cc -xarch=v9 -c "
> I would recommend, however, that these two systems stop making use of
> __sparc64__ and use __arch64__ instead. If you look, that is what the
> generic Sparc backend and the floating point headers, use to test this.
As Jason mentioned, in BSD'ville, the platform's name is always defined.
We test this this in many places thru out /usr/src.