For now, this page is focused on installing and using a stock x86 (i386) binary GHC distribution on x86_64 (amd64) Ubuntu computers. But, in principle, compiling for 32 bits on 64 bits should be possible on any architecture and OS that has multi-arch capabilities. The problems and workarounds may be similar, too (and similar to problems with cross-compilation). Please add your experience reports here. So far, this is known to work on Ubuntu precise, LTS 12.04.4, GHC 7.8.3, cabal 1.20.
Compiling i386 Haskell programs on a x86_64 system can be accomplished by building a proper cross-compiler. The method described below doesn't involve building GHC with different host and target, but does involve running a (stock binary distribution of) GHC with i386 target (and intended host) on a by-default x86_64 OS (the actual host). See #9421 for context and common problems. Please report any new spotted problems there.
Installing the i386 GHC
Make sure you have the x86_64/i386 multi-arch system in place and install the i386 libs you are going to link to, e.g., zlib1g-dev:i386 and the ia32-libs set on Ubuntu 12.04 and individual libraries on newer Ubuntu versions.
Either install libgmp-dev:i386 if your OS permits both the i386 and x86_64 versions (Ubuntu 12.04 doesn't; you can also force-override the ban) or hack around by making a symlink, e.g.,
For GHC 7.10.3, setting CFLAGS at configure time is enough to allow the installation to succeed, but doesn't tell the installed compiler to pass -m32 to gcc. Edit the settings file (your_prefix/lib/ghc-X.Y.Z/settings) to add -m32 to "C compiler flags".
To avoid linking to the wrong version of zlib, when you compile packages that depend on it, you may need to install the haskell package zlib specially: