From owner-freebsd-amd64@FreeBSD.ORG Wed Jun 3 05:38:32 2009 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42AC01065672; Wed, 3 Jun 2009 05:38:32 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by mx1.freebsd.org (Postfix) with ESMTP id 240E38FC15; Wed, 3 Jun 2009 05:38:32 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.3/8.14.3) with ESMTP id n535cVds035961; Tue, 2 Jun 2009 22:38:31 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.3/8.14.3/Submit) id n535cVc1035960; Tue, 2 Jun 2009 22:38:31 -0700 (PDT) (envelope-from sgk) Date: Tue, 2 Jun 2009 22:38:31 -0700 From: Steve Kargl To: David Xu Message-ID: <20090603053831.GA35940@troutmask.apl.washington.edu> References: <4A25F31D.4040201@freebsd.org> <20090603044320.GA35526@troutmask.apl.washington.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090603044320.GA35526@troutmask.apl.washington.edu> User-Agent: Mutt/1.4.2.3i Cc: freebsd-amd64@freebsd.org Subject: Re: gcc -m32 and int64_t X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 05:38:32 -0000 On Tue, Jun 02, 2009 at 09:43:20PM -0700, Steve Kargl wrote: > On Wed, Jun 03, 2009 at 11:50:53AM +0800, David Xu wrote: > > It seems there is a problem in /sys/am64/_types.h when cross-compiling a > > 32-bit code in amd64 machine, the following code prints 4 instead of 8: > > > > /* int64_size.c */ > > > > #include > > #include > > > > int main() > > { > > printf("%d\n", sizeof(int64_t)); > > return (0); > > } > > > > > > $cc -m32 -o int64_size -B /usr/lib32/ int64_size.c > > $./int64_size > > 4 > > > > IIRC, the c compiler in the base system isn't setup > to be a cross-compiler. So, there are probably many > more problems than the one shown above. Peter Wemm > has posted about this previously. > For more info, see http://www.freebsd.org/cgi/query-pr.cgi?pr=gnu/112215 -- Steve