trying to use gperf cpu profiler to link static to a c++ program. have followed the instuction to link library with the below command.
any help to know if gperf can be used with static linking.
g++ -std=c++11 -DWITHGPERFTOOLS -g fork.cpp -o fork -L /usr/lib/ libtcmalloc_and_profiler.a
libtcmalloc_and_profiler.a(stacktrace.o): In function `GetStackTrace_libunwind(void**, int, int)':
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/stacktrace_libunwind-inl.h:112: undefined reference to `_Ux86_64_getcontext'
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/stacktrace_libunwind-inl.h:116: undefined reference to `_ULx86_64_init_local'
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/stacktrace_libunwind-inl.h:120: undefined reference to `_ULx86_64_step'
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/stacktrace_libunwind-inl.h:131: undefined reference to `_ULx86_64_get_reg'
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/stacktrace_libunwind-inl.h:138: undefined reference to `_ULx86_64_step'
libtcmalloc_and_profiler.a(stacktrace.o): In function `GetStackFrames_libunwind(void**, int*, int, int)':
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/stacktrace_libunwind-inl.h:112: undefined reference to `_Ux86_64_getcontext'
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/stacktrace_libunwind-inl.h:116: undefined reference to `_ULx86_64_init_local'
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/stacktrace_libunwind-inl.h:120: undefined reference to `_ULx86_64_step'
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/stacktrace_libunwind-inl.h:124: undefined reference to `_ULx86_64_get_reg'
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/stacktrace_libunwind-inl.h:131: undefined reference to `_ULx86_64_get_reg'
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/stacktrace_libunwind-inl.h:138: undefined reference to `_ULx86_64_step'
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/stacktrace_libunwind-inl.h:143: undefined reference to `_ULx86_64_get_reg'
libtcmalloc_and_profiler.a(stacktrace.o): In function `GetStackTraceWithContext_libunwind(void**, int, int, void const*)':
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/stacktrace_libunwind-inl.h:112: undefined reference to `_Ux86_64_getcontext'
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/stacktrace_libunwind-inl.h:116: undefined reference to `_ULx86_64_init_local'
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/stacktrace_libunwind-inl.h:120: undefined reference to `_ULx86_64_step'
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/stacktrace_libunwind-inl.h:131: undefined reference to `_ULx86_64_get_reg'
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/stacktrace_libunwind-inl.h:138: undefined reference to `_ULx86_64_step'
libtcmalloc_and_profiler.a(stacktrace.o): In function `GetStackFramesWithContext_libunwind(void**, int*, int, int, void const*)':
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/stacktrace_libunwind-inl.h:112: undefined reference to `_Ux86_64_getcontext'
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/stacktrace_libunwind-inl.h:116: undefined reference to `_ULx86_64_init_local'
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/stacktrace_libunwind-inl.h:120: undefined reference to `_ULx86_64_step'
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/stacktrace_libunwind-inl.h:124: undefined reference to `_ULx86_64_get_reg'
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/stacktrace_libunwind-inl.h:131: undefined reference to `_ULx86_64_get_reg'
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/stacktrace_libunwind-inl.h:138: undefined reference to `_ULx86_64_step'
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/stacktrace_libunwind-inl.h:143: undefined reference to `_ULx86_64_get_reg'
libtcmalloc_and_profiler.a(libtcmalloc_and_profiler_la-linuxthreads.o): In function `ListerThread':
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/base/linuxthreads.cc:272: undefined reference to `sem_wait'
libtcmalloc_and_profiler.a(libtcmalloc_and_profiler_la-linuxthreads.o): In function `TCMalloc_ListAllProcessThreads':
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/base/linuxthreads.cc:625: undefined reference to `sem_init'
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/base/linuxthreads.cc:643: undefined reference to `sem_post'
../cdl_perf/gperf/gperf_static/gperftools-2.6.1/src/base/linuxthreads.cc:669: undefined reference to `sem_destroy'