From owner-freebsd-amd64@FreeBSD.ORG Thu Jul 31 19:55:31 2008 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 2A87D1065676 for ; Thu, 31 Jul 2008 19:55:31 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail13.syd.optusnet.com.au (mail13.syd.optusnet.com.au [211.29.132.194]) by mx1.freebsd.org (Postfix) with ESMTP id B22128FC0A for ; Thu, 31 Jul 2008 19:55:30 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from server.vk2pj.dyndns.org (c122-106-215-175.belrs3.nsw.optusnet.com.au [122.106.215.175]) by mail13.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id m6VJtRCK026941 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 1 Aug 2008 05:55:28 +1000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.2/8.14.2) with ESMTP id m6VJtRO0060132; Fri, 1 Aug 2008 05:55:27 +1000 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.2/8.14.2/Submit) id m6VJtRSj060131; Fri, 1 Aug 2008 05:55:27 +1000 (EST) (envelope-from peter) Date: Fri, 1 Aug 2008 05:55:27 +1000 From: Peter Jeremy To: Chuck Robey Message-ID: <20080731195527.GT1359@server.vk2pj.dyndns.org> References: <4891F3F3.8090608@telenix.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="96YOpH+ONegL0A3E" Content-Disposition: inline In-Reply-To: <4891F3F3.8090608@telenix.org> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-amd64@freebsd.org Subject: Re: app programming on freebsd amd64 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: Thu, 31 Jul 2008 19:55:31 -0000 --96YOpH+ONegL0A3E Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2008-Jul-31 13:18:43 -0400, Chuck Robey wrote: >I admit it, I'm a hobbyist, so I don't really want to make use of ports. Each to his own... But why bother re-inventing the wheel? >Right now, I want to build xorg on the amd64 platform. It seems that >if I don't supply the correct flags (which I don't know about) then >the amd64 gcc gives me 64 bit apps & libraries. gcc on amd64 defaults to 64-bit because that is the native mode. > What would the flags >be, if I want to build 32 bit things, both libs and apps? The gcc flag to make gcc emit i386 code is "-m32". Note that FreeBSD _does_not_ include the infrastructure for this to work - the contents of /usr/include/machine all define/assume I32LP64. If you compile with '-m32', you wind up with objects that should be 64-bit (eg off_t) being 32-bits long - which in turn breaks stat(2), mmap(2) etc. And, even if you get a trivial app to link, it won't run on on a real i386 because it has the wrong rtld name embedded in it. There are a couple of open PRs about this but fixing it is non-trivial. Your only current option is to install an i386 world (as well as your amd64 world) and chroot into it to build i386 apps. Note that even this approach will not work for things that use libkvm or otherwise grovel around in kmem. >about handling any other problems, I just want to know the way to >coax gcc (and gnu-ld) to think purely 32 bit. Install FreeBSD/i386 --=20 Peter Jeremy Please excuse any delays as the result of my ISP's inability to implement an MTA that is either RFC2821-compliant or matches their claimed behaviour. --96YOpH+ONegL0A3E Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkiSGK8ACgkQ/opHv/APuIfCvwCgjJOLiKnREQAws3Gd/N52STia wYIAn0YzxbAwGIiREPLtaoKSGI9XgDgw =pZ/Z -----END PGP SIGNATURE----- --96YOpH+ONegL0A3E--