-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong Android NDK libcpp include path #3641
Comments
This seems to have been a change between R12 and R13. |
@renning22 , can you give an example of a header that cannot be found and a full bazel command line? |
I have the same issue. All standard C++ headers are not found. As Ning told, I verified the include dir is set wrong in bazel-myproject/external/androidndk/BUILD.bazel. I used this command to build: bazel build my_build_rule --cpu=armeabi-v7a --crosstool_top=@androidndk//:toolchain-libcpp --host_crosstool_top=@bazel_tools//tools/cpp:toolchain |
workaround: @androidndk//:toolchain-stlport and @androidndk//:toolchaingnu-libstdcpp are correct in bazel 0.5.4. Working on fixing @androidndk//:toolchain-libcpp now. |
Same issue here when compiling gRPC with Bazel and NDK. Using |
gnu-libstdcpp for android doesn't implement many basic standard library features correctly. It's not even supported by android anymore as far as I know. Consequently, it's very difficult to have shared libraries between android and other platforms until this bug is fixed, so my project is stuck using cmake just for android. Is there a workaround that lets us use the default standard library? |
Same issue here, a few C++11 headers cannot be found when building using I got it to build by manually changing the include paths in the build file from the I could try making the changes upstream with some guidance (I'm new to Android and Bazel). |
|
Root cause: generated BUILD.bazel for r13 is incorrect.
|
Is there something that can be patched in to fix that then? |
fix is incoming here: https://bazel-review.googlesource.com/c/bazel/+/40712 The patchdiffs on Gerrit are a little bit wonky, however. |
Hi all, the fix for this is in master. Please feel free to try it out and let me know if you still face problems - thanks! |
If possible, provide a minimal example to reproduce the problem:
Build with --crosstool_top=@androidndk//:toolchain-libcpp, C++ headers can not be found.
I guess it's caused by wrong "-isystem" paths.
Bazel sets "external/androidndk/ndk/sources/cxx-stl/llvm-libc++/libcxx/include" but it should be "external/androidndk/ndk/sources/cxx-stl/llvm-libc++/include". (I inspected with NDK r13/r15.)
Environment info
Operating System:
Ubuntu 14.04
Bazel version (output of
bazel info release
):0.5.2 (also tried with 0.4.5)
The text was updated successfully, but these errors were encountered: