2008/8/15 Nicola Squartini <[EMAIL PROTECTED]>
>
> 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
_______________________________________________
Glasgow-haskell-users mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to