본문 바로가기

학부_대학원/임베디드 리눅스

tcpdump cross compile

SMALL

libpcap, tcpdump source download

cross toolchain arm, mips gcc 설치 

ex) gcc-arm-linux-gnueabi

sudo apt-get install gcc-arm-linux-gnueabi

$cd libpcap
$CC="arm-linux-gnueabi-gcc -static -fPIC" ./configure --host=arm-linux --prefix=/home/$USER/crosscompile/crossroot/ --disable-shared
$make && make install

$cd tcpdump
$CC="arm-linux-gnueabi-gcc -fpic"  CFLAGS=-static CPPFLAGS=-static LDFLAGS=-static ./configure --host=arm-linux --prefix=/home/$USER/crosscompile/crossroot/
$make && make install

--host : 타겟 시스템
--prefix : 빌드한 결과물 위치 라이브러리는  lib에 바이너리는 bin, sbin

~/crosscompile/crossroot/sbin$ file tcpdump
tcpdump: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, for GNU/Linux 3.2.0, BuildID[sha1]=d996ab90c82200fea6aa67f3f9c0e40d3e3cbab6, not stripped

 

 

LIST