openssh交叉編譯:
1.官網下載地址:
https://www.mindrot.org/openssh_snap/
2.配置:
openssh需要依賴openssl和zlib
首先需要編譯另兩個依賴庫,可以參見作者其它兩篇隨筆。
作者將交叉編譯好的openssl和zlib放到/usr/local/include和/usr/local/lib目錄下
這是由於configure時只能指定一個CFLAGS和LDFLAGS
cd openssh
mkdir __install
./configure CC=arm-linux-gnueabihf-gcc \
--prefix=$(pwd)/__install \
--host=arm-linux-gnueabihf \
CFLAGS=-I/usr/local/include \
LDFLAGS=-L/usr/local/lib
make
make install
注:make install的時候會出現錯誤:strip: Unable to recognise the format of the input file
這是由於目標文件和編譯環境不一樣導致的,這里作者沒有用解決,暫且留着以后解決。