[OpenWRT交叉編譯]ramips-mt7621交叉編譯radvd提示cannot find -lssp錯誤

路由器:斐訊K2P
工具鏈:OpenWrt-SDK-15.05.1-ramips-mt7621_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64.tar.bz2
源碼:Radvd


由於在原生ipv6中需要使用radvd來做RA(Router Advertisement),路由器利用此消息,週期性的通告其存在及各種鏈路參數,或者用於響應 Router Solicitation。所以就自己動手用工具鏈交叉編譯了一發,在編譯過程中碰到cannot find -lssp錯誤。

錯誤部分截取如下:

/home/form/K2P_mt7621/toolchain-mipsel_1004kc+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/bin/../lib/gcc/mipsel-openwrt-linux-uclibc/4.8.3/../../../../mipsel-openwrt-linux-uclibc/bin/ld: cannot find -lssp_nonshared
/home/form/K2P_mt7621/toolchain-mipsel_1004kc+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/bin/../lib/gcc/mipsel-openwrt-linux-uclibc/4.8.3/../../../../mipsel-openwrt-linux-uclibc/bin/ld: cannot find -lssp
collect2: error: ld returned 1 exit status
make[1]: * [Makefile:880:radvd] 錯誤 1
make[1]: 離開目錄“/home/form/K2P_mt7621/radvd”
make: * [Makefile:754:all] 錯誤 2


原因:

工具鏈中缺少libssp庫,該庫包含支持GCC堆棧保護函數的程序。


解決方案:

1. 去掉堆棧保護(在路由器上運行正常,暫時未發現有啥副作用)

(a)打開Makefile,搜索到fstack-protector,將該FLAG註釋。
fstack-protector

(b) 重新編譯即可
make

2.手動編譯帶lssp的gcc

下面附上自己編譯的radvd
radvd_mt7621_OpenWrt


參考:

http://blog.csdn.net/clirus/article/details/50146883
http://blog.csdn.net/m584233185/article/details/8514286

發佈了34 篇原創文章 · 獲贊 39 · 訪問量 21萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章