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

Sergei Trofimovich slyfox at gentoo.org
Tue Dec 20 09:11:27 PST 2011


On Tue, 20 Dec 2011 08:41:44 -0800
Alan Coopersmith <alan.coopersmith at oracle.com> wrote:

> 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

(aside) Having compile-time checks for the things would help finding such
mismatches less painful.

Thanks!

-- 

  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/76c3a587/attachment.pgp>


More information about the xorg-devel mailing list