tcpdump arm64编译
简单的记录一下tcpdump的编译,这里主要是交叉编译arm64的. 这一套是利用configure + make的,理论上cmake也可以试试的。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
sudo apt install build-essential
sudo apt install crossbuild-essential-arm64 byacc flex\
export TCPDUMP=4.99.1
export LIBPCAP=1.10.1
wget http://www.tcpdump.org/release/tcpdump-${TCPDUMP_VERSION}.tar.gz
wget http://www.tcpdump.org/release/libpcap-${PCAP_VERSION}.tar.gz
tar zxvf tcpdump-$TCPDUMP.tar.gz
tar zxvf libpcap-$LIBPCAP.tar.gz
eport CC=aarch64-linux-gnu-gcc
cd libpcap-$LIBPCAP
./configure --host=arm-linux --with-pcap=linux
make -j
cd ..
cd tcpdump-$TCPDUMP
uname -a # Linux ubuntu 5.4.0-91-generic #102-Ubuntu SMP Fri Nov 5 16:31:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
# libpcap编译静态编译会报错
export ac_cv_linux_vers=5
export CFLAGS=-static
export CPPFLAGS=-static
export LDFLAGS=-static
# 这里没libcrypto arm64的,我直接选择不编。。。
./configure --host=arm-linux --without-crypto
make -j
aarch64-linux-gnu-strip tcpdump
file tcpdump
This post is licensed under CC BY 4.0 by the author.