[Freeswitch-users] Build failure with libpq

Claus Andersen clan at wheel.dk
Fri Jun 14 13:05:13 MSD 2013


Hello,

I am trying to make/build with core-pgsql but it fails:

$ make
<snip>
*** Warning: Linking the shared library libfreeswitch.la against the
*** static library libs/libedit/src/.libs/libedit.a is not portable!
quiet_libtool: link: rm -fr  .libs/libfreeswitch.a .libs/libfreeswitch.la 
.libs/libfreeswitch.lai .libs/libfreeswitch.so .libs/libfreeswitch.so.1 
.libs/libfreeswitch.so.1.0.0
quiet_libtool: link: g++ -shared -nostdlib 
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crti.o 
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/crtbeginS.o 
.libs/libfreeswitch_la-switch_apr.o .libs/libfreeswitch_la-switch_buffer.o 
.libs/libfreeswitch_la-switch_caller.o 
.libs/libfreeswitch_la-switch_channel.o 
.libs/libfreeswitch_la-switch_console.o 
.libs/libfreeswitch_la-switch_mprintf.o 
.libs/libfreeswitch_la-switch_core_media_bug.o 
.libs/libfreeswitch_la-switch_core_timer.o 
.libs/libfreeswitch_la-switch_core_asr.o 
.libs/libfreeswitch_la-switch_core_event_hook.o 
.libs/libfreeswitch_la-switch_core_speech.o 
.libs/libfreeswitch_la-switch_core_memory.o 
.libs/libfreeswitch_la-switch_core_codec.o 
.libs/libfreeswitch_la-switch_core_file.o 
.libs/libfreeswitch_la-switch_core_hash.o 
.libs/libfreeswitch_la-switch_core_sqldb.o 
.libs/libfreeswitch_la-switch_core_session.o 
.libs/libfreeswitch_la-switch_core_directory.o 
.libs/libfreeswitch_la-switch_core_state_machine.o 
.libs/libfreeswitch_la-switch_core_io.o 
.libs/libfreeswitch_la-switch_core_rwlock.o 
.libs/libfreeswitch_la-switch_core_port_allocator.o 
.libs/libfreeswitch_la-switch_core.o 
.libs/libfreeswitch_la-switch_scheduler.o 
.libs/libfreeswitch_la-switch_core_db.o 
.libs/libfreeswitch_la-switch_dso.o 
.libs/libfreeswitch_la-switch_loadable_module.o 
.libs/libfreeswitch_la-switch_utils.o 
.libs/libfreeswitch_la-switch_event.o 
.libs/libfreeswitch_la-switch_resample.o 
.libs/libfreeswitch_la-switch_regex.o .libs/libfreeswitch_la-switch_rtp.o 
.libs/libfreeswitch_la-switch_ivr_bridge.o 
.libs/libfreeswitch_la-switch_ivr_originate.o 
.libs/libfreeswitch_la-switch_ivr_async.o 
.libs/libfreeswitch_la-switch_ivr_play_say.o 
.libs/libfreeswitch_la-switch_ivr_say.o 
.libs/libfreeswitch_la-switch_ivr_menu.o 
.libs/libfreeswitch_la-switch_ivr.o .libs/libfreeswitch_la-switch_stun.o 
.libs/libfreeswitch_la-switch_nat.o .libs/libfreeswitch_la-switch_log.o 
.libs/libfreeswitch_la-switch_xml.o 
.libs/libfreeswitch_la-switch_xml_config.o 
.libs/libfreeswitch_la-switch_config.o 
.libs/libfreeswitch_la-switch_time.o .libs/libfreeswitch_la-switch_odbc.o 
.libs/libfreeswitch_la-switch_pgsql.o 
.libs/libfreeswitch_la-switch_limit.o .libs/libfreeswitch_la-g711.o 
.libs/libfreeswitch_la-switch_pcm.o 
.libs/libfreeswitch_la-switch_profile.o 
.libs/libfreeswitch_la-switch_json.o .libs/libfreeswitch_la-switch_curl.o 
.libs/libfreeswitch_la-tpl.o .libs/libfreeswitch_la-stfu.o 
.libs/libfreeswitch_la-libteletone_detect.o 
.libs/libfreeswitch_la-libteletone_generate.o 
.libs/libfreeswitch_la-miniwget.o .libs/libfreeswitch_la-minixml.o 
.libs/libfreeswitch_la-igd_desc_parse.o .libs/libfreeswitch_la-minisoap.o 
.libs/libfreeswitch_la-miniupnpc.o .libs/libfreeswitch_la-upnpreplyparse.o 
.libs/libfreeswitch_la-upnpcommands.o .libs/libfreeswitch_la-minissdpc.o 
.libs/libfreeswitch_la-upnperrors.o .libs/libfreeswitch_la-natpmp.o 
.libs/libfreeswitch_la-getgateway.o .libs/libfreeswitch_la-plc.o 
.libs/libfreeswitch_la-bit_operations.o .libs/switch_cpp.o 
-L/usr/local/src/freeswitch/libs/apr-util/xml/expat/lib/.libs 
-L/usr/local/src/freeswitch/libs/apr/.libs -L/usr/lib64 
-L/usr/pgsql-9.2/lib libs/apr-util/.libs/libaprutil-1.a 
-L/usr/local/src/freeswitch/libs/apr-util/xml/expat/lib 
/usr/local/src/freeswitch/libs/apr-util/xml/expat/lib/.libs/libexpat.a 
/usr/local/src/freeswitch/libs/apr/.libs/libapr-1.a 
libs/apr/.libs/libapr-1.a libs/sqlite/.libs/libsqlite3.a -lpthread 
libs/pcre/.libs/libpcre.a libs/speex/libspeex/.libs/libspeexdsp.a 
libs/srtp/.libs/libsrtp.a libs/libedit/src/.libs/libedit.a 
libs/curl/lib/.libs/libcurl.a -lcrypt -lrt -lssl -lcrypto -ldl -lz 
-lncurses -ljpeg -lpq -lodbc -L/usr/lib/gcc/x86_64-redhat-linux/4.4.7 
-L/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64 -L/lib/../lib64 
-L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../.. 
-lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-redhat-linux/4.4.7/crtendS.o 
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crtn.o 
-Wl,--as-needed -Wl,-lodbc -Wl,-z -Wl,relro   -pthread -Wl,-soname 
-Wl,libfreeswitch.so.1 -o .libs/libfreeswitch.so.1.0.0
quiet_libtool: link: (cd ".libs" && rm -f "libfreeswitch.so.1" && ln -s 
"libfreeswitch.so.1.0.0" "libfreeswitch.so.1")
quiet_libtool: link: (cd ".libs" && rm -f "libfreeswitch.so" && ln -s 
"libfreeswitch.so.1.0.0" "libfreeswitch.so")
quiet_libtool: link: ar cru .libs/libfreeswitch.a 
libs/libedit/src/.libs/libedit.a  libfreeswitch_la-switch_apr.o 
libfreeswitch_la-switch_buffer.o libfreeswitch_la-switch_caller.o 
libfreeswitch_la-switch_channel.o libfreeswitch_la-switch_console.o 
libfreeswitch_la-switch_mprintf.o libfreeswitch_la-switch_core_media_bug.o 
libfreeswitch_la-switch_core_timer.o libfreeswitch_la-switch_core_asr.o 
libfreeswitch_la-switch_core_event_hook.o 
libfreeswitch_la-switch_core_speech.o 
libfreeswitch_la-switch_core_memory.o libfreeswitch_la-switch_core_codec.o 
libfreeswitch_la-switch_core_file.o libfreeswitch_la-switch_core_hash.o 
libfreeswitch_la-switch_core_sqldb.o 
libfreeswitch_la-switch_core_session.o 
libfreeswitch_la-switch_core_directory.o 
libfreeswitch_la-switch_core_state_machine.o 
libfreeswitch_la-switch_core_io.o libfreeswitch_la-switch_core_rwlock.o 
libfreeswitch_la-switch_core_port_allocator.o 
libfreeswitch_la-switch_core.o libfreeswitch_la-switch_scheduler.o 
libfreeswitch_la-switch_core_db.o libfreeswitch_la-switch_dso.o 
libfreeswitch_la-switch_loadable_module.o libfreeswitch_la-switch_utils.o 
libfreeswitch_la-switch_event.o libfreeswitch_la-switch_resample.o 
libfreeswitch_la-switch_regex.o libfreeswitch_la-switch_rtp.o 
libfreeswitch_la-switch_ivr_bridge.o 
libfreeswitch_la-switch_ivr_originate.o 
libfreeswitch_la-switch_ivr_async.o libfreeswitch_la-switch_ivr_play_say.o 
libfreeswitch_la-switch_ivr_say.o libfreeswitch_la-switch_ivr_menu.o 
libfreeswitch_la-switch_ivr.o libfreeswitch_la-switch_stun.o 
libfreeswitch_la-switch_nat.o libfreeswitch_la-switch_log.o 
libfreeswitch_la-switch_xml.o libfreeswitch_la-switch_xml_config.o 
libfreeswitch_la-switch_config.o libfreeswitch_la-switch_time.o 
libfreeswitch_la-switch_odbc.o libfreeswitch_la-switch_pgsql.o 
libfreeswitch_la-switch_limit.o libfreeswitch_la-g711.o 
libfreeswitch_la-switch_pcm.o libfreeswitch_la-switch_profile.o 
libfreeswitch_la-switch_json.o libfreeswitch_la-switch_curl.o 
libfreeswitch_la-tpl.o libfreeswitch_la-stfu.o 
libfreeswitch_la-libteletone_detect.o 
libfreeswitch_la-libteletone_generate.o libfreeswitch_la-miniwget.o 
libfreeswitch_la-minixml.o libfreeswitch_la-igd_desc_parse.o 
libfreeswitch_la-minisoap.o libfreeswitch_la-miniupnpc.o 
libfreeswitch_la-upnpreplyparse.o libfreeswitch_la-upnpcommands.o 
libfreeswitch_la-minissdpc.o libfreeswitch_la-upnperrors.o 
libfreeswitch_la-natpmp.o libfreeswitch_la-getgateway.o 
libfreeswitch_la-plc.o libfreeswitch_la-bit_operations.o switch_cpp.o
quiet_libtool: link: ranlib .libs/libfreeswitch.a
quiet_libtool: link: ( cd ".libs" && rm -f "libfreeswitch.la" && ln -s 
"../libfreeswitch.la" "libfreeswitch.la" )
quiet_libtool: link: gcc -I/usr/local/src/freeswitch/libs/curl/include 
-I/usr/local/src/freeswitch/src/include 
-I/usr/local/src/freeswitch/src/include 
-I/usr/local/src/freeswitch/libs/libteletone/src 
-I/usr/local/src/freeswitch/libs/stfu -fPIC -Werror -fvisibility=hidden 
-DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1 -g -ggdb -DHAVE_OPENSSL 
-Wall -std=c99 -pedantic -Wdeclaration-after-statement -g -O2 -pthread 
-DLINUX=2 -D_REENTRANT -D_GNU_SOURCE 
-I/usr/local/src/freeswitch/libs/apr/include 
-I/usr/local/src/freeswitch/libs/apr-util/include 
-I/usr/local/src/freeswitch/libs/apr-util/xml/expat/lib 
-I/usr/local/src/freeswitch/libs/libtpl-1.5/src 
-I/usr/local/src/freeswitch/libs/stfu 
-I/usr/local/src/freeswitch/libs/sqlite 
-I/usr/local/src/freeswitch/libs/pcre 
-I/usr/local/src/freeswitch/libs/speex/include -Ilibs/speex/include 
-I/usr/local/src/freeswitch/libs/srtp/include 
-I/usr/local/src/freeswitch/libs/srtp/crypto/include 
-Ilibs/srtp/crypto/include -I/usr/local/src/freeswitch/libs/spandsp/src 
-I/usr/local/src/freeswitch/libs/tiff-4.0.2/libtiff -DENABLE_SRTP 
-DSWITCH_HAVE_ODBC -I/usr/include 
-I/usr/local/src/freeswitch/libs/libedit/src -DSWITCH_HAVE_LIBEDIT 
-Ilibs/libedit/src -DSWITCH_HAVE_LIBEDIT -g -O2 -Wl,--as-needed -o 
.libs/freeswitch freeswitch-switch.o -Wl,-lodbc -Wl,-z -Wl,relro 
-L/usr/lib64 -L/usr/pgsql-9.2/lib -lm ./.libs/libfreeswitch.so 
-L/usr/local/src/freeswitch/libs/apr-util/xml/expat/lib 
/usr/local/src/freeswitch/libs/apr-util/xml/expat/lib/.libs/libexpat.a 
/usr/local/src/freeswitch/libs/apr/.libs/libapr-1.a 
libs/apr/.libs/libapr-1.a -lrt -lcrypt -lpthread 
libs/libedit/src/.libs/libedit.a -lssl -lcrypto -ldl -lz -lncurses -ljpeg 
-lpq -lodbc -pthread -Wl,-rpath -Wl,/usr/local/freeswitch/lib
/usr/lib64/libnss3.so: undefined reference to `PR_FindSymbol'
/usr/lib64/libnss3.so: undefined reference to `PR_RWLock_Rlock'
/usr/lib64/libssl3.so: undefined reference to `PR_OpenAnonFileMap'
/usr/lib64/libnss3.so: undefined reference to `PR_UnloadLibrary'
/usr/lib64/libnss3.so: undefined reference to `PL_InitArenaPool'
/usr/lib64/libnss3.so: undefined reference to `PR_NewRWLock'
/usr/lib64/libnss3.so: undefined reference to `PR_RWLock_Wlock'
/usr/lib64/libnss3.so: undefined reference to `PR_LoadLibrary'
/lib64/libldap_r-2.4.so.2: undefined reference to `PR_GetEnv'
/usr/lib64/libnssutil3.so: undefined reference to 
`PR_LoadLibraryWithFlags'
/usr/lib64/libnssutil3.so: undefined reference to `PL_ClearArenaPool'
/usr/lib64/libnss3.so: undefined reference to `PR_DestroyRWLock'
/usr/lib64/libnss3.so: undefined reference to `PR_NewTCPSocket'
/lib64/libldap_r-2.4.so.2: undefined reference to `PR_SetEnv'
/lib64/libldap_r-2.4.so.2: undefined reference to `PR_GetLibraryName'
/usr/lib64/libssl3.so: undefined reference to `PR_ErrorInstallTable'
/usr/lib64/libssl3.so: undefined reference to `PR_ExportFileMapAsString'
/usr/lib64/libnssutil3.so: undefined reference to 
`PR_GetLibraryFilePathname'
/usr/lib64/libnss3.so: undefined reference to `PR_FindFunctionSymbol'
/usr/lib64/libsmime3.so: undefined reference to `PL_NewHashTable'
/lib64/libldap_r-2.4.so.2: undefined reference to `PR_ErrorToString'
/usr/lib64/libnss3.so: undefined reference to `PR_RWLock_Unlock'
/usr/lib64/libssl3.so: undefined reference to `PR_ImportFileMapFromString'
/lib64/libldap_r-2.4.so.2: undefined reference to 
`PR_GetDirectorySeparator'
collect2: ld returned 1 exit status
make[1]: *** [freeswitch] Error 1
make: *** [all] Error 2


