Discussion:
[pjsip] Problem compiling PJSIP: recompile with -fPIC
Oded Arbel
2017-05-25 14:45:25 UTC
Permalink
I downloaded PJSIP 2.6 to build locally, and while running on Ubuntu 16.04
it all compiled fine and ran.


Now I moved to Ubuntu 17.04 and wanted (needed) to rebuild, so I did make
clean && configure && make dep all and got the following error:


/usr/bin/ld:
/home/odeda/cvs/pjsip/pjlib/lib/libpj-x86_64-unknown-linux-gnu.a(guid_simple.o):
relocation R_X86_64_32S against `.bss'
can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status

Googling, I've seen various posts of how to set up flags to configure to
workaround this problem, but none worked for me. My current command looks
like this:

make clean && ./configure --prefix=$HOME/.local CPPFLAGS=-fPIC
CXXFLAGS=-fPIC CFLAGS=-fPIC && make dep all

(I've seen both CXXFLAGS and CPPFLAGS being recommended on this list) but
it still fails.

Any help will be greatly appreciated.
--
Oded Arbel
***@greenfieldtech.net
[image: Greenfield Tech] <http://greenfieldtech.net/>
Loading...