It works! This is much easier, thank you

Nicola

On Thu, Aug 14, 2008 at 11:30 PM, Agent Zhang <agentzh@gmail.com> wrote:
2008/8/15 Nicola Squartini <tensor5@gmail.com>
>
> So I run that gcc command manually adding -lpthread at the end of it end it works,
>  I get the static binary. Isn't it strange? It could be a gcc problem.

Well, it needn't be that hacky ;) The following command works for me
and it does essentially the same thing:

  ghc -i -static -optl-static -optl-pthread -funbox-strict-fields
-fwarn-incomplete-patterns -isrc --make Main -o bin/restyscript

Please note that without -optl-pthread option, I'll get exactly the same errors:

Linking bin/restyscript ...
/usr/lib/gcc/i486-linux-gnu/4.2.3/../../../../lib/librt.a(timer_create.o):
In function `timer_create':
(.text+0x117): undefined reference to `pthread_once'
/usr/lib/gcc/i486-linux-gnu/4.2.3/../../../../lib/librt.a(timer_create.o):
In function `timer_create':
...

-lpthread needs to be put to the end of the argument list to help gcc
or ld solve the symbols properly.

Hope this helps ;)

-agentzh