gpt4 book ai didi

android - 构建GDB android

转载 作者:太空宇宙 更新时间:2023-11-04 03:44:03 25 4
gpt4 key购买 nike

我正在尝试构建 GDB,并且我已经从这里查看了源代码:

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”的配方失败make[2]: *** [getpagesize.o] 错误 1你有什么想法吗?

最佳答案

我也遇到过这个。我找到了两个解决方案。

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.

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

2 作为快速修复黑客暂时注释掉该部分在unistd.h中:

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

引用号:http://permalink.gmane.org/gmane.comp.gdb.devel/33166

关于android - 构建GDB android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28816577/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com