Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jan 2009 14:11:33 -0800
From:      Bakul Shah <bakul@bitblocks.com>
To:        Peter Jeremy <peterjeremy@optushome.com.au>
Cc:        freebsd-hackers@freebsd.org
Subject:   cc -m32 (was Re: critical floating point incompatibility 
Message-ID:  <20090129221134.0EAA35B21@mail.bitblocks.com>
In-Reply-To: Your message of "Fri, 30 Jan 2009 05:44:00 %2B1100." <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>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 30 Jan 2009 05:44:00 +1100 Peter Jeremy <peterjeremy@optushome.com.au>  wrote:
> 
> On 2009-Jan-28 11:24:21 -0800, Bakul Shah <bakul@bitblocks.com> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090129221134.0EAA35B21>