1、openssl1.1.1m交叉编译
将openssl 源代码的config文件放到设备里运行,执行 ./config -h
/var/run/tmp3 # ./config -h ./config: line 17: dirname: not found Usage: config [options] -d Build with debugging when possible. -t Test mode, do not run the Configure perl script. -v Verbose mode, show the exact Configure call that is being made. -h This help. Any other text will be passed to the Configure perl script. See INSTALL for instructions. Operating system: armv7l-whatever-linux2 You need Perl 5.
将得到的
Operating system:
的值在config
中修改# read the output of the embedded GuessOS read GUESSOS # 添加下边这句 GUESSOS="armv7l-whatever-linux2" echo Operating system: $GUESSOS
这一步非常重要,切记!!!否则会握手失败,报解密错误
PS:改了config之后,Makefile不需要再动,直接编译即可!!! 有很多交叉编译blog,没有改config,让直接修改Makefile,如去掉-m64、-m32,修改PLATFORM=armv7l-whatever-linux2等,这些自测都没用,耽误了很长时间……
./config no-asm no-async no-shared --prefix=$(pwd)/build --cross-compile-prefix=arm-himix200-linux-
no-asm: 在交叉编译过程中不使用汇编代码代码加速编译过程.
shared: 生成动态连接库。
no-async: 交叉编译工具链没有提供GNU C的ucontext库时,就需要加上
–prefix=: 安装路径,编译完成install后将有bin,lib,include等文件夹
–cross-compile-prefix=: 交叉编译工具make && make install