交叉编译ethtool(ubuntu 2018)

参考文章:https://www.cnblogs.com/nazhen/p/16800427.html

https://blog.csdn.net/weixin_43128044/article/details/137953913

1、下载相关安装包

c 复制代码
//ethtool依赖libmul
git clone http://git.netfilter.org/libmnl
//ethtool源码
git clone http://git.kernel.org/pub/scm/network/ethtool/ethtool.git


2、编译libmnl

c 复制代码
//执行脚本生成配置文件
./autogen.sh
//自动配置编译环境,生成makefile等文件
./configure  --host=arm-linux CC=aarch64-linux-gnu-gcc LDFLAGS=-static --prefix=$PWD
//若之前编译过,先清除之前的编译结果
make clean
//编译
make

问题:

解决:

automake工具未安装

c 复制代码
sudo apt-get install automake

生成目标文件:

3、交叉编译ethtool源码

c 复制代码
//创建编译所需配置文件
./autogen.sh
//自动配置编译环境,生成makefile等文件,将$LIBMNL_PWD替换为libmnl项目根目录,如:/opt/libmnl
./configure --prefix=$PWD --host=arm-linux CC=aarch64-linux-gnu-gcc MNL_CFLAGS="-I$LIBMNL_PWD/include" MNL_LIBS="-L$LIBMNL_PWD/lib -lmnl" LDFLAGS=-static
//若之前编译过,先清除之前的编译结果
make clean
//编译目标文件
make CFLAGS="-I/home/johan/opt/ethtool/libmnl/include" LDFLAGS="-L/home/johan/opt/ethtool/libmnl/lib"



相关推荐
石像鬼₧魂石1 小时前
内网渗透靶场实操清单(基于 Vulhub+Metasploitable 2)
linux·windows·学习·ubuntu
橘子真甜~3 小时前
C/C++ Linux网络编程15 - 网络层IP协议
linux·网络·c++·网络协议·tcp/ip·计算机网络·网络层
拾贰_C3 小时前
【Linux | Windows | Terminal Command】 Linux---grep | Windows--- findstr
linux·运维·服务器
阿华hhh4 小时前
Linux系统编程(标准io)
linux·开发语言·c++
石像鬼₧魂石5 小时前
Kali Linux 网络端口深度扫描
linux·运维·网络
alengan5 小时前
linux上面写python3日志服务器
linux·运维·服务器
Rose sait6 小时前
【环境配置】Linux配置虚拟环境pytorch
linux·人工智能·python
叶之香7 小时前
CentOS/RHEL 7、8安装exfat和ntfs文件系统
linux·运维·centos
一世琉璃白_Y7 小时前
pg配置国内数据源安装
linux·python·postgresql·centos