ghc won't build on non-i686 x86 systems because the binary bootstrapping ghc is configured to use i686-pc-linux-gnu-gcc. This is of course absent if you have say an i486 gentoo system (like me!).
The settings file is...
# cat /var/tmp/portage/dev-lang/ghc-7.6.3-r1/work/usr/lib/ghc-7.6.3/settings
[("GCC extra via C opts", " -fwrapv"),
("C compiler command", "i686-pc-linux-gnu-gcc"),
("C compiler flags", ... [snip]
The ebuild should tweak the settings file to a reasonable gcc after unpacking.
A work-around to get a working ghc installation:
USE=binary emerge ghc
nano -w /usr/lib/ghc-7.6.3/settings (change C compiler to just "gcc")
We build ghc binary on i686 CHOST.
You have potential problem if ghc will use CMOVs for example.
Why you are using i486 CHOST?
Last time I asked user why he needs i486 was just his unawareness
that his VIA CPU was i686 capable.
Can you show your target's /proc/cpuinfo?
But I'm not against any changes helping your use case.
I am using a i486 gentoo chroot to build an OS image that will run on actual 486 hardware (cyrix 5x86DX I think). Build cpu is really a modern amd64, so I won't have any issues with i686 specific instructions. I only want Haskell to try out Shake for the build system. No plans on running any Haskell on the 486 machine.
But, I've seen at least 2 other threads in forums with this problem. One of them may have been the VIA CPU issue you mentioned.
*** Bug 548796 has been marked as a duplicate of this bug. ***
*** Bug 607142 has been marked as a duplicate of this bug. ***