我目前正在为熊猫编写AndroidLinaroBuild11.11(阶段-熊猫)。
在构建过程中,Android用主机gcc编译器编译了一些工具。在我的Linux 12 (基于Ubuntu-11.10)上,默认情况下我安装了gcc-4.6。
我构建了Android,一切都很好,但是启动任何应用程序都会导致分割错误(logcat中的信号11 )。
然后我了解到Linaro使用gcc-4.5,而不是4.6版本构建了这个版本。我用apt-get安装的。我删除了/目录,完全重新构建了Android。
编译运行良好,但链接器侮辱了我:
g++-4.5 -Wl,-rpath-link=out/target/product/pandaboard/obj/lib -Wl,-rpath,\$ORIGIN/../lib -Lout/host/linux-x86/obj/lib -Wl,--no-undefined -m32 out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp.o -Wl,--whole-archive -Wl,--no-whole-archive out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/libhost.a -o out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp
g++-4.5 -Wl,-rpath-link=out/target/product/pandaboard/obj/lib -Wl,-rpath,\$ORIGIN/../lib -Lout/host/linux-x86/obj/lib -Wl,--no-undefined -m32 out/host/linux-x86/obj/EXECUTABLES/mkbootfs_intermediates/mkbootfs.o -Wl,--whole-archive -Wl,--no-whole-archive -o out/host/linux-x86/obj/EXECUTABLES/mkbootfs_intermediates/mkbootfs
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.5.4/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.5.4/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.5.4/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.5.4/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
collect2: ld returned 1 exit status链接器获得了gcc-4.5的64位库,尽管它可能用于32位版本。到目前为止,以下是我尝试过的,但没有成功的事情:
最后,我被告知要安装gcc-4.5-multilib和g+-4.5-multilib.它起了作用,而且建造得更深入了。我启动熊猫,但应用程序(如com.android.launcher)仍未启动。我知道这是一个假设,但我认为这个分段错误与编译器有某种联系。
我的问题很简单:
谢谢大堆。
发布于 2012-10-24 15:49:14
使用gdb。要求:
#是目标shell,尽管不是强制性的。
$是主机外壳
LOCAL_CFLAGS += -g# gdbserver :5039 </system/bin/executable>
(或)
# gdbserver :5039 --attach <pid>$ adb forward tcp:5039 tcp:5039$ gdbclient :5039 <executable>如果您与gdbclient搏斗,请检查build/envsetup.sh函数定义的位置:
$ type gdbclient
添加详细的-v选项可能会有所帮助。另外,如果您的可执行文件不在system/bin中,那么您肯定需要修改build/envsetup.sh,因为它是硬编码的。
更多的信息可以找到这里。
https://stackoverflow.com/questions/10422681
复制相似问题