2
共享庫當我運行在PowerPC板(AP),我收到此錯誤snmpd守護:錯誤編譯-fPIC
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
我用Google搜索,發現-fPIC
標誌應該有在編譯時和自己的位置應該在gcc之後,所以我相應地改變了我的Makefie。這裏是我的makefile文件的一個片段:
$(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" \`
正如你可以看到我的嵌入式GCC之後-fPIC
,但我仍然得到一個錯誤。我爲powerpc平臺進行了交叉編譯,並且正在使用最新的buildroot-2011.11和gcc 4.3.6以及uClibc 0.9.32版本。什麼可能是錯誤的原因?
P.S.當我做nm libnetsnmpmibs.so.15 | grep strlen
時,我得到輸出爲U strlen
。這是否意味着它是不確定的?