You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I am trying to build bazel/example:main with ndk r25 tool chain for android api level 31 . I am using bazel version 6.0.0 . When I try to compile the the target I get linker error for pthread library. In my understanding ndk does not have a separate pthread library.
I am suspecting :
/* Define to 1 if you have the `pthread' library (-lpthread). */
Are there any specific instructions to build for android using ndk for bazel ?
Please guide me on how to fix this issue if it has been seen earlier. @sergiud
I have added .bazelrc file in the root of this project in parallel to WORKSPACE file to allow ndk build configuration
build --fat_apk_cpu=x86_64,arm64-v8a,armeabi-v7a build --host_crosstool_top=@bazel_tools//tools/cpp:toolchain build --experimental_repo_remote_exec test --fat_apk_cpu=x86_64,arm64-v8a,armeabi-v7a test --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
build --spawn_strategy=standalone
I have also appended code to workspace file to accomodate ndk rules like this :
android_sdk_repository(
name = "androidsdk",
api_level = 31,
)
android_ndk_repository(
name = "androidndk",
)
The text was updated successfully, but these errors were encountered:
This is because glog depends on "@com_github_gflags_gflags//:gflags" which links pthread. Instead, Android targets should depend on "@com_github_gflags_gflags//:gflags_nothreads".
Hello,
I am trying to build bazel/example:main with ndk r25 tool chain for android api level 31 . I am using bazel version 6.0.0 . When I try to compile the the target I get linker error for pthread library. In my understanding ndk does not have a separate pthread library.
I am suspecting :
glog/bazel/glog.bzl
Line 73 in f545ff5
and
glog/src/config.h.cmake.in
Line 34 in f545ff5
Are there any specific instructions to build for android using ndk for bazel ?
Please guide me on how to fix this issue if it has been seen earlier.
@sergiud
I have added .bazelrc file in the root of this project in parallel to WORKSPACE file to allow ndk build configuration
build:android --crosstool_top=//external:android/crosstool
build:android --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
build:android_arm --config=android
build:android_arm --cpu=armeabi-v7a
build:android_arm --fat_apk_cpu=armeabi-v7a
build:android_arm64 --config=android
build:android_arm64 --cpu=arm64-v8a
build:android_arm64 --fat_apk_cpu=arm64-v8a
build:android_x86 --config=android
build:android_x86 --cpu=x86
build:android_x86 --fat_apk_cpu=x86
build:android_x86_64 --config=android
build:android_x86_64 --cpu=x86_64
build:android_x86_64 --fat_apk_cpu=x86_64
build --fat_apk_cpu=x86_64,arm64-v8a,armeabi-v7a
build --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
build --experimental_repo_remote_exec
test --fat_apk_cpu=x86_64,arm64-v8a,armeabi-v7a
test --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
build --spawn_strategy=standalone
I have also appended code to workspace file to accomodate ndk rules like this :
android_sdk_repository(
name = "androidsdk",
api_level = 31,
)
android_ndk_repository(
name = "androidndk",
)
The text was updated successfully, but these errors were encountered: