[Haskell-cafe] lambda-bot installation problem: gentoo trickery problem

Wirt Wolff wirtwolff at gmail.com
Thu Nov 12 04:30:18 EST 2009


Excerpts from Евгений Пермяков's message of Thu Nov 12 00:33:07 -0700 2009:
> When I try  cabal-install lambdabot (gentoo linux/amd64, ghc installed with
> portage), it runs fine until compiler tries to link readline package (some
> template haskell?). The problem caused by dirty trick, used in gentoo: the
> /usr/lib64/libreadline is a fake with script, redirecting ld to /lib64 . GHC
> is not redirected but simply fails with message  "can't load .so/.DLL for:
> readline (/usr/lib64/libreadline.so: invalid ELF header)".

Yes, this is painful. There are discussions going on on ghc and on
gentoo trackers for better ways to handle this. [1] [2]

The problem is not gentoo specific though. Many other distros also use
ld scripts, for example the same problem occurs using ubuntu.

> So, the question is: is there any workaround? Copying library look like an
> option, but it is very, very dirty one. Is there a way to say ghc, which
> libreadline.so it should  load?

To build lambdabot, and in other similar situations I have renamed the
ld script temporarily and symlinked to the appropriate real .so then after
the build put things back as they were. There are cases when this isn't
sufficient, for example when the problem lib is needed for ongoing
development project. Others more knowledgable can speak to how they've
handled that.

[1] http://hackage.haskell.org/trac/ghc/ticket/2615
[2] http://bugs.gentoo.org/290974


-- 
wmw


More information about the Haskell-Cafe mailing list