make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libdvm_intermediates/native/dalvik_system_Zygote.

I started getting this error while compiling CyanogenMod 9 (Android 4.0.x) last week:

dalvik/vm/native/dalvik_system_Zygote.cpp: In function ‘int setrlimitsFromArray(ArrayObject*)’:
dalvik/vm/native/dalvik_system_Zygote.cpp:199:19: error: aggregate ‘setrlimitsFromArray(ArrayObject*)::rlimit rlim’ has incomplete type and cannot be defined
     struct rlimit rlim;
                   ^
dalvik/vm/native/dalvik_system_Zygote.cpp:222:43: error: ‘setrlimit’ was not declared in this scope
         err = setrlimit(contents[0], &rlim);
                                           ^
make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libdvm_intermediates/native/dalvik_system_Zygote.o] Error 1
make: *** Waiting for unfinished jobs....

I’m not sure if it’s due to a recent Arch Linux change or what, but it seems the fix is simply to add #include <sys/resource.h>to dalvik/vm/native/dalvik_system_Zygote.cpp. Here’s a diff:

diff --git a/vm/native/dalvik_system_Zygote.cpp b/vm/native/dalvik_system_Zygote.cpp
index 8224656..f4102e8 100644
--- a/vm/native/dalvik_system_Zygote.cpp
+++ b/vm/native/dalvik_system_Zygote.cpp
@@ -19,6 +19,7 @@
  */
 #include "Dalvik.h"
 #include "native/InternalNativePriv.h"
+#include <sys/resource.h>
 
 #include 
 #if (__GNUC__ == 4 && __GNUC_MINOR__ == 7)转载:http://www.google.com.hk/search?newwindow=1&safe=strict&client=aff-cs-360se&hs=Ixi&q=make%3A+***+%5Bout%2Fhost%2Flinux-x86%2Fobj%2FSHARED_LIBRARIES%2Flibdvm_intermediates%2Fnative%2Fdalvik_system_Zygote.o%5D+Error+1+&oq=make%3A+***+%5Bout%2Fhost%2Flinux-x86%2Fobj%2FSHARED_LIBRARIES%2Flibdvm_intermediates%2Fnative%2Fdalvik_system_Zygote.o%5D+Error+1+&gs_l=serp.12...42925.42925.0.44067.1.1.0.0.0.0.0.0..0.0....0...1c.1.21.serp.nMmPV-H4QQo
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值