원래 Arm기반CPU에 탑재되는 Android OS를 X86기반의 CPU에도 작동할수 있게 포팅하는 프로젝트인 Android-x86 프로젝트 사이트(http://www.android-x86.org/)에서 x86기반의 안드로이드 소스(여기서는 Gingerbread)를 받고 난 후 빌드 하였다 

make iso_img TARGET_PRODUCT=generic_x86

빌드후에 에러 나는 점을 검색해서 문제 해결한 부분 링크를 붙였다.

결국 빌드는 완료했고 kvm위에서 실행해보았으나 원하는 시험 결과가 나오지 않아 실망했음.

 

dalvik/vm/native/dalvik_system_Zygote.cpp: In function 'int setrlimitsFromArray(ArrayObject*)':
dalvik/vm/native/dalvik_system_Zygote.cpp:194: error: aggregate 'rlimit rlim' has incomplete type and cannot be defined
dalvik/vm/native/dalvik_system_Zygote.cpp:217: error: 'setrlimit' was not declared in this scope
make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libdvm_intermediates/native/dalvik_system_Zygote.o] Error 1
make: *** Waiting for unfinished jobs....

 Fix for Dalvik compile error on CyanogenMod 9

 

  CC      arch/x86/kernel/ptrace.o
/home/dhsung/android-x86/kernel/arch/x86/kernel/ptrace.c:1366:17: error: conflicting types for ‘syscall_trace_enter’
In file included from /home/dhsung/android-x86/kernel/arch/x86/include/asm/vm86.h:130:0,
                 from /home/dhsung/android-x86/kernel/arch/x86/include/asm/processor.h:10,
                 from /home/dhsung/android-x86/kernel/arch/x86/include/asm/thread_info.h:22,
                 from /home/dhsung/android-x86/kernel/include/linux/thread_info.h:53,
                 from /home/dhsung/android-x86/kernel/include/linux/preempt.h:9,
                 from /home/dhsung/android-x86/kernel/include/linux/spinlock.h:50,
                 from /home/dhsung/android-x86/kernel/include/linux/seqlock.h:29,
                 from /home/dhsung/android-x86/kernel/include/linux/time.h:8,
                 from /home/dhsung/android-x86/kernel/include/linux/timex.h:56,
                 from /home/dhsung/android-x86/kernel/include/linux/sched.h:57,
                 from /home/dhsung/android-x86/kernel/arch/x86/kernel/ptrace.c:8:
/home/dhsung/android-x86/kernel/arch/x86/include/asm/ptrace.h:146:13: note: previous declaration of ‘syscall_trace_enter’ was here
/home/dhsung/android-x86/kernel/arch/x86/kernel/ptrace.c:1411:17: error: conflicting types for ‘syscall_trace_leave’
In file included from /home/dhsung/android-x86/kernel/arch/x86/include/asm/vm86.h:130:0,
                 from /home/dhsung/android-x86/kernel/arch/x86/include/asm/processor.h:10,
                 from /home/dhsung/android-x86/kernel/arch/x86/include/asm/thread_info.h:22,
                 from /home/dhsung/android-x86/kernel/include/linux/thread_info.h:53,
                 from /home/dhsung/android-x86/kernel/include/linux/preempt.h:9,
                 from /home/dhsung/android-x86/kernel/include/linux/spinlock.h:50,
                 from /home/dhsung/android-x86/kernel/include/linux/seqlock.h:29,
                 from /home/dhsung/android-x86/kernel/include/linux/time.h:8,
                 from /home/dhsung/android-x86/kernel/include/linux/timex.h:56,
                 from /home/dhsung/android-x86/kernel/include/linux/sched.h:57,
                 from /home/dhsung/android-x86/kernel/arch/x86/kernel/ptrace.c:8:
