LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   error: Compile shared libraries with -fPIC (https://www.linuxquestions.org/questions/linux-networking-3/error-compile-shared-libraries-with-fpic-917996/)

nachiket_linux 12-10-2011 12:09 AM

error: Compile shared libraries with -fPIC
 
When I run snmpd daemon on powerpc board(a.p.) I am getting this error:

Code:

R_PPC_REL24: Compile shared libraries with -fPIC!
/usr/local/sbin/snmpd: symbol 'strlen': can't handle reloc type 0xa in lib
/lib/libnetsnmpmibs.so.15'
sh: you need to specify whom to kill

I googled and found that the -fPIC flag should be there while compiling and its place should be right after gcc, so I changed my Makefie accordingly. Here is a snippet of my makefile:

Code:

$(Q)cd $(PROJECT_BUILD_DIR)/$(NET_SNMP_PKG) && ./configure --target=$(TARGET_TRIPLET) \ 
        --host=$(HOST_TRIPLET) \
        --build=$(BUILD_TRIPLET) \ 
        --with-cc="$(CR_COMPLR)gcc -fPIC" \` 
        --with-cflags="-Os -I$(RFS)/lib -I$(NMS_DIR)/include" \` 
        --with-linkcc="$(CR_COMPLR)gcc -fPIC" \

As you can see I embedded -fPIC right after gcc, but I am still getting an error. I have cross compiled for powerpc platform and I am using latest buildroot-2011.11 and gcc 4.3.6 and uClibc version 0.9.32. What may be the cause of error?

P.S. When I do
Code:

nm libnetsnmpmibs.so.15 | grep strlen
then I get output as 'U strlen'. Does this mean it is undefined?


All times are GMT -5. The time now is 03:18 PM.