分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > IT知识

在 Arch 下编译 OpenWRT cmcurl 问题与解决方案

发布时间:2023-09-06 01:19责任编辑:赖小花关键词:url编译

0 现象

在 Arch 下编译 OpenWRT (15.05) cmcurl 时报错:

[ 28%] Linking C executable LIBCURL
lib/libcmcurl.a(openssl.c.o): In function `cert_stuff`:openssl.c:(.text+0x97a): undefined reference to `sk_num`openssl.c:(.text+0x99a): undefined reference to `sk_pop`openssl.c:(.text+0xa21): undefined reference to `sk_num`openssl.c:(.text+0xa62): undefined reference to `sk_pop_free`lib/libcmcurl.a(openssl.c.o): In function `Curl_ossl_init`:openssl.c:(.text+0xf74): undefined reference to `SSL_load_error_strings`openssl.c:(.text+0xf79): undefined reference to `SSL_library_init`openssl.c:(.text+0xf89): undefined reference to `OPENSSL_add_all_algorithms_noconf`lib/libcmcurl.a(openssl.c.o): In function `Curl_ossl_cleanup`:openssl.c:(.text+0xfad): undefined reference to `EVP_cleanup`openssl.c:(.text+0xfb2): undefined reference to `ERR_free_strings`lib/libcmcurl.a(openssl.c.o): In function `verifyhost`:openssl.c:(.text+0x1a7a): undefined reference to `sk_num`openssl.c:(.text+0x1a9a): undefined reference to `sk_value`lib/libcmcurl.a(openssl.c.o): In function `ossl_connect_step1`:openssl.c:(.text+0x29a5): undefined reference to `SSLv23_client_method`lib/libcmcurl.a(openssl.c.o): In function `X509V3_ext`:openssl.c:(.text+0x3a77): undefined reference to `sk_num`openssl.c:(.text+0x3aab): undefined reference to `sk_value`openssl.c:(.text+0x3d5c): undefined reference to `sk_num`lib/libcmcurl.a(openssl.c.o): In function `get_cert_chain`:openssl.c:(.text+0x3fe2): undefined reference to `sk_num`openssl.c:(.text+0x4061): undefined reference to `sk_value`lib/libcmcurl.a(openssl.c.o): In function `Curl_ossl_version`:openssl.c:(.text+0x61c3): undefined reference to `SSLeay`collect2: error: ld returned 1 exit status

看得出来应该是相关库未链接成功。

1 解决方案

查阅了相关文档,发现这些方法是在老的 OpenSSL 中存在的,首先先安装老版本:

$ sudo pacman -S openssl-1.0

使用软链接的方式,更改默认库的指向使用老版本即可(若已有软链接,需要先删除),如:

# rm libcrypto.so# rm libssl.so# ln -s libcrypto.so.1.0.0 libcrypto.so# ln -s libssl.so.1.0.0 libssl.so

在 Arch 下编译 OpenWRT cmcurl 问题与解决方案

原文地址:http://www.cnblogs.com/sigeryoung/p/arch-compiling-openwrt-openssl-issue.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved