Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Nov 2007 16:14:26 +0000 (UTC)
From:      wb@arb-phys.uni-dortmund.de (W.B. Kloke)
To:        freebsd-amd64@freebsd.org
Subject:   How to compile 32bit applications on FreeBSD-amd64?
Message-ID:  <1196266496.551294@vestein.arb-phys.uni-dortmund.de>

next in thread | raw e-mail | index | archive | help
Is there an easy way to build a 32bit application on an amd64 system?

Specifically, I want to build the Haskell compiler GHC on my system.
(My answer about the regular way to port it on the GHC mailing list has not
been anwered yet.) I have a working 32bit GHC-6.8.1 available. I managed to
compile a sample program to i386 object code. But I did not manage to link
it.

I used the script as32

#!/bin/sh
/usr/bin/cc -Xassembler -32 $*

as a replacement for the assembler, and got so far.
I did not succeed in working out an equivalent 32bit ld.

#!/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.

-- 
Dipl.-Math. Wilhelm Bernhard Kloke
Institut fuer Arbeitsphysiologie an der Universitaet Dortmund
Ardeystrasse 67, D-44139 Dortmund, Tel. 0231-1084-257
PGP: http://vestein.arb-phys.uni-dortmund.de/~wb/mypublic.key




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