How to solve ghc-stage2: mkTextEncoding: invalid argument (Invalid argument) issue.

Karel Gardas karel.gardas at
Wed Sep 16 04:23:58 EDT 2009

Before going to trace anything I've compared sparky and my setup and it
seems I've had forgotten libiconv library in /usr/local/lib and
LD_LIBRARY_PATH contained this lib. So I've modified LD_LIBRARY_PATH to
exclude /usr/local/lib and now surprisingly base configure fails with:

checking for library containing iconv... no
configure: error: iconv is required on non-Windows platforms
make[1]: *** [libraries/base/dist-install/] Error 1
make: *** [all] Error 2


When I've seen the code it's not so surprising that it fails in this
way, what's in fact surprising to me is that sparky passes belong this

checking for library containing iconv... none required
configure: creating ./config.status
config.status: creating base.buildinfo
config.status: creating include/HsBaseConfig.h


I'm sorry for starting this #91 build on sparky, but I'd like verify
that it does not build older source-code than my buildbot.

So now, the question is: is GNU iconv really required or if it's not,
how to make my buildbot ignoring it as sparky's buldbot seems to be doing?


Duncan Coutts wrote:
> Dig into base/GHC/IO/Encoding/Iconv.hs mkTextEncoding function where it
> calls iconv_open, see what it's being called with.
> In particular check if HAVE_LANGINFO_H is getting defined. If it's not
> then the code assumes GNU iconv.
>> PS: for reference, please have a look at
> See also the
> Which is running Solaris 10 on sparc and seems to be working fine.
> Duncan

More information about the Glasgow-haskell-users mailing list