Thread: Cross-compiling problem with pthread test

Cross-compiling problem with pthread test

From
Cyberman Wu
Date:
When I try to cross-compiling PostgreSQL for TILEPro, it can't figure
out libpthread:

checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... no
checking whether pthreads work with -pthreads... no
checking whether pthreads work with -mthreads... no
checking for the pthreads library -lpthread... no
checking whether pthreads work with --thread-safe... no
checking whether pthreads work with -mt... no

And link will failed. I've tried to modify the generated
src/Makefile.global to add '-lpthread' for PTHREAD_LIBS, and it did
work. But I've to modify it every time when I want to change some
configurations. Is there any way to make scripts resolve this
automatically, or manually with some configuration parameters on
command line?


By the way, src/include/storage/s_lock.h said that if I disable
spinlock it will be 'MUCH MUCH slower', is there any performance data
on that?


--
Cyberman Wu
<http://www.meganovo.com>