Fail to complie nginx with google-perftools

I compile nginx with google-perftools 1.8.1

./configure  --with-cc-opt=-ltcmalloc
make

It fail in 1.0.2 ~ 1.1.0 :
objs/src/core/ngx_shmtx.o: In function ngx_shmtx_unlock': /root/nginx-1.1.0/src/core/ngx_shmtx.c:170: undefined reference tosem_post’
objs/src/core/ngx_shmtx.o: In function ngx_shmtx_lock': /root/nginx-1.1.0/src/core/ngx_shmtx.c:115: undefined reference tosem_wait’
objs/src/core/ngx_shmtx.o: In function ngx_shmtx_destory': /root/nginx-1.1.0/src/core/ngx_shmtx.c:46: undefined reference tosem_destroy’
objs/src/core/ngx_shmtx.o: In function ngx_shmtx_create': /root/nginx-1.1.0/src/core/ngx_shmtx.c:27: undefined reference tosem_init’

Hello!

On Thu, Aug 04, 2011 at 09:03:01AM +0800, Wendal C. wrote:

I compile nginx with google-perftools 1.8.1

./configure  --with-cc-opt=-ltcmalloc

You’ve passed “-ltcmalloc” as compiler flag, while it’s linker
one. The only effect that it confuses ./configure which does
compile and link in one step while doing tests.

If you want to build nginx with tcmalloc library linked, use

./configure --with-ld-opt=-ltcmalloc

instead.

Maxim D.

It works!!

Thank you

2011/8/4 Maxim D. [email protected]