Android toolchain and bionic libc

Source: Internet
Author: User

The toolchain used by Android (that is, the cross-compilation tool chain) can be downloaded from the following URL:

Http://android.kernel.org/pub/android-toolchain-20081019.tar.bz2. If you download the complete Android project source code, you can find the cross-compilation tool under the "<your_android>/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin" directory, for example, Android arm-eabi-gcc-4.2.1.

Android does not use glibc as the C library, but uses bionic libc developed by Google. Its official toolchain is based on Bionic libc rather than glibc. This makes it difficult to use or port other toolchains for Android: before Google releases the official toolchain for Android, most Android enthusiasts use the toolchain inHttp://www.codesourcery.com/gnu_toolchains/arm/download.htmlDownload a general toolchain, which is used to compile and transplant the android Linux kernel is feasible, because the kernel does not require the C library, but when developing Android applications, it is difficult to directly use or transplant other toolchains. Applications compiled by other toolchains can only run in the android simulator using static compilation, this is obviously unacceptable in actual development. Currently, we have not seen any documents indicating that other cross compilers have been successfully transplanted to compile Android applications.

Compared with glibc, bionic libc has the following features:

-Use BSD license instead of glibc GPL license;

-The size is only about 200 kb, which is about half smaller than glibc and faster than glibc;

-Implements a smaller and faster pthread;

-Provides important functions required by Android, such as "getprop" and "logi;

-POSIX standards are not fully supported, such as C ++ exceptions and wide chars;

-Libthread_db and libm implementations are not provided.

 

In addition, some other binary tools used in Android are also special:

-When loading a dynamic library,/system/bin/linker is used instead of common/lib/lD. So;

-The prelink tool is not a commonly used prelink but a prelink. Its source code is located in "<your_android>/build/tools/Apriori"

-Strip tool does not use commonly used strip, that is, the arm-Eabi-strip under the "<your_android>/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin" directory, it is located in <your_android>/out/host/linux-x86/bin/.

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.