Bionic (software)

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Bionic
Developer(s) Open Handset Alliance
Initial release September 23, 2008; 5 years ago (2008-09-23)[1]
Operating system Android
Type C standard library
License 3-clause BSD licence

The Bionic libc is a derivation of the BSD's standard C library code that was originally developed by Google for their Android operating system based on the Linux kernel. Bionic has several major features specific to the Linux kernel, and its development continues independently of other Android's source code bases.

Overview[edit]

Publicly stated goals for Bionic are the following:[2][3]

  • BSD license is a non-copyleft license and Google wished to isolate Android applications from the effects of both the GPL and the LGPL:
    • Android is based on the Linux kernel, which is subject to the GNU General Public License (GPL) version 2.
    • The most widespread standard C libraries for the Linux kernel are the GNU C Library and uClibc, which are both subject to the GNU Lesser General Public License (LGPL); in contrast to the GPL, the LGPL explicitly allows for dynamic linking but it does not allow static linking of proprietary software.
  • Small size: Bionic is much smaller than the GNU C Library (glibc) and somewhat smaller than uClibc.
  • Speed: Bionic is designed for CPUs at relatively low clock frequencies.

The recommended way of using Bionic is with the Android Native Development Kit (NDK).

Features and limitations[edit]

Bionic has several restrictions compared to glibc, often derived from the fact that Bionic is a library specifically designed for Android.[2][4][5] Some of the limitations include:

  • Bionic does not include C++ exception handling, probably because as Android applications being mainly coded in Java, exceptions in Android programs are expected to be handled there
  • Bionic does not include the Standard Template Library, and developers must include it manually if they need it
  • Bionic does not include wide character support
  • Some functions within Bionics POSIX and system call headers are stubs or wrappers for Android-specific behavior, causing unintended behavior in some instances.[2][5][6][7]
  • As of Android Jelly Bean MR1 (4.2), bionic builds used in Android include support for glibc's FORTIFY_SOURCE,[8] which is a feature where unsafe string and memory functions (such as strcpy() strcat() and memcpy()) include checks for buffer overruns when buffer sizes can be determined at compile time. This feature is only available for applications compiled with gcc for ARM processors.[9]

See also[edit]

References[edit]

  1. ^ "Announcing the Android 1.0 SDK, release 1". September 9, 2008. Retrieved September 21, 2012. 
  2. ^ a b c Burnette, Ed (June 4, 2008). "Patrick Brady dissects Android". ZDNet. 
  3. ^ Turner, David (2009-02-07). "Questions about Bionic". "The name "Bionic" comes from the fact that it is part-BSD and part-Linux: its source code consists in a mix of BSD C library pieces with custom Linux-specific bits used to deal with threads, processes, signals and a few others things." 
  4. ^ Devos, Devos (2014). "Bionic vs Glibc report - Master thesis". Retrieved 2014-03-22. 
  5. ^ a b Gentry, Denton (2008-11-28). "The Six Million Dollar LibC". 
  6. ^ "Not working on Xoom/Android 3.0 Honeycomb". 2011-04-15. 
  7. ^ "getmntent() is not implemented in bionic/libc/bionic/stubs.c". 2011-02-25. 
  8. ^ "Jelly Bean". Android Developers. android.com. Retrieved 2013-12-27. 
  9. ^ "Android 4.2 and FORTIFY_SOURCE". Android Security Discussions. groups.google.com. Retrieved 2013-12-27. 

External links[edit]