From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 29 22:11:35 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F1D3106564A for ; Thu, 29 Jan 2009 22:11:35 +0000 (UTC) (envelope-from bakul@bitblocks.com) Received: from mail.bitblocks.com (bitblocks.com [64.142.15.60]) by mx1.freebsd.org (Postfix) with ESMTP id 2C12C8FC0A for ; Thu, 29 Jan 2009 22:11:35 +0000 (UTC) (envelope-from bakul@bitblocks.com) Received: from bitblocks.com (localhost.bitblocks.com [127.0.0.1]) by mail.bitblocks.com (Postfix) with ESMTP id 0EAA35B21; Thu, 29 Jan 2009 14:11:33 -0800 (PST) To: Peter Jeremy In-reply-to: Your message of "Fri, 30 Jan 2009 05:44:00 +1100." <20090129184400.GI1755@server.vk2pj.dyndns.org> References: <20071220093950.GA79196@server.vk2pj.dyndns.org> <20071221181125.0B6F25B42@mail.bitblocks.com> <20071221201633.GM57756@deviant.kiev.zoral.com.ua> <200901261651.29116.jhb@freebsd.org> <20090128192421.C9E3D5B13@mail.bitblocks.com> <20090129184400.GI1755@server.vk2pj.dyndns.org> Comments: In-reply-to Peter Jeremy message dated "Fri, 30 Jan 2009 05:44:00 +1100." Date: Thu, 29 Jan 2009 14:11:33 -0800 From: Bakul Shah Message-Id: <20090129221134.0EAA35B21@mail.bitblocks.com> Cc: freebsd-hackers@freebsd.org Subject: cc -m32 (was Re: critical floating point incompatibility 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: Thu, 29 Jan 2009 22:11:35 -0000 On Fri, 30 Jan 2009 05:44:00 +1100 Peter Jeremy wrote: > > On 2009-Jan-28 11:24:21 -0800, Bakul Shah wrote: > >On a mac, cc -m64 builds 64 bit binaries and cc -m32 builds > >32 bit binaries. The following script makes it as easy to do > >so on a 64 bit FreeBSD -- at least on the few programs I > >tried. Ideally the right magic needs to be folded in gcc's > >builtin "specs". > > > >#!/bin/sh > >args=3D/usr/bin/cc > >while [ ".$1" !=3D . ] > >do > > a=3D$1; shift > > case $a in > > -m32) args=3D"$args -B/usr/lib32 -I/usr/include32 -m32";; > > *) args=3D"$args $a";; > > esac > >done > >$args > > You also need to manually populate /usr/include32 since it doesn't > exist by default and may still get bitten by stuff in > /usr/local/include. Do you have a script (or installworld patches) to > do this? Yes, includes for native programs will may cause trouble -- but you can't use -nostdinc (as that would take away that feature from a user), which is why this needs to be in the gcc specs. I don't have a script as I just copied include directories from a i386 system. But a script would be better. This script was an initial stab at proper -m32 support and needs more work. I will be happy to work with you or anyone else to make this happen.