[OpenWRT交叉编译]ramips-mt7621交叉编译radvd提示cannot find -lssp错误

时间:2024-04-04 15:21:43

路由器:斐讯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注释。
[OpenWRT交叉编译]ramips-mt7621交叉编译radvd提示cannot find -lssp错误

(b) 重新编译即可
[OpenWRT交叉编译]ramips-mt7621交叉编译radvd提示cannot find -lssp错误

2.手动编译带lssp的gcc

下面附上自己编译的radvd
radvd_mt7621_OpenWrt


参考:

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