针对NDK 15.2为Android构建OpenSSL 1.1.0c的问题

时间:2017-11-02 10:08:56

标签: macos build openssl sqlcipher

运行build-openssl-libraries.sh时,我遇到以下问题:

运行时发出警告./在第48行配置dist:

The library could not be configured for supporting multi-threaded
applications as the compiler options required on this system are not known.
See file INSTALL for details if you need multi-threading.

The options 'shared', 'pic' and 'dynamic-engine' aren't supported on this
platform, so we will pretend you gave the option 'no-pic', which also disables
'shared' and 'dynamic-engine'.  If you know how to implement shared libraries
or position independent code, please let us know (but please first make sure
you have tried with a current version of OpenSSL).

运行build / tools / make-standalone-toolchain.sh时出错@line 75:

HOST_OS=darwin
HOST_EXE=
HOST_ARCH=x86_64
HOST_TAG=darwin-x86_64
HOST_NUM_CPUS=4
BUILD_NUM_CPUS=8
ERROR: Failed to create toolchain.

由于此错误,后续编译.c文件失败,说未找到stdlib.h。

请帮助我了解如何成功构建它...在Android上我需要多线程支持。

  • 忽略两个./Configure警告
  • 的含义是什么
  • 如何让工具链成功?

我在macOS Sierra 10.12.6上运行。这是构建SQLCipher的一部分。

2 个答案:

答案 0 :(得分:1)

我已经使用适用于Android here的SQLCipher的Android NDK r15c更新了用于构建OpenSSL的构建脚本。你会尝试一下吗?

答案 1 :(得分:0)

当我更改了线路时,两个警告消失了。#。配置dist" to" ./配置android"。

make工具链问题是因为参数传递了android-9而NDK15只支持android-14。正如有人建议的那样,这是通过启用--verbose for make-toolchain命令来发现的。

现在脚本编译所有.c文件但在链接期间遇到问题(apps / openssl.o:openssl.c:function main:error:undefined reference to' stpcpy')。再看看配置或NDK配置的一些问题..

为可能面临同样问题的任何人写作答案..