2013-11-21 29 views
0

我想实现我自己的精灵链接器。所以我学习了/ binoic/linker的代码。 我将/ binoic/linker下的代码复制到我的项目中,并更新了我的Android.mk,其中主要修改包括路径,因为链接器依赖于libc。如何用AOSP源创建我自己的NDK程序?

但由于大量奇怪的链接错误,我无法构建我的项目。乙

我Android.mk的包括路径:

# We need to access Bionic private headers in the linker. 
LOCAL_CFLAGS += -I/media/android/androidSrc/master/bionic/libc/ 
LOCAL_CFLAGS += -I/media/android/androidSrc/master/bionic/libc/include/ 
LOCAL_CFLAGS += -I/media/android/androidSrc/master/bionic/libc/arch-arm/include/ 

一些编译错误的:

[email protected]:/media/android/WorkSpace/bep$ ndk-build 
[armeabi] Compile++ thumb: testpacker <= bep.cpp 
In file included from /media/android/androidSrc/master/bionic/libc/include/unistd.h:34:0, 
       from /media/android/androidSrc/master/bionic/libc/include/fcntl.h:35, 
       from jni/bep.cpp:5: 
/media/android/androidSrc/master/bionic/libc/include/sys/select.h:40:0: warning: "FD_SETSIZE" redefined [enabled by default] 
/media/android/android-ndk-r9b/platforms/android-8/arch-arm/usr/include/linux/time.h:37:0: note: this is the location of the previous definition 
/media/android/androidSrc/master/bionic/libc/include/sys/select.h:41:0: warning: "NFDBITS" redefined [enabled by default] 
/media/android/android-ndk-r9b/platforms/android-8/arch-arm/usr/include/linux/time.h:35:0: note: this is the location of the previous definition 
/media/android/androidSrc/master/bionic/libc/include/sys/select.h:42:0: warning: "__FDSET_LONGS" redefined [enabled by default] 
/media/android/android-ndk-r9b/platforms/android-8/arch-arm/usr/include/linux/posix_types.h:24:0: note: this is the location of the previous definition 
/media/android/androidSrc/master/bionic/libc/include/sys/select.h:48:0: warning: "__FDELT" redefined [enabled by default] 
/media/android/android-ndk-r9b/platforms/android-8/arch-arm/usr/include/linux/posix_types.h:27:0: note: this is the location of the previous definition 
/media/android/androidSrc/master/bionic/libc/include/sys/select.h:49:0: warning: "__FDMASK" redefined [enabled by default] 
/media/android/android-ndk-r9b/platforms/android-8/arch-arm/usr/include/linux/posix_types.h:30:0: note: this is the location of the previous definition 
/media/android/androidSrc/master/bionic/libc/include/sys/select.h:52:0: warning: "FD_ZERO" redefined [enabled by default] 
/media/android/android-ndk-r9b/platforms/android-8/arch-arm/usr/include/linux/time.h:41:0: note: this is the location of the previous definition 
/media/android/androidSrc/master/bionic/libc/include/sys/select.h:62:0: warning: "FD_CLR" redefined [enabled by default] 
/media/android/android-ndk-r9b/platforms/android-8/arch-arm/usr/include/linux/time.h:39:0: note: this is the location of the previous definition 
/media/android/androidSrc/master/bionic/libc/include/sys/select.h:63:0: warning: "FD_SET" redefined [enabled by default] 
/media/android/android-ndk-r9b/platforms/android-8/arch-arm/usr/include/linux/time.h:38:0: note: this is the location of the previous definition 
/media/android/androidSrc/master/bionic/libc/include/sys/select.h:64:0: warning: "FD_ISSET" redefined [enabled by default] 
/media/android/android-ndk-r9b/platforms/android-8/arch-arm/usr/include/linux/time.h:40:0: note: this is the location of the previous definition 
In file included from jni/bep.cpp:2:0: 
/media/android/android-ndk-r9b/platforms/android-8/arch-arm/usr/include/jni.h:235:68: error: expected ';' at end of member declaration 
/media/android/android-ndk-r9b/platforms/android-8/arch-arm/usr/include/jni.h:235:70: error: '__NDK_FPABI__' does not name a type 
/media/android/android-ndk-r9b/platforms/android-8/arch-arm/usr/include/jni.h:236:73: error: expected ';' at end of member declaration 
/media/android/android-ndk-r9b/platforms/android-8/arch-arm/usr/include/jni.h:236:75: error: '__NDK_FPABI__' does not name a type 

所以,如果我想使用AOSP的源在我的项目,如何解决链接错误?

回答

0

我试图把我的代码放入AOSP的文件夹并在那里编译。编译成功,但执行期间发生错误。放弃。

相关问题