我正在尝试构建 kivy-ios 并包含 openssl。我按照之前 Kivy 用户组的帖子进行了操作,并执行了以下步骤:
我尝试使用克隆到 ios-openssl 中已经构建的库。但是当我尝试构建 kivy-ios 时,我收到一个关于“_SSLv2_method”的链接错误。关于可能导致这种情况的任何想法?任何帮助表示赞赏。
Undefined symbols for architecture x86_64:
"_SSLv2_method", referenced from:
_PySSL_sslwrap in libpython2.7.a(_ssl.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [python.exe] Error 1
最佳答案
Cloning to https://github.com/st3fan/ios-openssl
...
Any idea about what might be causing this?
Sefan 非常敏锐,如果他使用选项
no-ssl2
配置 OpenSSL,我不会感到惊讶。 .您应该打开有问题的文件(可能是
PySSL_sslwrap.c
)并像这样包装有问题的代码:const SSL_CTX* context = NULL;
...
#ifndef OPENSSL_NO_SSL2
/* Some code to select SSLv2 only */
context = SSL_CTX_new(SSLv2_method());
#endif
有问题的文件(如
PySSL_sslwrap.c
)还应包括 <openssl/opensslconf.h>
以确保他们正确选择配置。由于 POODLE,您可能还需要为各种
SSLv3_method
执行此操作. intetest的定义是OPENSSL_NO_SSL3
.这是一个修改后的示例 SSLscan如果 SSLv2 和 SSLv3 不存在,它会围绕它们跳舞:Modified SSLscan .
它还检测是否存在 TLS 1.1 和 TLS 1.2 以及以下内容。在 OpenSSL 1.0.1 中添加了 TLS 1.1 和 TLS 1.2(
OPENSSL_VERSION_NUMBER
值 0x10001000L
)。#if !(OPENSSL_VERSION_NUMBER >= 0x10001000L)
# define SSLSCAN_NO_TLS1_1
# define SSLSCAN_NO_TLS1_2
#endif
/* OpenSSL was config'd with 'no-ssl2' */
#ifdef OPENSSL_NO_SSL2
# define SSLSCAN_NO_SSL2
#endif
/* OpenSSL was config'd with 'no-ssl3' */
#ifdef OPENSSL_NO_SSL3
# define SSLSCAN_NO_SSL3
#endif
Any idea about what might be causing this?
最后的“任何想法”是确保您链接到 OpenSSL 库(按此顺序
-lssl -lcrypto
)。我很确定你是。如果你不是,你会得到一大堆 undefined symbol ,而不仅仅是那个。编辑 : 这很明显(现在)...
Undefined symbols for architecture x86_64:
您的项目是为 x86_64 而不是 iOS 构建的。我的猜测是你在 Xcode 中创建了一个 OS X 项目,而不是 iOS 项目。
不过,我不确定为什么您没有得到大量 undefined symbol 。通常你会得到数百个 undefined symbol 。
关于ios - 使用 OpenSsl 支持构建 Kivy-ios,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27664138/