[xproto: PATCH] Xmd.h: amd64-x32 ABI defines sizeof(long) == sizeof (void*) == 4

Sergei Trofimovich slyich at gmail.com
Tue Dec 20 12:26:36 PST 2011


> > On 12/20/11 08:37, Sergei Trofimovich wrote:
> > > +     (defined(__amd64__)&&  defined(__LP64__)) /* skip x32 */ || \
> > > +     defined(amd64) || \
> > 
> > Really?  Someone defined __amd64__ on a non LP64 platform and didn't expect
> > to break tons of software?   Amazing...
> 
> A bit will break, yes. But I don't thing there is that much software which relies on
> the sizes. If not take __amd64__ into account it's "just" a 32-bit target.
> 
> > Are you sure that every real amd64 platform that uses __amd64__ defines __LP64__
> > as well?
> 
> Nope, I am not. Just done what https://sites.google.com/site/x32abi/ suggests.
> 
> We can go reverse and get
>     #define __SIZEOF_LONG__ 4
> as a guard against LONG64 if you like

Another option would be to drop '__amd64__' from ifdefs entirely and rely solely on __LP64__
like mips64 does (it also has -mabi=n32 / -mabi=64 very similar to x32 / x86_64)
It make sense as sizeof long has no direct relation to used ISA.

[O.T.: Dropping __ia64__ would make sense as well as there is -milp32 (not that it's supported)]

What would you prefer?

-- 

  Sergei
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20111220/1977c00e/attachment.pgp>


More information about the xorg-devel mailing list