From owner-freebsd-amd64@FreeBSD.ORG Thu Jul 31 22:59:27 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 AEC071065676 for ; Thu, 31 Jul 2008 22:59:27 +0000 (UTC) (envelope-from chuckr@telenix.org) Received: from mail8.sea5.speakeasy.net (mail8.sea5.speakeasy.net [69.17.117.10]) by mx1.freebsd.org (Postfix) with ESMTP id 875BE8FC14 for ; Thu, 31 Jul 2008 22:59:27 +0000 (UTC) (envelope-from chuckr@telenix.org) Received: (qmail 17687 invoked from network); 31 Jul 2008 22:59:26 -0000 Received: from april.chuckr.org (HELO april.telenix.org) (chuckr@[66.92.151.30]) (envelope-sender ) by mail8.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 31 Jul 2008 22:59:26 -0000 Message-ID: <489243B0.80307@telenix.org> Date: Thu, 31 Jul 2008 18:58:56 -0400 From: Chuck Robey User-Agent: Thunderbird 2.0.0.6 (X11/20071107) MIME-Version: 1.0 To: Peter Jeremy References: <4891F3F3.8090608@telenix.org> <20080731195527.GT1359@server.vk2pj.dyndns.org> In-Reply-To: <20080731195527.GT1359@server.vk2pj.dyndns.org> X-Enigmail-Version: 0.95.5 OpenPGP: id=F3DCA0E9; url=http://pgp.mit.edu Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 22:59:27 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Peter Jeremy wrote: > 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? You mean, why not use ports? You'd have to be fairly blind not to understand this... would you tell the hunter that you can't understand why they don't just visit the butcher's? Or tell the electronics hobbyist that they just ought to buy themselves a big stereo and be done with it? But you can't understand why someone who enjoys hacking wouldn't rather lay back and let YOU do it. Honestly, aren't you being just a little bit blind here? Read my paragraph again, and try to concentrate on the very first two sentences, I wasn't unclear or indirect. I wasn't trying to force you to go my way, just stop trying to make me go your way. Some of us happen to enjoy screwing around with applications. Not the applications (using firefox), programming them, there IS a difference. > >> 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". Thanks, is that all? Easy enough, appreciate that. 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. Well, I'm doing this with X11, which was written to begin with in a 32 bit atmosphere, and does have several nontrivial 64 bit problems. Yes, I could go back and fix them, but right now, that's not the main road, I need to build it as a test environment, for something else I'm writing, not as a goal in itself. I may well back up in a month or two and get it up in 64 bit mode, there's reason to do that, but right now, it'd only serve to slow up my main goal. > > 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. Oh, you're telling me that if I run one app as 32 bit (compiling it, the whole enchilada, as 32 bit) would only work if I had the OS, kernel and all libs, as 32 bits? I couldn't just run the X11 as 32 bits? I mean, not only run it as 32 bits, also compile it as 32 bits? If I did that, it would use the OS and libs as 64 bits, and be therefore incorrect? If that's so, it does throw a wrench into things, forcing another set of decisions on me, so I need a confirmation, you'll understand. 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 > -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkiSQ7AACgkQz62J6PPcoOnxeACeMhnPu+1Vg/mBRXlVqSHzXNEl 9fsAoIZYUKSVI8xLNx5LCoD4j13ACdxP =4//P -----END PGP SIGNATURE-----