From owner-freebsd-arch@FreeBSD.ORG Thu Jul 29 22:27:18 2010 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B07C91065676 for ; Thu, 29 Jul 2010 22:27:18 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id 86CB88FC1F for ; Thu, 29 Jul 2010 22:27:18 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id ABC1D582C7; Thu, 29 Jul 2010 17:27:17 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id r3HHItGN-leA; Thu, 29 Jul 2010 17:27:17 -0500 (CDT) Received: from wanderer.tachypleus.net (adsl-75-50-88-235.dsl.mdsnwi.sbcglobal.net [75.50.88.235]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 2F1DE582C4; Thu, 29 Jul 2010 17:27:17 -0500 (CDT) Message-ID: <4C520044.5020002@freebsd.org> Date: Fri, 30 Jul 2010 00:27:16 +0200 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.11) Gecko/20100727 Thunderbird/3.0.6 MIME-Version: 1.0 To: Tijl Coosemans References: <201007291718.12687.tijl@coosemans.org> In-Reply-To: <201007291718.12687.tijl@coosemans.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: pluknet , freebsd-arch@freebsd.org Subject: Re: Support for cc -m32 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jul 2010 22:27:18 -0000 On 07/29/10 17:18, Tijl Coosemans wrote: > Hi, > > I've put the initial version of some patches online to support cross > compilation of 32 bit binaries on amd64. It's modelled after how NetBSD > does this. > > With these patches something like "cc -m32 -o test test.c -pthread -lm" > generates a program that runs on FreeBSD/i386. > > http://people.freebsd.org/~tijl/cc-m32-1.diff > http://people.freebsd.org/~tijl/cc-m32-2.diff > http://people.freebsd.org/~tijl/cc-m32-3.diff > > *cc-m32-1.diff* : Let ld and cc find 32 bit libraries. > > *cc-m32-2.diff* : Install i386 headers on amd64. > Why not use the GCC multilib code for what patch 1 does? There is already code in cc_tools/Makefile to handle this for powerpc64 (where cc -m32 already works). -Nathan