[reSIProcate] building shared libraries on AMD64
- From: "Alfred E. Heggestad" <aeh@xxxxxx>
- Date: Tue, 05 Sep 2006 09:49:07 +0200
hi
when building resiprocate with "Should the resip libraries be built
shared?" set to "Yes", I got the following error:
/usr/bin/ld: obj.debug.Linux.x86_64/AbstractFifo.o: relocation
R_X86_64_32 against `a local symbol' can not be used when making a
shared object; recompile with -fPIC
obj.debug.Linux.x86_64/AbstractFifo.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [obj.debug.Linux.x86_64/librutil.so] Error 1
adding the "-fPIC" option solved the problem, but I am not sure if
this is the correct way to solve it.. patch below:
Index: build/Makefile.tools
===================================================================
--- build/Makefile.tools (revision 6553)
+++ build/Makefile.tools (working copy)
@@ -41,8 +41,8 @@
DMANGLE =
INSTALL = install
LNDIR = $(shell pwd)/$(ROOT)/build/lndir.sh
-CFLAGS += -Wall
-CXXFLAGS += -Wall
+CFLAGS += -Wall -fPIC
+CXXFLAGS += -Wall -fPIC
DFLAG_INTEGRATED = -MMD
DEBUG_FLAG = -g
COMPILE_SMALL_FLAG = -Os -fno-inline -fno-keep-static-consts