Android ndk 构建在 cygwin 下神秘失败,并出现“错误 126”
我有一个由 ndk-build 构建的 JNI 应用程序(使用 Android NDK r5b 和 cygwin make 3.81)。构建通常可以正常工作,但偶尔会失败并显示:
...
Compile++ thumb : components <= Component.cpp
make: *** [/c/.hudson/jobs/Nightly/workspace/application/obj/local/armeabi/objs/components/Component.o] Error 126
make: Leaving directory `/c/.hudson/jobs/Nightly/workspace/application/obj/local/armeabi/objs/components'
没有其他错误。 Make 退出时状态为 2。每次都发生在不同的文件中(上面的名称是匿名的)。这种情况似乎在并行构建中更常见,但有时也会在非并行构建中发生。
有谁知道它可能是什么或至少如何调试它?
I have a JNI application built by ndk-build
(using Android NDK r5b and cygwin make 3.81). The build usually works, by occasionally fails with:
...
Compile++ thumb : components <= Component.cpp
make: *** [/c/.hudson/jobs/Nightly/workspace/application/obj/local/armeabi/objs/components/Component.o] Error 126
make: Leaving directory `/c/.hudson/jobs/Nightly/workspace/application/obj/local/armeabi/objs/components'
There is no other error. Make than exits with status 2. It happens in different file each time (the name above is anonymized). It seems to happen more often with parallel builds, but sometimes happens with non-parallel builds too.
Does anybody have an idea what it might be or at least how to debug it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Make
错误 126 是权限被拒绝
。您运行防病毒软件吗?如果是这样,也许它正在锁定文件或阻止写入,从而导致错误?如果您没有打开防病毒软件,也许您有其他软件可能会获取文件锁?Make
error 126 ispermission denied
. Do you run antivirus software? IF so, maybe it is locking files or preventing writes, and therefore causing errors? If you do not have antivirus software on, maybe you have another software which might be acquiring file locks?我发现防止在我们的构建中发生此错误(及其姊妹错误 make 错误 127)的唯一方法是将 make 的最大同时作业数设置为 1。
为此,请使用命令行参数运行 make " -j 1”,例如:
The only way I've found to prevent this (and its sister error, make error 127) from occurring in our build is to set make's maximum number of simultaneous jobs to 1.
To do this, run make with the command-line parameters "-j 1", e.g.:
当这种情况发生在我身上时,我通常只是删除与错误相关的对象文件(在您的情况下为 Component.o 和 Component.od),然后重建。
When this happens to me, I usually just delete the object files associated with the error (in your case Component.o and Component.o.d) then rebuild.