I've installed GHC version 6.12.3 on CentOS 5.5 x86_64. I'm trying to run a very simple Haskell program as CGI following the guide at:
If I compile it using dynamic linking I can run it from the command line, since the environment is correct:
# ghc haskell_v2.hs --make -optl-static -fforce-recomp -o haskell_v2.cgi
[1 of 1] Compiling Main ( haskell_v2.hs, haskell_v2.o )
Linking haskell_v2.cgi ...
/usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(HsNet.o): In function `hsnet_getaddrinfo':
HsNet.c:(.text+0x11): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `sAwu_info':
(.text+0xd45d): warning: Using 'gethostbyaddr' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `syh4_info':
(.text+0x4364): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `sygm_info':
(.text+0x424f): warning: Using 'gethostent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `syx3_info':
(.text+0x5318): warning: Using 'sethostent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `sxz5_info':
(.text+0x12c6): warning: Using 'endhostent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `syJY_info':
(.text+0x605d): warning: Using 'getnetbyaddr' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `sycm_info':
(.text+0x3e75): warning: Using 'getnetbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `sybC_info':
(.text+0x3de7): warning: Using 'getnetent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `syyg_info':
(.text+0x5458): warning: Using 'setnetent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `sxz5_info':
(.text+0x1296): warning: Using 'endnetent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `syGE_info':
(.text+0x5d42): warning: Using 'getprotobynumber' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `sylC_info':
(.text+0x474f): warning: Using 'getprotoent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `syvQ_info':
(.text+0x51d8): warning: Using 'setprotoent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `sxz5_info':
(.text+0x12f6): warning: Using 'endprotoent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `syEu_info':
(.text+0x5a25): warning: Using 'getprotobyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `syAp_info':
(.text+0x55c4): warning: Using 'getservbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `syCX_info':
(.text+0x584c): warning: Using 'getservbyport' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `syoz_info':
(.text+0x49ef): warning: Using 'getservent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `sytu_info':
(.text+0x5098): warning: Using 'setservent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `sxz5_info':
(.text+0x1326): warning: Using 'endservent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/librt.a(timer_create.o): In function `timer_create':
(.text+0x124): undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/librt.a(timer_create.o): In function `timer_create':
(.text+0x171): undefined reference to `pthread_attr_init'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/librt.a(timer_create.o): In function `timer_create':
(.text+0x1b8): undefined reference to `pthread_attr_setdetachstate'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/librt.a(timer_routines.o): In function `__start_helper_thread':
(.text+0x3f): undefined reference to `pthread_attr_init'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/librt.a(timer_routines.o): In function `__start_helper_thread':
(.text+0x4c): undefined reference to `pthread_attr_setstacksize'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/librt.a(timer_routines.o): In function `__start_helper_thread':
(.text+0x92): undefined reference to `pthread_create'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/librt.a(timer_routines.o): In function `__start_helper_thread':
(.text+0xc6): undefined reference to `pthread_attr_destroy'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/librt.a(timer_routines.o): In function `__start_helper_thread':
(.text+0xd4): undefined reference to `pthread_atfork'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/librt.a(timer_routines.o): In function `timer_helper_thread':
(.text+0x1e1): undefined reference to `pthread_exit'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/librt.a(timer_routines.o): In function `timer_helper_thread':
(.text+0x21b): undefined reference to `pthread_create'
/usr/haskell//lib/ghc-6.12.3/libHSffi.a(closures.o): In function `init_mparams':
/home/ian/zz/ghc-6.12.3/libffi/build/src/dlmalloc.c:2486:0:
undefined reference to `pthread_mutex_lock'
/home/ian/zz/ghc-6.12.3/libffi/build/src/dlmalloc.c:2490:0:
undefined reference to `pthread_mutex_init'
/home/ian/zz/ghc-6.12.3/libffi/build/src/dlmalloc.c:2493:0:
undefined reference to `pthread_mutex_unlock'
/usr/haskell//lib/ghc-6.12.3/libHSffi.a(closures.o): In function `internal_malloc_stats':
/home/ian/zz/ghc-6.12.3/libffi/build/src/dlmalloc.c:2861:0:
undefined reference to `pthread_mutex_lock'
/home/ian/zz/ghc-6.12.3/libffi/build/src/dlmalloc.c:2888:0:
undefined reference to `pthread_mutex_unlock'
/usr/haskell//lib/ghc-6.12.3/libHSffi.a(closures.o): In function `internal_realloc':
/home/ian/zz/ghc-6.12.3/libffi/build/src/dlmalloc.c:3777:0:
undefined reference to `pthread_mutex_lock'
/home/ian/zz/ghc-6.12.3/libffi/build/src/dlmalloc.c:3819:0:
undefined reference to `pthread_mutex_unlock'
/usr/haskell//lib/ghc-6.12.3/libHSffi.a(closures.o): In function `internal_memalign':
/home/ian/zz/ghc-6.12.3/libffi/build/src/dlmalloc.c:3868:0:
undefined reference to `pthread_mutex_lock'
/home/ian/zz/ghc-6.12.3/libffi/build/src/dlmalloc.c:3915:0:
undefined reference to `pthread_mutex_unlock'
/usr/haskell//lib/ghc-6.12.3/libHSffi.a(closures.o): In function `ialloc':
/home/ian/zz/ghc-6.12.3/libffi/build/src/dlmalloc.c:3998:0:
undefined reference to `pthread_mutex_lock'
/home/ian/zz/ghc-6.12.3/libffi/build/src/dlmalloc.c:4052:0:
undefined reference to `pthread_mutex_unlock'
/usr/haskell//lib/ghc-6.12.3/libHSffi.a(closures.o): In function `dlmalloc':
/home/ian/zz/ghc-6.12.3/libffi/build/src/dlmalloc.c:4085:0:
undefined reference to `pthread_mutex_lock'
/home/ian/zz/ghc-6.12.3/libffi/build/src/dlmalloc.c:4186:0:
undefined reference to `pthread_mutex_unlock'
/usr/haskell//lib/ghc-6.12.3/libHSffi.a(closures.o): In function `dlfree':
/home/ian/zz/ghc-6.12.3/libffi/build/src/dlmalloc.c:4211:0:
undefined reference to `pthread_mutex_lock'
/home/ian/zz/ghc-6.12.3/libffi/build/src/dlmalloc.c:4285:0:
undefined reference to `pthread_mutex_unlock'
/usr/haskell//lib/ghc-6.12.3/libHSffi.a(closures.o): In function `dlmalloc_trim':
/home/ian/zz/ghc-6.12.3/libffi/build/src/dlmalloc.c:4362:0:
undefined reference to `pthread_mutex_lock'
/home/ian/zz/ghc-6.12.3/libffi/build/src/dlmalloc.c:4364:0:
undefined reference to `pthread_mutex_unlock'
/usr/haskell//lib/ghc-6.12.3/libHSffi.a(closures.o): In function `dlmmap':
/home/ian/zz/ghc-6.12.3/libffi/build/src/closures.c:438:0:
undefined reference to `pthread_mutex_lock'
/home/ian/zz/ghc-6.12.3/libffi/build/src/closures.c:440:0:
undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/libgcc_eh.a(unwind-dw2.o): In function `uw_init_context_1':
(.text+0x1be5): undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__deregister_frame_info_bases':
(.text+0x10bc): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__deregister_frame_info_bases':
(.text+0x10cd): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__register_frame_info_table_bases':
(.text+0x117f): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__register_frame_info_bases':
(.text+0x1238): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `_Unwind_Find_FDE':
(.text+0x14b6): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `_Unwind_Find_FDE':
(.text+0x14c7): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__register_frame_info_table_bases':
(.text+0x119e): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__register_frame_info_bases':
(.text+0x1257): undefined reference to `pthread_mutex_unlock'
collect2: ld returned 1 exit status
1 : ...requires at runtime the shared libraries from the glibc version used for linking
I've had no luck in sorting out how to solve this and an quite new to both Linux and Haskell. I never managed to install (build from source failed) the entire Haskell Platform on CentOS 5.5, is that needed? Anyone has got any idea what might causing these errors?