1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# The Android toolchain, built.
#
# There is no Android graph in this repo yet — the third-party crates have no
# Android platform in reindeer.toml, so nothing that depends on them can be
# configured for the device — so these are what keep the toolchain honest in
# the meantime. One C object, compiled by the NDK's clang against bionic's
# headers, and one Rust one, compiled against the device's libstd and linked
# by that same clang. Both configured for the device, neither shipping.
#
# just buck build toolchains//selftest:abi-android
# just buck build toolchains//selftest:std-android
cxx_library(
name = "abi",
srcs = ["abi.c"],
visibility = ["PUBLIC"],
)
# The target configuration moves; the execution platform does not. Building
# `:abi` directly would compile it for the host, where it is meant to fail.
configured_alias(
name = "abi-android",
actual = ":abi",
platform = "root//platforms:android-arm64",
visibility = ["PUBLIC"],
)
rust_library(
name = "std",
srcs = ["abi.rs"],
crate_root = "abi.rs",
edition = "2021",
# Shared, so the link runs: a rlib would prove rustc found the target
# libstd and nothing about whether the linker can produce a device object.
preferred_linkage = "shared",
visibility = ["PUBLIC"],
)
configured_alias(
name = "std-android",
actual = ":std",
platform = "root//platforms:android-arm64",
visibility = ["PUBLIC"],
)
|