[Haskell-cafe] GHC 6.8.3 binary for older linux

Agent Zhang agentzh at gmail.com
Thu Aug 14 04:31:32 EDT 2008


I ran into the following error while trying to run a binary generated
by GHC 6.8.x on our production machines with a not-so-recent linux
installed (kernel 2.6.9).

    $ ./restyscript
    restyscript: timer_create: Invalid argument

Evan building a pure static-linking executable did not solve the problem.

Then I downloaded the binary GHC 6.8.3 from haskell.org on that
machine, but the ghc crashes as well:

   $ ghc
   Floating point exception

My teammate chaos++ found that the last time precision argument passed
to the timer_create function was just too big. Manually editing the
binary executable (the restyscript file in the previous example)
solved this issue completely, but, yeah, it's terribly hacky.

So I decided to build a GHC 6.8.3 from source on that old system using
GHC 6.4.2. Fortunately, the binary GHC 6.4.2 from haskell.org does
work there. The newly-built GHC solves all the problem. No
floating-point exception nor invalid argument for timer_create. I've
put my binary distribution on my site here:


Hopefully it'll be useful for someone else ;) Not sure if it's worth
putting to the official download page as well :)

Ideally GHC should inspect the kernel version and timer_create support
at *runtime*, rather compile-time. It'll make our lives much easier ;)


More information about the Haskell-Cafe mailing list