User:AtilA

From MozillaWiki
Jump to navigation Jump to search

Using a fixed version of libc++ LLVM port

There's a known problem within the binaries of libc++ LLVM port provided with NDK r10e. They don't unwind properly so our tests are failing every time we want to print the stack trace after some assertion fails.

This problem was already fixed in the LLVM upstream repository, so it will be finally fixed for us once the newest NDK r10f comes out, but as we don't know how long it will take to be released we need a temporary solution in order to compile Fennec/B2GDroid with this libc++ port.

I'm going to explain how to build a fixed version of libc++ LLVM port and where the binaries should be placed into the NDK tree in a step by step simple guide.

In summary: We will build libc++ from upstream sources and overwrite the binaries with the ones located into ~/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libs/*/

1. - Download latest NDK sources from the repositories.

$ mkdir master-ndk && cd master-ndk

$ repo init -u https://android.googlesource.com/platform/manifest -b master-ndk

$ repo sync

2. - Build the libc++ LLVM port

$ ndk/sources/cxx-stl/llvm-libc++/build.py

3. - Overwrite all the new compiled libraries with the ones in your NDK r10e tree

$ cp out/ndk/libcxx-libs-armeabi* android-ndk-r10e/

$ cd android-ndk-r10e

$ tar xvfx libcxx-libs-armeabi-g.tar.bz2

$ tar xvfx libcxx-libs-armeabi-v7a-g.tar.bz2

$ tar xvfx libcxx-libs-armeabi-v7a-hard-g.tar.bz2


That's all!!!