빌드 참조 http://webnautes.tistory.com/380


stbgcc 경로 /home/stbgcc-4.8-1.2


1. zlib 빌드/빌드버전: 1.2.8버전


$wget http://zlib.net/zlib-1.2.8.tar.gz

$tar xvzf zlib-1.2.8.tar.gz

$cd zlib-1.2.8

$CC=/home/stbgcc-4.8-1.2/bin/arm-linux-gcc ./configure --shared --prefix=/home/cby91/build/zlib

$make

$make install


옵션

CC:크로스컴파일러 gcc 경로 

--shared: 공유라이브러리 빌드

--prefix: install될 경로이다.


2. openssl 빌드/ 빌드버전: 1.0.2h 버전


$wget https://www.openssl.org/source/openssl-1.0.2h.tar.gz

$tar xvzf openssl-1.0.2h.tar.gz

$cd openssl-1.0.2h

$./Configure --prefix=/home/cby91/build/openssl os/compiler:/home/stbgcc-4.8-1.2/bin/arm-linux-gcc shared -fPIC


옵션

--prefix: 설치될 경로

os/compiler: 크로스컴파일러 gcc 경로

shared: 공유라이브러리 빌드

-fPIC: 위치 독립 코드로 컴파일한다.


3. openssh 빌드/ 빌드버전: 7.2p2


$wget http://ftp.jaist.ac.jp/pub/OpenBSD/OpenSSH/portable/openssh-7.2p2.tar.gz

$tar xvzf openssh-7.2p2.tar.gz

$cd openssh-7.2p2

$./configure --host=arm-linux  --with-libs --with-zlib=/home/cby91/build/zlib --with-ssl-dir=/home/cby91/build/openssl --disable-etc-default-login 

CC=/home/stbgcc-4.8-1.2/bin/arm-linux-gcc AR=/home/stbgcc-4.8-

1.2/bin/arm-linux-ar


옵션

--host: cross-compile to build programs to run on HOST

--with-libs: Specify additional libraries to link with

--with-zlib: zlib 설치 경로

--with-ssl-dir: ssl 설치 경로

CC: 크로스컴파일러 gcc 경로 

AR: 크로스컴파일러 AR 경로

--with-pie: 위치독립실행파일 생성(생략가능)


openssl 설정할 때 shared와 -fPIC이 빠져있으면 configure: error: *** OpenSSL headers missing - please install first or check config.log *** 이런 에러가 뜬다.

위치독립실행파일을 만들기 위해서는 공유라이브러리가 필요한데 그러지 못해서 생긴 오류같다. 

shared, -fPIC옵션을 빼고 빌드할려면 ssh에 --without-pie 옵션을 추가하면 된다. 이 경우에는 일반 실행파일이 생성된다.


빌드가 완료되면 위치독립실행파일이 생성됩니다.

위치독립실행파일에 관한 참조 - https://bpsecblog.wordpress.com/2016/06/10/memory_protect_linux_4/

+ Recent posts