惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

M
MIT News - Artificial intelligence
阮一峰的网络日志
阮一峰的网络日志
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
宝玉的分享
宝玉的分享
博客园 - 三生石上(FineUI控件)
博客园 - 【当耐特】
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
The GitHub Blog
The GitHub Blog
Microsoft Security Blog
Microsoft Security Blog
量子位
D
DataBreaches.Net
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
Martin Fowler
Martin Fowler
有赞技术团队
有赞技术团队
Hugging Face - Blog
Hugging Face - Blog
人人都是产品经理
人人都是产品经理
N
Netflix TechBlog - Medium
Jina AI
Jina AI
D
Docker
Y
Y Combinator Blog

博客园 - 范晨鹏

分省svg代码 noi数据分析工具 unreal engine 5 移动到其它主机时的 epic games launcher 识别修复 楼宇对讲自动开门的设计与实现 循*迹小车轨道识别算法 树莓派ssh卡顿之双机互联解决 ntfs 时间戳换算 安装 django 教程 利用 dns 实现 app简易抓包 安装django 框架 tensorflow 学习记记——环境安装 用pillow和 opencv做透明通道的两图混全(blend) centos升级gcc centos 7 中 tomcat 安装 centos中 mysql 5.7安装 xsocks 64位平台下编译问题小记 mingw 环境编译 liburl故障一例 szutsid youku.com awstats 日志分析工具linux下的安装和使用
openwrt 编译newifi 应用程序
范晨鹏 · 2016-11-01 · via 博客园 - 范晨鹏

首先找交叉编译工具( toolchain )

Development Snapshots

http://downloads.openwrt.org/snapshots/trunk/

我需要的版本是 m7620 

http://downloads.openwrt.org/snapshots/trunk/ramips/mt7620/ 

下载文件  OpenWrt-Toolchain-ramips-mt7620_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2 

[root@VM_129_51_centos openwrt]# wget http://downloads.openwrt.org/snapshots/trunk/ramips/mt7620/OpenWrt-Toolchain-ramips-mt7620_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2
[root@VM_129_51_centos openwrt]# tar -jxf OpenWrt-Toolchain-ramips-mt7620_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2
[root@VM_129_51_centos openwrt]# mv OpenWrt-Toolchain-ramips-mt7620_gcc-5.3.0_musl-1.1.15.Linux-x86_64 toolchain
[root@VM_129_51_centos openwrt]# wget http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7620/OpenWrt-SDK-15.05.1-ramips-mt7620_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64.tar.bz2
[root@VM_129_51_centos openwrt]# tar -jxf OpenWrt-SDK-15.05.1-ramips-mt7620_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64.tar.bz2
[root@VM_129_51_centos openwrt]# mv OpenWrt-SDK-15.05.1-ramips-mt7620_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64 SDK
[root@VM_129_51_centos openwrt]# find / -name staging_dir
/root/openwrt/SDK/staging_dir
[root@VM_129_51_centos bin]# export STAGING_DIR='/root/openwrt/SDK/staging_dir'
[root@VM_129_51_centos bin]# export CC=/root/openwrt/toolchain/toolchain-mipsel_24kec+dsp_gcc-5.3.0_musl-1.1.15/bin/mipsel-openwrt-linux-musl-g++
[root@VM_129_51_centos bin]# export CPLUS_INCLUDE_PATH=/root/openwrt/SDK/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/linux-3.18.23/include/uapi/linux/can/
[root@VM_129_51_centos bin]# export LD_FLAGS=-L/root/openwrt/toolchain/toolchain-mipsel_24kec+dsp_gcc-5.3.0_musl-1.1.15/lib/  -static-libstdc++ -static-libgcc -lgcc_s
-static-libstdc++ -static-libgcc

两个选项必须同时使用。相关的介绍请参照:http://blog.csdn.net/kissnsms/article/details/17142149

交叉工具链没有ldd,因此无法查找库依赖关系,可以用以下替代解决方案

readelf -a filename|grep "Shared library"