build android adb for arm processor

匿名 (未验证) 提交于 2019-12-03 02:52:02

问题:

I want to use Android ADB tool on ARM platform. One of the commands in the build script is:

arm-eabi-g++ -I build/libs/host/include/host -I build/libs/host/include -I build/libs/host -I out/host/linux-arm/obj/STATIC_LIBRARIES/libhost_intermediates  -I dalvik/libnativehelper/include/nativehelper -I system/core/include -I hardware/libhardware/include -I hardware/libhardware_legacy/include -I hardware/ril/include -I dalvik/libnativehelper/include -I frameworks/base/include -I frameworks/base/opengl/include -I frameworks/base/native/include -I external/skia/include -I tools/include -I out/host/linux-arm/obj/include -I prebuilt/ndk/android-ndk-r5b/platforms/android-9/arch-arm/usr/include -c -fno-exceptions -Wno-multichar -fPIC -include system/core/include/arch/linux-arm/AndroidConfig.h -D_FORTIFY_SOURCE=0 -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -O2 -g -fno-strict-aliasing -DNDEBUG -UDEBUG -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -Wsign-promo -DNDEBUG -UDEBUG -MD -o out/host/linux-arm/obj/STATIC_LIBRARIES/libhost_intermediates/pseudolocalize.o    build/libs/host/pseudolocalize.cpp 

I have made sure I have the latest ndk-r5b installed, which is supposed to resolve the STL problem. However, I am still getting the following error:

In file included from build/libs/host/pseudolocalize.cpp:1: build/libs/host/include/host/pseudolocalize.h:4:18: error: string: No such file or directory In file included from build/libs/host/pseudolocalize.cpp:1: build/libs/host/include/host/pseudolocalize.h:6: error: 'string' in namespace 'std' does not name a type build/libs/host/pseudolocalize.cpp: In function 'const char* pseudolocalize_char(char)': build/libs/host/pseudolocalize.cpp:61: error: 'NULL' was not declared in this scope build/libs/host/pseudolocalize.cpp: At global scope: build/libs/host/pseudolocalize.cpp:71: error: 'string' does not name a type 

Does anyone know how to fix this problem? BTW the building of the intel version of adb works fine by following this link:

http://lackingrhoticity.blogspot.com/2010/02/how-to-build-adb-android-debugger.html

回答1:

pseudolocalize.cpp is not needed for adb. And NDK toolchain is intended to build with bionic(Android libc). adb requires glibc(GNU libc) to build.

I created a Makefile to compile adb for Linux/ARM. This Makefile makes statically linked adb executable binary for Linux/ARM, thus it works on Android/ARM as well.

How to make.

  1. Install Sourcery G++ Lite for ARM and GNU Make.
  2. Download "Android source code".
  3. Save Makefile as system/core/adb/Makefile.
  4. cd system/core/adb; make.


回答2:

If you need to build the ADB (version 1.0.31) for ARM take a look here.

The repository contains an all-in-one build script and also a pre-compiled binary for ARM.



回答3:

I see the post is quite old, anyway it helped me. I did not found

"Sourcery G++ Lite for ARM and GNU Make."

But manage to build/run on/for my ARMv7, following the other steps with gcc 4:4.6.3-1ubuntu5

  1. N/A
  2. Download "Android source code".
  3. Save Makefile as system/core/adb/Makefile. 3b. Edit Makefile to CC= gcc and LD= gcc
  4. cd system/core/adb; make.


易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!