2015-03-02 58 views
0

我試圖建立GDB我也從這裏檢查了來源:建立GDB的Android

https://secure-web.cisco.com/1gNMaTaLSpyPf04-64vyJyKpMnhYszFwToxEd5acy6VS3P271v2Vw2kWu-o5O16GAU92fTpsG5ezF48gddoDV7Adx8PaRyVUyENTYoGhf4DAL5SCpsboaD9mL8rtLqTcK7yirl321lqD9Cfnoz5vju88CQIffq80iTEn4g5SSY7g/https%3A%2F%2Fandroid.googlesource.com%2Ftoolchain%2Fgdb.git

我使用我用它來編譯我的NDK應用程序添加bin文件夾相同的工具鏈我的道路,並拼命地跑的配置腳本:

的./configure --host =在arm-linux的-androideabi

我得到這個生成錯誤:

.././libiberty/getpagesize.c:64:1:錯誤: '爲getpagesize' /home/xxxxx/android-ndk/arm_a14_tools/bin/../sysroot/usr/include/unistd.h的重新定義: 174:23:注: '爲getpagesize' 以前的定義在這裏 的Makefile:679:配方目標 'getpagesize.o' 失敗 化妝[2]:*** [getpagesize.o]錯誤1 你有什麼想法?

回答

0

我遇到了這一點。我發現了兩個解決方案。

1 diff --git a/libiberty/configure b/libiberty/configure 
index d8890a1..720dc5e 100755 
--- a/libiberty/configure 
+++ b/libiberty/configure 
@@ -6248,6 +6248,12 @@ if test -z "${setobjs}"; then 

    case "${host}" in 

+ *-*-android*) 
+ # On android, getpagesize is defined in unistd.h as a static inline 
+ # function, which AC_CHECK_FUNCS does not handle properly. 
+ ac_cv_func_getpagesize=yes 
+ ;; 
+ 
    *-*-mingw32*) 
    # Under mingw32, sys_nerr and sys_errlist exist, but they are 
    # macros, so the test below won't find them. 
diff --git a/libiberty/configure.ac b/libiberty/configure.ac 
index 868be8e..e21e3aa 100644 
--- a/libiberty/configure.ac 
+++ b/libiberty/configure.ac 
@@ -600,6 +600,12 @@ if test -z "${setobjs}"; then 

    case "${host}" in 

+ *-*-android*) 
+ # On android, getpagesize is defined in unistd.h as a static inline 
+ # function, which AC_CHECK_FUNCS does not handle properly. 
+ ac_cv_func_getpagesize=yes 
+ ;; 
+ 
    *-*-mingw32*) 
    # Under mingw32, sys_nerr and sys_errlist exist, but they are 
    # macros, so the test below won't find them. 

參考:

#if 0 
static __inline__ int getpagesize(void) { 
    extern unsigned int __page_size; 
    return __page_size; 
} 
#endif 

Refercence:http://permalink.gmane.org/gmane.comp.gdb.devel/33166

https://patchwork.ozlabs.org/patch/541034/

2作爲一個快速修復劈暫時在unistd.h中註釋出部