如何在 Android/Linux 上构建 OpenSSL?
你好 我需要为 Android NDK r5b 构建 OpenSSL 库,今天将是我的...useles 战斗的第二天。这是我所做的
- 下载的简短列表: https://github.com/fries/android -external-openssl/
- 正如我在 StackOverflow 上发现的,修复了 .S <->.s 问题
- 加密被构建...直到我收到此消息:
/prebuilt/windows/bin/arm-linux-androideabi - 共享库:libcrypto.so arm-linux-androideabi-g++.exe: CreateProcess: 没有这样的文件或目录 make:* [/cygdrive/c/AndroidDev/AndroidOpenSSL/obj/local/armeabi/libcrypto.so] 错误1*
我上次使用make已经是10年前的事了,我确信这是g++路径的问题。向工具链添加了一些调试,并得到:
TOOLCHAIN_NAME:arm-linux-androideabi-4.4.3 TOOLCHAIN_PREFIX: /cygdrive/c/Android_NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/arm-linux-androideabi -
两者对我来说都很好,因为 /cygdrive/c/Android_NDK/toolchains/arm -linux-androideabi-4.4.3/prebuilt/windows/bin/ 确实存在,并且arm-linux-androideabi-g++.exe就在那里:(
有人遇到过同样的问题吗?我真的不知道去哪里找未来 :( 将不胜感激的帮助
Hi
I'm in need to build OpenSSL lib for Android NDK r5b, today it will be second day of my ... useles fight. Here is short list what i've done
- Downloaded: https://github.com/fries/android-external-openssl/
- As i found here on StackOverflow fixed .S <->.s problem
- Crypto gets builded... until i get this message:
/prebuilt/windows/bin/arm-linux-androideabi-
SharedLibrary : libcrypto.so
arm-linux-androideabi-g++.exe: CreateProcess: No such file or directory
make: * [/cygdrive/c/AndroidDev/AndroidOpenSSL/obj/local/armeabi/libcrypto.so]
Error 1*
It's 10 years when i last time used make, and i was sure it's problem with g++ path. Added some debug to toolchain, and got:
TOOLCHAIN_NAME: arm-linux-androideabi-4.4.3
TOOLCHAIN_PREFIX: /cygdrive/c/Android_NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/arm-linux-androideabi-
both looks fine for me, as /cygdrive/c/Android_NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/ does exist, and arm-linux-androideabi-g++.exe is right there :(
Any one ever had this same problem? I realy have no idea where to look any future :(
Will be appreciative for help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
一种解决方案也是缩短 openssl 构建路径,例如。从 c:\code\openssl-android 到 c:\ssl
One solution is also to shorten the openssl build path, eg. from c:\code\openssl-android to just c:\ssl
看来只有我有这样的问题。这是我找到的解决方案,也许有人会弄清楚为什么会发生这种情况。
将命令行保存到名为 bild_data 的单独文件(来自 ndk-build 的输出),然后从中删除 g++ 调用,这样我的构建文件只有文件列表和所需的标志。然后我刚刚从 cygwin arm-linux-androideabi-g++ @build_data 执行
之后,我使用从命令行构建的 libcrypto.so alerdy 再次执行了我的“珍贵”libcrypto.so,ndk-build,构建了 openssl 库。
对我来说,超过 31kb 的命令行似乎不适合 cygwin 缓冲区:(
Looks like only i had such problem. Here is a solution i found, mayby someone will figure out why this happend.
Saved command line to separate file called bild_data (output from ndk-build), then removed from it g++ call, this way my build file had only list of files and needed flags. Then i just executed from cygwin arm-linux-androideabi-g++ @build_data
After that i had my 'precious' libcrypto.so, ndk-build executed again with libcrypto.so alerdy builded from command line, builded openssl library.
For me it looks like command line that was over 31kb did not fit to cygwin buffer :(
我在Windows(cygwin)上构建时遇到了同样的问题,缩短项目目录的路径(参见芒果的答案)对我来说很有效。
I had the same problem building on Windows (cygwin), and shortening the path to the project directory (see mango's answer) is what worked for me.