/home/dhsung/android-x86/kernel/arch/x86/include/asm/ptrace.h:147:13: note: previous declaration of ‘syscall_trace_leave’ was here
make[4]: *** [arch/x86/kernel/ptrace.o] 오류 1
make[3]: *** [arch/x86/kernel] 오류 2
make[2]: *** [arch/x86] 오류 2
make[1]: *** [sub-make] 오류 2
make[1]: Leaving directory `/home/dhsung/android-x86/kernel'
make: *** [out/target/product/generic_x86/kernel] 오류 2

https://patchwork.kernel.org/patch/1301031/

 

external/srec/tools/grxmlcompile/grxmlcompile.cpp:938:1:   required from here
external/srec/tools/thirdparty/OpenFst/fst/lib/cache.h:132:9: error: ‘SetState’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
external/srec/tools/thirdparty/OpenFst/fst/lib/cache.h:132:9: note: declarations in dependent base ‘fst::VectorFstBaseImpl<fst::CacheState<fst::GallicArc<fst::StdArc, (fst::StringType)0u> > >’ are not found by unqualified lookup
external/srec/tools/thirdparty/OpenFst/fst/lib/cache.h:132:9: note: use ‘this->SetState’ instead
external/srec/tools/thirdparty/OpenFst/fst/lib/cache.h:136:11: error: ‘SetState’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
external/srec/tools/thirdparty/OpenFst/fst/lib/cache.h:136:11: note: declarations in dependent base ‘fst::VectorFstBaseImpl<fst::CacheState<fst::GallicArc<fst::StdArc, (fst::StringType)0u> > >’ are not found by unqualified lookup
external/srec/tools/thirdparty/OpenFst/fst/lib/cache.h:136:11: note: use ‘this->SetState’ instead
make: *** [out/host/linux-x86/obj/EXECUTABLES/grxmlcompile_intermediates/grxmlcompile.o] 오류 1


http://review.android.git.linaro.org/#/c/1983/

 

frameworks/base/tools/aapt/AaptAssets.cpp:1386:41:   required from here
frameworks/base/include/utils/KeyedVector.h:193:31: error: ‘indexOfKey’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
frameworks/base/include/utils/KeyedVector.h:193:31: note: declarations in dependent base ‘android::KeyedVector<android::String8, android::sp<AaptGroup> >’ are not found by unqualified lookup
frameworks/base/include/utils/KeyedVector.h:193:31: note: use ‘this->indexOfKey’ instead
frameworks/base/include/utils/KeyedVector.h: In instantiation of ‘const VALUE& android::DefaultKeyedVector<KEY, VALUE>::valueFor(const KEY&) const [with KEY = android::String8; VALUE = android::sp<AaptDir>]’:
frameworks/base/tools/aapt/AaptAssets.cpp:1445:53:   required from here
frameworks/base/include/utils/KeyedVector.h:193:31: error: ‘indexOfKey’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
frameworks/base/include/utils/KeyedVector.h:193:31: note: declarations in dependent base ‘android::KeyedVector<android::String8, android::sp<AaptDir> >’ are not found by unqualified lookup
frameworks/base/include/utils/KeyedVector.h:193:31: note: use ‘this->indexOfKey’ instead
make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/AaptAssets.o] 오류 1


http://stackoverflow.com/questions/10171897/building-android-source-code


target Generated: libwebcore <= external/webkit/WebCore/xml/XMLHttpRequestUpload.idl
target Generated: libwebcore <= external/webkit/WebCore/xml/XMLSerializer.idl
target Generated: libwebcore <= external/webkit/WebCore/xml/XSLTProcessor.idl
target Generated: libwebcore <= external/webkit/WebCore/dom/make_names.pl
Unknown parameter a interfaceName for tags/attrs
make: *** [out/target/product/generic_x86/obj/STATIC_LIBRARIES/libwebcore_intermediates/WebCore/HTMLNames.h] 오류 255

http://forum.xda-developers.com/showthread.php?t=1610907


https://github.com/CyanogenMod/android_external_webkit/commit/1c88029b864c88cc32767eb8d1ffe13e95445af3


In file included from dalvik/vm/Dalvik.h:87:0,
                 from dalvik/vm/native/dalvik_system_Zygote.c:20:
dalvik/vm/oo/ObjectInlines.h: In function ‘dvmSetObjectArrayElement’:
dalvik/vm/oo/ObjectInlines.h:29:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
dalvik/vm/native/dalvik_system_Zygote.c: In function ‘setgroupsIntarray’:
dalvik/vm/native/dalvik_system_Zygote.c:172:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
dalvik/vm/native/dalvik_system_Zygote.c: In function ‘setrlimitsFromArray’:
dalvik/vm/native/dalvik_system_Zygote.c:192:19: error: storage size of ‘rlim’ isn’t known
dalvik/vm/native/dalvik_system_Zygote.c:200:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
dalvik/vm/native/dalvik_system_Zygote.c:204:9: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
dalvik/vm/native/dalvik_system_Zygote.c:215:9: warning: implicit declaration of function ‘setrlimit’ [-Wimplicit-function-declaration]
dalvik/vm/native/dalvik_system_Zygote.c:192:19: warning: unused variable ‘rlim’ [-Wunused-variable]
make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libdvm_intermediates/native/dalvik_system_Zygote.o] 오류 1

https://gist.github.com/alanorth/3158845


Notice file: system/core/libmincrypt/NOTICE -- out/host/linux-x86/obj/NOTICE_FILES/src//lib/libmincrypt.a.txt
Install: out/host/linux-x86/bin/mkbootimg
host C: mksdcard <= sdk/emulator/mksdcard/mksdcard.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
sdk/emulator/mksdcard/mksdcard.c:1:0: note: this is the location of the previous definition
host Executable: mksdcard (out/host/linux-x86/obj/EXECUTABLES/mksdcard_intermediates/mksdcard)
true
Notice file: sdk/emulator/mksdcard/NOTICE -- out/host/linux-x86/obj/NOTICE_FILES/src//bin/mksdcard.txt
Install: out/host/linux-x86/bin/mksdcard
host Prebuilt: mkuserimg.sh (out/host/linux-x86/obj/EXECUTABLES/mkuserimg.sh_intermediates/mkuserimg.sh)
Notice file: system/extras/ext4_utils/NOTICE -- out/host/linux-x86/obj/NOTICE_FILES/src//bin/mkuserimg.sh.txt
Install: out/host/linux-x86/bin/mkuserimg.sh
host Prebuilt: monkeyrunner (out/host/linux-x86/obj/EXECUTABLES/monkeyrunner_intermediates/monkeyrunner)
Install: out/host/linux-x86/bin/monkeyrunner
host C++: obbtool <= frameworks/base/tools/obbtool/Main.cpp
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
frameworks/base/tools/obbtool/Main.cpp:1:0: note: this is the location of the previous definition
cc1plus: all warnings being treated as errors
make: *** [out/host/linux-x86/obj/EXECUTABLES/obbtool_intermediates/Main.o] 오류 1



This happens with commit: a5158b31d97e25832d778a41a31df6ece0fc627e[Ubuntu 11.10 x86_64 running Linux 3.0.0-12-generic]Fix is same build/core/combo/HOST_linux-x86.mk:    -HOST_GLOBAL_CFLAGS  = -D_FORTIFY_SOURCE=0     HOST_GLOBAL_CFLAGS  = -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0[linenumber 59] ------------There are much of:  warning: _FORTIFY_SOURCE redefinedBut this frameworks/base/tools/obbtool/Main.cpp is compiled with -Werror 


http://codewalkerster.blogspot.kr/2011/11/ubuntu-1110-androidgingerbread-build.html

https://code.google.com/p/android/issues/detail?id=20795

 

위의 빌드 에러 다 처리하고 빌드하는데 하루종일 걸린것 같다. (실은 자기 전에 빌드 돌렸는데, 빌드 에러나서 계속 실행되지 않았던거 -_-; 자고 일어나서 화면을 보니 하루만에 빌드될것이 빌드가 되지 않아 울뻔했었다.

회사에서 빌드 로그 쭉보면서 다른 컴퓨터를 통해 업무보느라 정신이 거의 어질어질했음 -_-

ps. 안드로이드 빌드 완료될때는 기분이 좋으나, 빌드 에러 날때는 짜증 ㅠㅠ


Web Developer. My native language is Korean(한국어) My hobby is Learning Language(English,中國語[繁體中文/简体中文],日本語) Interested Mobile & Web #Unicode #CJK #文字 #漢字 #이상한모임
저는 초등학교 3학년때 역삼동 아부지 회사에서 접해보았던 Netscape Browser를 보고 인터넷에 빠져들었습니다. Web에 대해 관심이 많으며 음악을 좋아합니다.
블로그 : http://blog.studioego.info
Twitter: @studioego
이 글은 StudioEgo 가 작성하였습니다.

댓글을 달아 주세요