Update Android Bazel build support in BUILD.toplevel.

Newer versions of Bazel use a different setting for the crosstool_top
flag, depending on the NDK toolchain in use. This change detects these
crosstools and builds them using Android flags.

Fixes: 180083900
Change-Id: I937d18e53d72b2911e1c472adbce65282d31885d
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/45564
Commit-Queue: Justin Paupore <jpaupore@google.com>
Commit-Queue: Adam Langley <agl@google.com>
Reviewed-by: Adam Langley <agl@google.com>
grpc-202302
Justin Paupore 4 years ago committed by CQ bot account: commit-bot@chromium.org
parent c02c19e0d8
commit a99308fa91
  1. 28
      util/BUILD.toplevel

@ -54,10 +54,30 @@ config_setting(
)
config_setting(
name = "android",
name = "android_legacy",
values = {"crosstool_top": "//external:android/crosstool"},
)
config_setting(
name = "android_stlport",
values = {"crosstool_top": "@androidndk//:toolchain-stlport"},
)
config_setting(
name = "android_libcpp",
values = {"crosstool_top": "@androidndk//:toolchain-libcpp"},
)
config_setting(
name = "android_gnu_libstdcpp",
values = {"crosstool_top": "@androidndk//:toolchain-gnu-libstdcpp"},
)
config_setting(
name = "android_default",
values = {"crosstool_top": "@androidndk//:default_crosstool"},
)
posix_copts = [
# Assembler option --noexecstack adds .note.GNU-stack to each object to
# ensure that binaries can be built with non-executable stack.
@ -137,7 +157,11 @@ cc_library(
linkopts = select({
# Android supports pthreads, but does not provide a libpthread
# to link against.
":android": [],
":android_legacy": [],
":android_stlport": [],
":android_libcpp": [],
":android_gnu_libcpp": [],
":android_default": [],
":mac_x86_64": [],
":windows_x86_64": ["-defaultlib:advapi32.lib"],
"//conditions:default": ["-lpthread"],

Loading…
Cancel
Save