Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jul 2008 15:01:44 -0400
From:      Mike Meyer <mwm@mired.org>
To:        Chuck Robey <chuckr@telenix.org>
Cc:        freebsd-amd64@freebsd.org
Subject:   Re: app programming on freebsd amd64
Message-ID:  <20080731150144.6cf2374e@mbook.local>
In-Reply-To: <4891F3F3.8090608@telenix.org>
References:  <4891F3F3.8090608@telenix.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 31 Jul 2008 13:18:43 -0400 Chuck Robey <chuckr@telenix.org> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> I admit it, I'm a hobbyist, so I don't really want to make use of ports.  The
> fun's NOT in having everything handed to you, and the ports people try hard as
> hell to prevent you from doing anything on your own.  My current project deals
> with Xorg.  I recently finished getting Xorg and Xfree86 to build on my x86 box,
> so I could compare the two.

Well, some folks enjoy ...

> 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.  What would the flags be, if I want to build 32 bit
> things, both libs and  apps?  I'll worry about handling any other problems, I
> just want to know the way to coax gcc (and gnu-ld) to think purely 32 bit.
> 
> Can you help me here?

Well, the obvious thing to do to help is ask why wouldn't you want 64
bit apps & libraries on a 64 bit platform? That's what you get if you
install the package or build the port.

Anyway, the flag you want for gcc is "-m32". Given that flag, it will
invoke gnu-ld trying to build 32 bit applications as well, so just use
gcc as your linker with that flag.

Of course, last time I checked, neither of these did things like
making sure you got the right version of platform-specific header
files or linked with the right libraries and support code.  I also
recall some reports that, once you get things to work, the resulting
binaries don't run on i386 platforms.

	 <mike
-- 
Mike Meyer <mwm@mired.org>		http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org



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