Re: SWIG build error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Did more research and found that just adding -fPIC wasn't enough

The following from an old post did (http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/2011-May/012963.html)

make clean
./configure CFLAGS=-fPIC CXXFLAGS=-fPIC
make dep
make
cd pjsip-apps/src/swig
make

-- Scott.

On 9/16/16 8:46 PM, Scott M Ober wrote:
Hi,

I've created a fresh Ubuntu 16.04.1 LTS VM and installed all the pjsip prerequisites that I recall.

I downloaded the latest pjsip 2.5.5

I successfully built pjsip and pjsua for linux.

Now, I'm trying to build pjsua2 in the swig directory.

I get the following error from the linker.

c++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/pjsua2_wrap.o -lpjsua2-x86_64-unknown-linux-gnu -lstdc++ -lpjsua-x86_64-unknown-linux-gnu -lpjsip-ua-x86_64-unknown-linux-gnu -lpjsip-simple-x86_64-unknown-linux-gnu -lpjsip-x86_64-unknown-linux-gnu -lpjmedia-codec-x86_64-unknown-linux-gnu -lpjmedia-x86_64-unknown-linux-gnu -lpjmedia-videodev-x86_64-unknown-linux-gnu -lpjmedia-audiodev-x86_64-unknown-linux-gnu -lpjmedia-x86_64-unknown-linux-gnu -lpjnath-x86_64-unknown-linux-gnu -lpjlib-util-x86_64-unknown-linux-gnu -lsrtp-x86_64-unknown-linux-gnu -lresample-x86_64-unknown-linux-gnu -lgsmcodec-x86_64-unknown-linux-gnu -lspeex-x86_64-unknown-linux-gnu -lilbccodec-x86_64-unknown-linux-gnu -lg7221codec-x86_64-unknown-linux-gnu -lyuv-x86_64-unknown-linux-gnu -lpj-x86_64-unknown-linux-gnu -lm -lrt -lpthread -lasound -o build/lib.linux-x86_64-2.7/_pjsua2.so -L/home/smo/Downloads/pjproject-2.5.5/pjlib/lib -L/home/smo/Downloads/pjproject-2.5.5/pjlib-util/lib -L/home/smo/Downloads/pjproject-2.5.5/pjnath/lib -L/home/smo/Downloads/pjproject-2.5.5/pjmedia/lib -L/home/smo/Downloads/pjproject-2.5.5/pjsip/lib -L/home/smo/Downloads/pjproject-2.5.5/third_party/lib /usr/bin/ld: /home/smo/Downloads/pjproject-2.5.5/pjsip/lib/libpjsua2-x86_64-unknown-linux-gnu.a(account.o): relocation R_X86_64_32S against `_ZTVN2pj7AccountE' can not be used when making a shared object; recompile with -fPIC /home/smo/Downloads/pjproject-2.5.5/pjsip/lib/libpjsua2-x86_64-unknown-linux-gnu.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
error: command 'c++' failed with exit status 1
Makefile:19: recipe for target '_pjsua2.so' failed
make[1]: *** [_pjsua2.so] Error 1
make[1]: Leaving directory '/home/smo/Downloads/pjproject-2.5.5/pjsip-apps/src/swig/python'
Makefile:23: recipe for target 'all' failed
make: *** [all] Error 1

I did a make clean from the root of pjsip, added -fPIC, and rebuild the entire system, but, then I get errors complaining of 'rodata' issues.

My gcc version is 5.4.0

Any help would be appreciated.

PJSIP build and swig compile works fine on my MAC.

-- Scott.

_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org



_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux