openssl-1.1.1移植./libcrypto.so: undefined reference to `getcontext'错误及解决

https://www.openssl.org/source/下载openssl-1.1.1源代码

# tar zxvf openssl-1.1.1.tar.gz  
# cd openssl-1.1.1
# mkdir build_arm
# ./config no-asm shared no-async --prefix=/home/wenyi/development/soft_arm/openssl-1.1.1/build_arm --cross-compile-prefix=arm-hisiv500-linux-   生成makefile文件
修改makefile,去除掉 -m64和-m32选项
# make && make install

【错误描述】:

./libcrypto.so: warning: gethostbyname is obsolescent, use getnameinfo() instead.
./libcrypto.so: undefined reference to `getcontext'
./libcrypto.so: undefined reference to `setcontext'
./libcrypto.so: undefined reference to `makecontext'

【错误原因】:
之前config使用:
./config no-asm shared --prefix=/home/wenyi/development/soft_arm/openssl-1.1.1/build_arm --cross-compile-prefix=arm-hisiv500-linux-
没有使用 no-async 参数,加上之后就可以了。
【参数说明】

  1. no-asm: 在交叉编译过程中不使用汇编代码代码加速编译过程.原因是它的汇编代码是对arm格式不支持的。
  2. shared: 生成动态连接库。
  3. no-async: 交叉编译工具链没有提供GNU C的ucontext库
  4. –prefix=: 安装路径,编译完成install后将有bin,lib,include等文件夹
  5. –cross-compile-prefix=: 交叉编译工具
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章