From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21935 invoked by alias); 17 Mar 2011 05:21:26 -0000 Received: (qmail 21895 invoked by uid 22791); 17 Mar 2011 05:21:24 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-iy0-f175.google.com (HELO mail-iy0-f175.google.com) (209.85.210.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 17 Mar 2011 05:21:18 +0000 Received: by iyb26 with SMTP id 26so2514724iyb.20 for ; Wed, 16 Mar 2011 22:21:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.42.141.196 with SMTP id p4mr1338087icu.180.1300339276427; Wed, 16 Mar 2011 22:21:16 -0700 (PDT) Received: by 10.43.135.9 with HTTP; Wed, 16 Mar 2011 22:21:16 -0700 (PDT) In-Reply-To: <201103162257.10440.vapier@gentoo.org> References: <201103160124.42939.vapier@gentoo.org> <201103162257.10440.vapier@gentoo.org> Date: Thu, 17 Mar 2011 05:21:00 -0000 Message-ID: Subject: Re: X32 psABI status update From: "H.J. Lu" To: Mike Frysinger Cc: libc-alpha@sourceware.org, GCC Development , LKML , x32-abi@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2011-03/txt/msg00221.txt.bz2 On Wed, Mar 16, 2011 at 7:57 PM, Mike Frysinger wrote: > On Wednesday, March 16, 2011 08:39:57 H.J. Lu wrote: >> On Tue, Mar 15, 2011 at 10:24 PM, Mike Frysinger wrote: >> > so we get back to my original e-mail: >> > =A0 =A0 =A0 =A0are you getting a unique host tuple for this ? =A0or ar= e you >> > extending x86_64-linux-gnu ? =A0so the only way of knowing which ABI i= s to >> > check for the output of the compiler+compiler flags ? >> >> As I said, the target is x86_64- linux-gnu and you just add -mx32 to >> CFLAGS. The x86_64- linux-gnu binutils and GCC support =A0x32. > > ok, took long enough, but that answers most things. =A0your usage of "x32= -" > prefixed binaries in the documentation seems to imply a lot more than the= fact > you just picked those locally to avoid system collisions. =A0this isnt a = wiki > page, otherwise i'd clean things up for you. Any suggestion how to create a wiki page for x32? > in looking at the gcc files, it doesnt seem like there's any defines setu= p to > declare x32 directly. =A0instead, you'd have to do something like: > #ifdef __x86_64__ > # if __SIZEOF_LONG__ =3D=3D 8 > /* x86_64 */ > # else > /* x32 */ > # endif > #endif > > any plans on adding an __x32__ (or whatever) cpp symbol to keep people fr= om > coming up with their own special/broken crap ? =A0or are there some alrea= dy that > i'm not seeing ? The idea is in most cases, you only need to check __x86_64__ since x32 and x86-64 are very close. In some cases, x32 is very different from x86_64, l= ike assembly codes on long and pointer, you can check __x86_64__ and __LP64__. In glibc, I used a different approach by using macros REG_RAX, .., MOV_LP, ADD_LP, SUB_LP and CMP_LP in assembly codes. I added a simple howto for x32 compiling to https://sites.google.com/site/x32abi/ Thanks. --=20 H.J.