Android ndk 构建在 cygwin 下神秘失败,并出现“错误 126”

发布于 2024-10-21 18:52:48 字数 520 浏览 3 评论 0原文

我有一个由 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

拥醉 2024-10-28 18:52:48

Make 错误 126 是权限被拒绝。您运行防病毒软件吗?如果是这样,也许它正在锁定文件或阻止写入,从而导致错误?如果您没有打开防病毒软件,也许您有其他软件可能会获取文件锁?

Make error 126 is permission 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?

萌逼全场 2024-10-28 18:52:48

我发现防止在我们的构建中发生此错误(及其姊妹错误 make 错误 127)的唯一方法是将 make 的最大同时作业数设置为 1。

为此,请使用命令行参数运行 make " -j 1”,例如:

make -j 1 CONFIG=debug

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.:

make -j 1 CONFIG=debug
紫竹語嫣☆ 2024-10-28 18:52:48

当这种情况发生在我身上时,我通常只是删除与错误相关的对象文件(在您的情况下为 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文