Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Nov 2007 13:35:46 -0500
From:      Mike Meyer <mwm@mired.org>
To:        freebsd-amd64@freebsd.org
Subject:   Re: How to compile 32bit applications on FreeBSD-amd64?
Message-ID:  <20071128133546.3e5154a5@mbook.mired.org>
In-Reply-To: <1196266496.551294@vestein.arb-phys.uni-dortmund.de>
References:  <1196266496.551294@vestein.arb-phys.uni-dortmund.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 28 Nov 2007 16:14:26 +0000 (UTC) wb@arb-phys.uni-dortmund.de (W.B. Kloke) wrote:

> Is there an easy way to build a 32bit application on an amd64 system?

Not really.

> #!/bin/sh
> /usr/bin/cc -Wl,-m,elf_i386_fbsd,-L,/usr/lib32
> 
> does not really work, because it tries to link /usr/lib/libgcc.a, crt1.o
> and other 64bit programs instead of the right ones.

You need to explicitly list all the 32 bit versions of all those 64 bit libraries it's trying to link in. Once you do that, it'll work. There have been notes here indicating that the resulting binary won't run on a 32 bit system because of the differences in library locations, but I haven't verified it.

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



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