2013-11-21 30 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的文件夾並在那裏編譯。編譯成功,但執行期間發生錯誤。放棄。

相關問題