When I\'m compiling Android 5.1.1, I get dozens of errors like this:
...
...
...
libnativehelper/JniInvocation.cpp:1
Problems comes from an incompatible change in binutils: some section were added. Some build platform have the new binutils and android build tree have old one. The bug comes from clang invocation variables definition. These doesn't tell clang to use the provided build chain. Then clang uses the native build platform binutils (here /usr/bin/as instead the prebuilts provided as). Then the fix imply applying the patch pointed by mysticTot and then removing all binaries produced by the toolchain (according to where the error appears this could change but removing all STATIC_LIBRARIES/SHARED_LIBRARIES/EXECUTABLES etc dirs in out tree should do it). Also remove the ccache cache (as it stores .o) then rebuild. Fix provided by Ov3r1oad consisting in replacing the prebuilt toolchain ld by the native ld is not a solution, just a workaround and could be dangerous (mixing section number is not good). Hope it willl help.