I haven't noticed any problems building boost for Android with the NDK,
I honestly have no idea why I see so many people asking how to do it, or
patch sets or whatever.
I'm using gcc-4.9 and std=c++14 on linux x64 targeting armv7. I package
the toolset I want (android 15, gcc-4.9) and pass that sysroot in the
CXXFLAGS, I tend not to interfere with the build system of boost or
android very much, preferring to drive everything from cmake (for my own
projects).
What problems have you seen?
The NDK is moving entirely to clang, the next release will see gcc
deprecated, so I'll have to have a play with moving over to clang, but
in my experience, everything I do works equally well on clang for armv7,
armv8 and x64.
The only problem I remember having is thread locals on iOS targets, but
my memory is short, and it only takes a few lines of code to emulate
that for most purposes.
If you explain what problems you've seen, which libraries, toolsets and
command lines, perhaps you'll trigger a memory of a problem I've solved.
I can give you more details of my configuration on the weekend, if required.
As a sidenote, I'm hoping to bring up a boost/clang/linux/armv8 build
bot if and when my Pine64 arrives and I get Ubuntu/Debian running on it
(by April if all goes well). I have no idea how quickly it will cycle
though, my current x64 tests take around 16 hours for gcc-4.9, gcc-5.2
and clang-3.7, I'll probably have to drop gcc-4.9. I had to give up on
my regular sanitizer builds on x64 as they just take too long and there
seemed to be very little interest. Unfortunately I don't have dedicated
machines to run the tests.
Ben
I think you need to put the relevant path there, it should be an
absolute path.
> using clang : android :
This toolset is called clang-android, but you told b2 to use gcc-android.
> $(androidNDKRoot)/toolchains/llvm-3.6/prebuilt/windows-x86_64/bin/clang++ :
> <compileflags>--sysroot=$(androidNDKRoot)/platforms/android-21/arch-arm
> <compileflags>-Os
-Os will be ignored because you specified -O2 below.
> <compileflags>-fno-strict-aliasing
> <compileflags>-O2
> <compileflags>-DNDEBUG
> <compileflags>-g
> <compileflags>-I$(androidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.9/include
> <compileflags>-I$(androidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include
Remove the above two lines, since you want to use libc++, not libstdc++.
If clang can't find the libc++ headers, then specify the path to libc++.
> <compileflags>-D__GLIBC__
> <compileflags>-D__ANDROID__
> <compileflags>-D_GLIBCXX__PTHREADS
> <compileflags>-D__arm__
> <compileflags>-D_REENTRANT
Your CXXFLAGS also specify flags for include paths for libstdc++, and
platforms/android-9, but your toolset specifies the sysroot as
platforms/android-21.
You should try invoking b2 again with the correct toolset name and
without any CXXFLAGS, since the toolset specifies them.