I had to set LDFLAGS to get configure to work. I first tried and failed 
with:
$ ./configure --enable-core-pgsql-support

I Googled for PR_FindSymbol and friends which led to the suggestion:
$ ./configure --enable-core-pgsql-support --without-libcurl

But it gives the same failure. I am using Freeswitch 1.2.10 (from 
source) and PostgreSQL 9.2.4 (from PostgreSQL RPM) on CentOS 6.4 kernel 
2.6.32-358.6.1.el6.x86_64

It seems that -lpq and -L/usr/pgsql-9.2/lib is listed correctly during the 
linking process.

And the object files should be OK (I have previously linked them with 
OpenResty):
$ ls /usr/pgsql-9.2/lib/libpq.* -l
-rw-r--r--. 1 root root 1505138 Apr  2 01:40 /usr/pgsql-9.2/lib/libpq.a
lrwxrwxrwx. 1 root root      12 Jun  5 14:30 /usr/pgsql-9.2/lib/libpq.so 
-> libpq.so.5.5
lrwxrwxrwx. 1 root root      12 May 13 16:22 /usr/pgsql-9.2/lib/libpq.so.5 
-> libpq.so.5.5
-rwxr-xr-x. 1 root root  185192 Apr  2 01:44 
/usr/pgsql-9.2/lib/libpq.so.5.5

I can do a clean build without pgsql.

Any hints?

Kind Regards,
Claus Andersen



Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list