From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 28 06:04:24 2006 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 34F0B16A4DA for ; Mon, 28 Aug 2006 06:04:24 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7F7A243D70 for ; Mon, 28 Aug 2006 06:04:23 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.4/8.13.4) with ESMTP id k7S61H6I062095; Mon, 28 Aug 2006 00:01:17 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 28 Aug 2006 00:01:30 -0600 (MDT) Message-Id: <20060828.000130.-1264101530.imp@bsdimp.com> To: sgk@troutmask.apl.washington.edu From: "M. Warner Losh" In-Reply-To: <20060826212607.GA82729@troutmask.apl.washington.edu> References: <20060826192418.GA82155@troutmask.apl.washington.edu> <17648.42078.268722.152591@bhuda.mired.org> <20060826212607.GA82729@troutmask.apl.washington.edu> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Mon, 28 Aug 2006 00:01:17 -0600 (MDT) Cc: hackers@freebsd.org, mwm@mired.org Subject: Re: amd64 questions X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Aug 2006 06:04:24 -0000 In message: <20060826212607.GA82729@troutmask.apl.washington.edu> Steve Kargl writes: : On Sat, Aug 26, 2006 at 03:43:26PM -0400, Mike Meyer wrote: : > In <20060826192418.GA82155@troutmask.apl.washington.edu>, Steve Kargl typed: : >> On Sat, Aug 26, 2006 at 02:40:24PM -0400, Mike Meyer wrote: : >>> I'm not sure what you're saying is false - that the compiler can : >>> generate i386 binaries, or that the rest of the toolchain doesn't do : >>> the right thing. : >>> I can build i386 binaries with the system cc. However, if I just : >>> specify '-m32', it dies during the link because it tries to link with : >>> amd64 object files. I've managed to get some simple things to build by : >>> passing the appropriate command line to cc. : >>> Would rebuilding the compiler with multilibs fix that problem? Or does : >>> it assume a library structure that isn't in place on FreeBSD? : >> I believe it is a library structure problem. You need at least : >> a 32-bit and 64-bit libgcc.so. When you use -m32 the compiler : >> goes looking for an appropriate libgcc.so and only finds a 64-bit : >> version. : > : > Yup. If you tell it -L/usr/lib32 (which gets installed if you build the : > world with WITH_LIB32 defined), it'll find that. Then complain because : > /lib/crt1.o is the 64 bit one. If I use the command line arguments: : > : > -m32 -nostartfiles /usr/lib32/crt1.o /usr/lib32/crti.o \ : > /usr/lib32/crtbegin.o /usr/lib32/crtend.o /usr/lib32/crtn.o -L/usr/lib32 : > : > simple programs build and run properly. : : If gcc is built with multilib, it's my understanding that you : don't need to do all of this commandline mangling. You also don't need it if you build gcc and binutils with a tools prefix :-) Warner