librt.so 的 private symbols
剛剛在玩 [
sipXezPhone] 時,發現以下奇怪的訊息:
error: /lib/librt.so.1: symbol __pthread_clock_settime,
version GLIBC_PRIVATE not defined in file libpthread.so.0 with link time reference
於是腦中浮現這似乎在某個地方看過,在查詢了 [
Valgrind FAQ] 之後,一切真相大白,引述 FAQ 裡頭的文字:
This is a total swamp. Nevertheless there is a way out. It's a problem which is not easy to fix. Really the problem is that /lib/librt.so.1 refers to some symbols __pthread_clock_settime and __pthread_clock_gettime in /lib/libpthread.so which are not intended to be exported, ie they are private.
是的,這兩個 symbol 是 private,並沒有 export 出來,那怎麼解決呢?相當簡單,「補釘」(patch) 用力的打下去:
--- sipXportLib/src/Makefile.am (revision 596)
+++ sipXportLib/src/Makefile.am (working copy)
@@ -24,7 +22,6 @@
@PCRE_LIBS@ \
@SSL_LIBS@ \
-ldl \
- -lrt \
-lpthread \
-lstdc++
沒錯,就是確保不需要 librt.so,這樣就不會有錯誤的 linkage。補充一下,在 GLIBC 2.3.x 已經修正,是因為我的 toolchain 版本比較舊,所以恰好遇到上述問題
由 jserv 發表於 July 1, 2005 02:53 PM