From owner-freebsd-amd64@FreeBSD.ORG Wed Jun 3 03:50:58 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 824961065672 for ; Wed, 3 Jun 2009 03:50:58 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 594718FC0C for ; Wed, 3 Jun 2009 03:50:58 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from apple.my.domain (root@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n533or7x041277 for ; Wed, 3 Jun 2009 03:50:57 GMT (envelope-from davidxu@freebsd.org) Message-ID: <4A25F31D.4040201@freebsd.org> Date: Wed, 03 Jun 2009 11:50:53 +0800 From: David Xu User-Agent: Thunderbird 2.0.0.9 (X11/20080612) MIME-Version: 1.0 To: freebsd-amd64@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: 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 03:50:58 -0000 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 Regards, David Xu