title: Android Static Linking vs Dynamic Linking against glibc
body: <p>I have been cross-compiling some Linux tools (and some of my own C code) to Android and one of the challenges that I face is that Android's libc has some missing/stripped components and I end up patching my code to make it work with Android's libc (for e.g. a problem like this <a href="http://credentiality2.blogspot.com/2010/08/compile-ncurses-for-android.html" rel="nofollow noreferrer">http://credentiality2.blogspot.com/2010/08/compile-ncurses-for-android.html</a>)</p>
  
  <p>Q1 : How do I go about statically linking against glibc (and other dependencies) while cross-compiling with the arm toolchain (or ndk-build)? </p>
  
  <p>Q2 : Is it a good idea to statically link against glibc for binaries for Android? Should I expect anything to break if I start statically linking? Are there any performance/memory issues? </p>
  
  <p>I understand most of the pros and cons of static vs dynamic linking from here -
  <a href="https://stackoverflow.com/questions/2095363/c-application-should-i-use-static-or-dynamic-linking-for-the-libraries">C++ application - should I use static or dynamic linking for the libraries?</a> and
  <a href="https://stackoverflow.com/questions/1993390/static-linking-vs-dynamic-linking">Static linking vs dynamic linking</a></p>
  
  <p>So I wish to know if I should be statically linking glibc for Android when cross-compiling binaries.</p>