您的位置:首页 > 健康 > 美食 > 推广公司简介怎么写_东莞公司高端网站建设_江苏seo外包_seo推广的网站和平台有哪些

推广公司简介怎么写_东莞公司高端网站建设_江苏seo外包_seo推广的网站和平台有哪些

2025/4/28 21:36:20 来源:https://blog.csdn.net/wv112406/article/details/147549100  浏览:    关键词:推广公司简介怎么写_东莞公司高端网站建设_江苏seo外包_seo推广的网站和平台有哪些
推广公司简介怎么写_东莞公司高端网站建设_江苏seo外包_seo推广的网站和平台有哪些

有老板子需要抓包,编译tcpdump

查看cpu和系统版本及libc版本, 确定交叉编译工具链,libc是4.5.2编译,在网上找4.9也是兼容的。

[root@M3352 ~]# cat /proc/cpuinfo
Processor       : ARMv7 Processor rev 2 (v7l)
BogoMIPS        : 795.44
Features        : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x3
CPU part        : 0xc08
CPU revision    : 2Hardware        : m3352
Revision        : 0000
Serial          : 0000000000000000[root@M3352 ~]# uname -a
Linux M3352 3.2.0 #1 Wed Jul 5 03:32:13 CST 2017 armv7l GNU/Linux# 查看GLIBc版本
[root@M3352 ~]# /lib/libc.so.6
GNU C Library (Sourcery G++ Lite 2011.03-41) stable release version 2.13, by Roland McGrath et al.
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.5.2.
Compiled on a Linux 2.6.38 system on 2011-04-15.
Available extensions:crypt add-on version 2.1 by Michael Glad and othersGNU Libidn by Simon JosefssonNative POSIX Threads Library by Ulrich Drepper et alSupport for some architectures added on, not maintained in glibc core.BIND-8.2.3-T5B
libc ABIs: UNIQUE
For bug reporting instructions, please see:
<https://support.codesourcery.com/GNUToolchain/>.

配置编译工具4.9.4

wget https://releases.linaro.org/components/toolchain/binaries/4.9-2017.01/arm-linux-gnueabihf/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf.tar.xz
tar -xvf gcc-linaro-4.9.4-*.tar.xz

因为我还有64位工具链,就不配置到PATH,每次手动运行

export CXX=/home/wv/bin/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-c++
export CC=/home/wv/bin/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
PATH=$PATH:/home/wv/bin/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/binarm-linux-gnueabihf-gcc -v  # 查看版本及支持的架构

静态编译:单个文件libpcap打包到一起

# 改为使静态库编译
git clone https://github.com/the-tcpdump-group/libpcap
cd libpcap
git checkout libpcap-1.9
mkdir build-static && cd build-static
make distclean  # 清理旧编译文件
../configure --host=arm-linux-gnueabi \--prefix=$PWD/install \--enable-static=yes \--disable-shared \--with-pcap=linux
make && make install# 应存在此文件
ls install/lib/libpcap.a  git clone https://github.com/the-tcpdump-group/tcpdump
cd tcpdump
git checkout tcpdump-4.9
mkdir build-static && cd build-static
../configure --host=arm-linux-gnueabi \--with-libpcap=../../libpcap/build-static/install \CFLAGS="-I../../libpcap/build-static/install/include" \LDFLAGS="-L../../libpcap/build-static/install/lib -static"
make        file tcpdump
tcpdump: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, for GNU/Linux 2.6.31, BuildID[sha1]=6fab3757bf05219fc6e8320fa12768fc896b2692, with debug_info, not stripped# 上传开发板tcpdump就行,不用传libpcap
[root@M3352 ~]# ./tcpdump -D
1.eth0 [Up, Running]
2.lo [Up, Running, Loopback]
3.any (Pseudo-device that captures on all interfaces) [Up, Running]
4.can0 [none]
5.can1 [none]
6.usb0 [none]
7.eth1 [none]

在网上找都是动态编译,如下,编译正常,但运行报错

git clone https://github.com/the-tcpdump-group/libpcap
cd libpcap
git checkout libpcap-1.9
mkdir build
cd build
../configure --host=arm-linux  --prefix=$PWD/install --with-pcap=linux
make && make installgit clone https://github.com/the-tcpdump-group/tcpdump
cd tcpdump
git checkout tcpdump-4.9
mkdir build
cd build
ln -s ../../libpcap/build/install/ libpcap
../configure --host=arm-linux CFLAGS="-I./libpcap/include/ -L./libpcap/lib/" --with-pcap=linux
make
file tcpdump# 32位编译后
tcpdump: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.31, BuildID[sha1]=87b1ccd914c49d14420d8b174091d7f360a805ba, with debug_info, not stripped# 上传tcpdump和libpcap.so.1
ln -s libpcap.so.1.9.1 libpcap.so.1
export LD_LIBRARY_PATH=./
./tcpdump --help
-sh: ./tcpdump: No such file or directory

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com