Fix NDK usage of libgcc.a when building shared libraries

The main idea is that libgcc.a should appear after object files and
static libraries but before depending shared libraries. This willl
force the linker to copy the libgcc.a functions required by the
generated library into the target binary, instead of relying on
what's available in libc.so and others.

This ensures maximum portability, and prevent problems in the future
when we change the toolchain, which translates to different libgcc.a
functions embedded in libc.so and other exposed native libraries.

However, this will make also generated shared libraries bigger, because
the compiler insists on generating code that depends on a bunch of C++
support functions (even when building from C sources). An increase of
about 8KB per shared library is expected.
2 files changed