blob: 5ef9da3517c8486c03469ef9859d6c684b7e0e16 [file] [log] [blame]
Matthew Maureraa666892019-11-07 12:22:44 -08001// Sysroot Libraries
Bob Badour1949ff32021-02-12 17:18:18 -08002package {
3 default_applicable_licenses: ["prebuilts_rust_license"],
4}
5
6// Added automatically by a large-scale-change that took the approach of
7// 'apply every license found to every target'. While this makes sure we respect
8// every license restriction, it may not be entirely correct.
9//
10// e.g. GPL in an MIT project might only apply to the contrib/ directory.
11//
12// Please consider splitting the single license below into multiple licenses,
13// taking care not to lose any license_kind information, and overriding the
14// default license using the 'licenses: [...]' property on targets as needed.
15//
16// For unused files, consider creating a 'fileGroup' with "//visibility:private"
17// to attach the license to, and including a comment whether the files may be
18// used in the current project.
19// See: http://go/android-license-faq
20license {
21 name: "prebuilts_rust_license",
22 visibility: [":__subpackages__"],
23 license_kinds: [
24 "SPDX-license-identifier-Apache-2.0",
25 "SPDX-license-identifier-BSD",
26 "SPDX-license-identifier-GPL",
27 "SPDX-license-identifier-GPL-2.0",
28 "SPDX-license-identifier-GPL-3.0",
29 "SPDX-license-identifier-LGPL",
30 "SPDX-license-identifier-MIT",
31 "SPDX-license-identifier-NCSA",
32 "SPDX-license-identifier-OpenSSL",
33 "legacy_notice",
34 "legacy_permissive",
35 "legacy_unencumbered",
36 ],
37 // large-scale-change unable to identify any license_text files
38}
39
Ivan Lozano421f5542021-11-11 12:36:13 -050040rust_stdlib_prebuilt_host {
Ivan Lozano9b705242021-11-13 07:47:13 -050041 name: "libstd",
42 crate_name: "std",
43 sysroot: true,
Ivan Lozano421f5542021-11-11 12:36:13 -050044}
45
Ivan Lozano9b705242021-11-13 07:47:13 -050046// stdlibs source path relative to toolchain root
47stdlibs_src_path = "src/stdlibs"
Matthew Maureraa666892019-11-07 12:22:44 -080048
49// The basic crates are only available as static libraries
50// .rust_sysroot is appended to the name to prevent accidental direct usage
51// of these crates by user code.
52// The most likely place for this to occur would be liblibc.
Ivan Lozano062b1ff2020-09-14 09:53:34 -040053rust_defaults {
Jiyong Park222a9242020-11-17 22:23:08 +090054 name: "rust_sysroot_defaults",
55 no_stdlibs: true,
56 edition: "2018",
57 native_coverage: false,
58 host_supported: true,
59 sysroot: true,
Matthew Maurere0a8ce92021-05-09 14:28:13 -070060 native_bridge_supported: true,
61 product_available: true,
62 ramdisk_available: true,
63 recovery_available: true,
Ivan Lozano29a341e2020-12-04 13:49:56 -050064 vendor_available: true,
Ivan Lozano502a6d42021-02-05 16:06:14 -050065 vendor_ramdisk_available: true,
Jiyong Park222a9242020-11-17 22:23:08 +090066 apex_available: [
67 "//apex_available:platform",
68 "//apex_available:anyapex",
69 ],
Ivan Lozano7419b4d2021-02-09 14:19:36 -050070 target: {
Colin Crossaa6e5532022-01-24 15:26:00 -080071 glibc: {
Ivan Lozano7419b4d2021-02-09 14:19:36 -050072 enabled: false,
73 },
74 darwin: {
75 enabled: false,
76 },
77 },
Bernie Innocenti05f1c4b2020-12-12 03:32:24 +090078 min_sdk_version: "29",
Ivan Lozano062b1ff2020-09-14 09:53:34 -040079}
80
Ivan Lozano9b705242021-11-13 07:47:13 -050081rust_toolchain_library_rlib {
Matthew Maureraa666892019-11-07 12:22:44 -080082 name: "libcore.rust_sysroot",
Ivan Lozano062b1ff2020-09-14 09:53:34 -040083 defaults: ["rust_sysroot_defaults"],
Matthew Maureraa666892019-11-07 12:22:44 -080084 crate_name: "core",
Ivan Lozano9b705242021-11-13 07:47:13 -050085 toolchain_src: stdlibs_src_path + "/library/core/src/lib.rs",
Ivan Lozano122ff872021-08-02 10:38:12 -040086 sanitize: {
87 never: true,
88 },
Matthew Maureraa666892019-11-07 12:22:44 -080089}
90
Ivan Lozano9b705242021-11-13 07:47:13 -050091rust_toolchain_library_rlib {
Matthew Maurer13cef982020-01-02 16:11:26 -080092 name: "librustc_demangle.rust_sysroot",
Ivan Lozano062b1ff2020-09-14 09:53:34 -040093 defaults: ["rust_sysroot_defaults"],
Matthew Maurer13cef982020-01-02 16:11:26 -080094 crate_name: "rustc_demangle",
Ivan Lozano9b705242021-11-13 07:47:13 -050095 toolchain_src: stdlibs_src_path + "/vendor/rustc-demangle/src/lib.rs",
Matthew Maurer13cef982020-01-02 16:11:26 -080096 features: [
Ivan Lozano52a2ca82020-04-07 11:26:26 -040097 "core",
98 "compiler_builtins",
Matthew Maurer13cef982020-01-02 16:11:26 -080099 ],
100 rlibs: [
101 "libcompiler_builtins.rust_sysroot",
102 "libcore.rust_sysroot",
103 ],
Matthew Maurer13cef982020-01-02 16:11:26 -0800104 edition: "2015",
105}
106
Ivan Lozano9b705242021-11-13 07:47:13 -0500107rust_toolchain_library_rlib {
Matthew Maureraa666892019-11-07 12:22:44 -0800108 name: "libcompiler_builtins.rust_sysroot",
Ivan Lozano062b1ff2020-09-14 09:53:34 -0400109 defaults: ["rust_sysroot_defaults"],
Matthew Maureraa666892019-11-07 12:22:44 -0800110 crate_name: "compiler_builtins",
111 features: [
112 "compiler-builtins",
113 "core",
114 "default",
115 ],
Ivan Lozano9b705242021-11-13 07:47:13 -0500116 toolchain_src: stdlibs_src_path + "/vendor/compiler_builtins/src/lib.rs",
Matthew Maureraa666892019-11-07 12:22:44 -0800117 rlibs: ["libcore.rust_sysroot"],
118 flags: [
119 "-C",
120 "panic=abort",
Ivan Lozano9b705242021-11-13 07:47:13 -0500121 "-C",
122 "overflow-checks=off",
Matthew Maureraa666892019-11-07 12:22:44 -0800123 ],
Matthew Maureraa666892019-11-07 12:22:44 -0800124 edition: "2015",
125}
126
Ivan Lozano9b705242021-11-13 07:47:13 -0500127rust_toolchain_library_rlib {
Matthew Maureraa666892019-11-07 12:22:44 -0800128 name: "liblibc.rust_sysroot",
Ivan Lozano062b1ff2020-09-14 09:53:34 -0400129 defaults: ["rust_sysroot_defaults"],
Matthew Maureraa666892019-11-07 12:22:44 -0800130 crate_name: "libc",
131 features: ["align"],
Ivan Lozano9b705242021-11-13 07:47:13 -0500132 toolchain_src: stdlibs_src_path + "/vendor/libc/src/lib.rs",
Matthew Maureraa666892019-11-07 12:22:44 -0800133 rlibs: [
134 "libcompiler_builtins.rust_sysroot",
135 "libcore.rust_sysroot",
136 ],
137 // Generated via build.rs autodetect on compiler version. May need to be
138 // regenerated on compiler version bump.
ThiƩbaud Weksteeneadd2732021-04-07 15:02:43 +0200139 cfgs: [
Matthew Maureraa666892019-11-07 12:22:44 -0800140 "freebsd11",
Matthew Maureraa666892019-11-07 12:22:44 -0800141 "libc_priv_mod_use",
Matthew Maureraa666892019-11-07 12:22:44 -0800142 "libc_union",
Matthew Maureraa666892019-11-07 12:22:44 -0800143 "libc_const_size_of",
Matthew Maureraa666892019-11-07 12:22:44 -0800144 "libc_align",
Matthew Maureraa666892019-11-07 12:22:44 -0800145 "libc_core_cvoid",
Matthew Maureraa666892019-11-07 12:22:44 -0800146 "libc_packedN",
Matthew Maureraa666892019-11-07 12:22:44 -0800147 "libc_thread_local",
148 ],
Matthew Maureraa666892019-11-07 12:22:44 -0800149 edition: "2015",
150}
151
Ivan Lozano9b705242021-11-13 07:47:13 -0500152rust_toolchain_library_rlib {
Matthew Maureraa666892019-11-07 12:22:44 -0800153 name: "liballoc.rust_sysroot",
Ivan Lozano062b1ff2020-09-14 09:53:34 -0400154 defaults: ["rust_sysroot_defaults"],
Matthew Maureraa666892019-11-07 12:22:44 -0800155 crate_name: "alloc",
Ivan Lozano9b705242021-11-13 07:47:13 -0500156 toolchain_src: stdlibs_src_path + "/library/alloc/src/lib.rs",
Matthew Maureraa666892019-11-07 12:22:44 -0800157 rlibs: [
158 "libcompiler_builtins.rust_sysroot",
159 "libcore.rust_sysroot",
160 ],
Matthew Maureraa666892019-11-07 12:22:44 -0800161}
162
Ivan Lozano9b705242021-11-13 07:47:13 -0500163rust_toolchain_library_rlib {
Matthew Maureraa666892019-11-07 12:22:44 -0800164 name: "libcfg_if.rust_sysroot",
Ivan Lozano062b1ff2020-09-14 09:53:34 -0400165 defaults: ["rust_sysroot_defaults"],
Matthew Maureraa666892019-11-07 12:22:44 -0800166 crate_name: "cfg_if",
167 features: [
168 "compiler_builtins",
169 "core",
170 ],
Ivan Lozano9b705242021-11-13 07:47:13 -0500171 toolchain_src: stdlibs_src_path + "/vendor/cfg-if/src/lib.rs",
Matthew Maureraa666892019-11-07 12:22:44 -0800172 rlibs: [
173 "libcompiler_builtins.rust_sysroot",
174 "libcore.rust_sysroot",
175 ],
Matthew Maureraa666892019-11-07 12:22:44 -0800176}
177
Ivan Lozano9b705242021-11-13 07:47:13 -0500178rust_toolchain_library_rlib {
Chris Wailes2ea3e822021-07-23 13:30:06 -0700179 name: "libstd_detect.rust_sysroot",
180 defaults: ["rust_sysroot_defaults"],
181 crate_name: "std_detect",
182 features: [
183 "std_detect_file_io",
184 "std_detect_dlsym_getauxval",
185 ],
Ivan Lozano9b705242021-11-13 07:47:13 -0500186 toolchain_src: stdlibs_src_path + "/library/stdarch/crates/std_detect/src/lib.rs",
Chris Wailes2ea3e822021-07-23 13:30:06 -0700187 rlibs: [
188 "libcompiler_builtins.rust_sysroot",
189 "libcore.rust_sysroot",
190 "liballoc.rust_sysroot",
191 "libcfg_if.rust_sysroot",
Ivan Lozano9b705242021-11-13 07:47:13 -0500192 ],
Chris Wailes2ea3e822021-07-23 13:30:06 -0700193}
194
Ivan Lozano9b705242021-11-13 07:47:13 -0500195rust_toolchain_library_rlib {
Matthew Maureraa666892019-11-07 12:22:44 -0800196 name: "libpanic_abort.rust_sysroot",
Ivan Lozano062b1ff2020-09-14 09:53:34 -0400197 defaults: ["rust_sysroot_defaults"],
Matthew Maureraa666892019-11-07 12:22:44 -0800198 crate_name: "panic_abort",
Ivan Lozano9b705242021-11-13 07:47:13 -0500199 toolchain_src: stdlibs_src_path + "/library/panic_abort/src/lib.rs",
Matthew Maureraa666892019-11-07 12:22:44 -0800200 rlibs: [
ThiƩbaud Weksteen1b005ed2021-01-28 14:03:03 +0100201 "liballoc.rust_sysroot",
Matthew Maureraa666892019-11-07 12:22:44 -0800202 "libcompiler_builtins.rust_sysroot",
203 "libcore.rust_sysroot",
Jeff Vander Stoepba4a5872021-01-26 14:24:35 +0100204 "libcfg_if.rust_sysroot",
Matthew Maureraa666892019-11-07 12:22:44 -0800205 "liblibc.rust_sysroot",
206 ],
Matthew Maureraa666892019-11-07 12:22:44 -0800207}
208
Ivan Lozano9b705242021-11-13 07:47:13 -0500209rust_toolchain_library_rlib {
Matthew Maureraa666892019-11-07 12:22:44 -0800210 name: "libpanic_unwind.rust_sysroot",
Ivan Lozano062b1ff2020-09-14 09:53:34 -0400211 defaults: ["rust_sysroot_defaults"],
Matthew Maureraa666892019-11-07 12:22:44 -0800212 crate_name: "panic_unwind",
Ivan Lozano9b705242021-11-13 07:47:13 -0500213 toolchain_src: stdlibs_src_path + "/library/panic_unwind/src/lib.rs",
Matthew Maureraa666892019-11-07 12:22:44 -0800214 rlibs: [
215 "liballoc.rust_sysroot",
216 "libcore.rust_sysroot",
217 "liblibc.rust_sysroot",
218 "libunwind.rust_sysroot",
219 "libcompiler_builtins.rust_sysroot",
220 "libcfg_if.rust_sysroot",
221 ],
Matthew Maureraa666892019-11-07 12:22:44 -0800222}
223
Ivan Lozano9b705242021-11-13 07:47:13 -0500224rust_toolchain_library_rlib {
Matthew Maureraa666892019-11-07 12:22:44 -0800225 name: "libunwind.rust_sysroot",
Ivan Lozano062b1ff2020-09-14 09:53:34 -0400226 defaults: ["rust_sysroot_defaults"],
Matthew Maureraa666892019-11-07 12:22:44 -0800227 crate_name: "unwind",
Ivan Lozano9b705242021-11-13 07:47:13 -0500228 toolchain_src: stdlibs_src_path + "/library/unwind/src/lib.rs",
Matthew Maureraa666892019-11-07 12:22:44 -0800229 rlibs: [
230 "libcompiler_builtins.rust_sysroot",
231 "libcore.rust_sysroot",
232 "liblibc.rust_sysroot",
233 "libcfg_if.rust_sysroot",
234 ],
Matthew Maureraa666892019-11-07 12:22:44 -0800235}
236
Ivan Lozano9b705242021-11-13 07:47:13 -0500237rust_toolchain_library_rlib {
Matthew Maureraa666892019-11-07 12:22:44 -0800238 name: "libhashbrown.rust_sysroot",
Ivan Lozano062b1ff2020-09-14 09:53:34 -0400239 defaults: ["rust_sysroot_defaults"],
Matthew Maureraa666892019-11-07 12:22:44 -0800240 crate_name: "hashbrown",
Ivan Lozano9b705242021-11-13 07:47:13 -0500241 toolchain_src: stdlibs_src_path + "/vendor/hashbrown/src/lib.rs",
Matthew Maureraa666892019-11-07 12:22:44 -0800242 features: [
243 "alloc",
244 "compiler_builtins",
245 "core",
Matthew Maureraa666892019-11-07 12:22:44 -0800246 "nightly",
247 "rustc-dep-of-std",
Matthew Maurer13cef982020-01-02 16:11:26 -0800248 "rustc-internal-api",
Matthew Maureraa666892019-11-07 12:22:44 -0800249 ],
ThiƩbaud Weksteeneadd2732021-04-07 15:02:43 +0200250 cfgs: ["has_extern_crate_alloc"],
Matthew Maureraa666892019-11-07 12:22:44 -0800251 rlibs: [
252 "libcore.rust_sysroot",
253 "libcompiler_builtins.rust_sysroot",
254 "liballoc.rust_sysroot",
255 "libunwind.rust_sysroot",
256 ],
257}
258
259// Top level sysroot libraries are available both as static and dynamic
Ivan Lozano9b705242021-11-13 07:47:13 -0500260rust_toolchain_library {
Matthew Maureraa666892019-11-07 12:22:44 -0800261 name: "libstd",
Ivan Lozano062b1ff2020-09-14 09:53:34 -0400262 defaults: ["rust_sysroot_defaults"],
Matthew Maureraa666892019-11-07 12:22:44 -0800263 crate_name: "std",
Ivan Lozano11564072020-04-28 12:36:52 -0400264 target: {
Ivan Lozano74adc1d2021-01-26 16:38:14 -0500265 linux_bionic: {
266 rlibs: ["libpanic_abort.rust_sysroot"],
267 },
Jeff Vander Stoepba4a5872021-01-26 14:24:35 +0100268 android: {
269 rlibs: ["libpanic_abort.rust_sysroot"],
270 },
Colin Crossaa6e5532022-01-24 15:26:00 -0800271 musl: {
272 rlibs: ["libpanic_unwind.rust_sysroot"],
273 },
Ivan Lozano11564072020-04-28 12:36:52 -0400274 },
Ivan Lozano9b705242021-11-13 07:47:13 -0500275 toolchain_src: stdlibs_src_path + "/library/std/src/lib.rs",
Chris Wailese55b81c2021-11-02 16:58:17 -0700276 cfgs: ["backtrace_in_libstd"],
Matthew Maureraa666892019-11-07 12:22:44 -0800277 features: [
278 "default",
279 "std_detect_dlsym_getauxval",
280 "std_detect_file_io",
Ivan Lozano52a2ca82020-04-07 11:26:26 -0400281 "profiler",
Matthew Maureraa666892019-11-07 12:22:44 -0800282 ],
Matthew Maureraa666892019-11-07 12:22:44 -0800283 rlibs: [
284 "libcompiler_builtins.rust_sysroot",
285 "libcore.rust_sysroot",
ThiƩbaud Weksteen594cf1f2020-11-03 11:18:56 +0100286 "librustc_demangle.rust_sysroot",
Matthew Maureraa666892019-11-07 12:22:44 -0800287 "liblibc.rust_sysroot",
288 "libcfg_if.rust_sysroot",
289 "liballoc.rust_sysroot",
290 "libhashbrown.rust_sysroot",
291 "libunwind.rust_sysroot",
Ivan Lozano52a2ca82020-04-07 11:26:26 -0400292 "libprofiler_builtins.rust_sysroot",
Chris Wailes2ea3e822021-07-23 13:30:06 -0700293 "libstd_detect.rust_sysroot",
Matthew Maureraa666892019-11-07 12:22:44 -0800294 ],
295}
296
Ivan Lozano9b705242021-11-13 07:47:13 -0500297rust_toolchain_library_rlib {
Ivan Lozano52a2ca82020-04-07 11:26:26 -0400298 name: "libprofiler_builtins.rust_sysroot",
Ivan Lozano062b1ff2020-09-14 09:53:34 -0400299 defaults: ["rust_sysroot_defaults"],
Ivan Lozano52a2ca82020-04-07 11:26:26 -0400300 crate_name: "profiler_builtins",
Ivan Lozano9b705242021-11-13 07:47:13 -0500301 toolchain_src: stdlibs_src_path + "/library/profiler_builtins/src/lib.rs",
Ivan Lozano52a2ca82020-04-07 11:26:26 -0400302 rlibs: [
303 "libcompiler_builtins.rust_sysroot",
304 "libcore.rust_sysroot",
305 ],
Matthew Maureraa666892019-11-07 12:22:44 -0800306}
Ivan Lozano5e4d7882021-07-15 15:40:14 -0400307
Ivan Lozano9b705242021-11-13 07:47:13 -0500308rust_toolchain_library {
Ivan Lozano5e4d7882021-07-15 15:40:14 -0400309 name: "libgetopts",
310 host_supported: true,
311 crate_name: "getopts",
Ivan Lozano9b705242021-11-13 07:47:13 -0500312 toolchain_src: stdlibs_src_path + "/vendor/getopts/src/lib.rs",
Ivan Lozano5e4d7882021-07-15 15:40:14 -0400313 rlibs: ["libunicode_width.rust_toolchain"],
314 edition: "2015",
Andrew Walbrane3916ad2021-07-30 12:53:03 +0000315 apex_available: [
316 "//apex_available:platform",
317 "com.android.virt",
318 ],
Ivan Lozano5e4d7882021-07-15 15:40:14 -0400319}
320
Ivan Lozano9b705242021-11-13 07:47:13 -0500321rust_toolchain_library {
Ivan Lozano5e4d7882021-07-15 15:40:14 -0400322 name: "libtest",
323 crate_name: "test",
324 host_supported: true,
Ivan Lozano9b705242021-11-13 07:47:13 -0500325 toolchain_src: stdlibs_src_path + "/library/test/src/lib.rs",
Ivan Lozano5e4d7882021-07-15 15:40:14 -0400326 rlibs: [
Ivan Lozano9a39d732021-07-16 13:35:47 -0400327 "liblibc.rust_toolchain",
328 "libcfg_if.rust_toolchain",
Ivan Lozano5e4d7882021-07-15 15:40:14 -0400329 "libgetopts",
Ivan Lozano5e4d7882021-07-15 15:40:14 -0400330 ],
331}
332
Ivan Lozano9b705242021-11-13 07:47:13 -0500333rust_toolchain_library_rlib {
Ivan Lozano5e4d7882021-07-15 15:40:14 -0400334 name: "libunicode_width.rust_toolchain",
335 host_supported: true,
336 crate_name: "unicode_width",
Ivan Lozano9b705242021-11-13 07:47:13 -0500337 toolchain_src: stdlibs_src_path + "/vendor/unicode-width/src/lib.rs",
Ivan Lozano5e4d7882021-07-15 15:40:14 -0400338 edition: "2015",
Andrew Walbrane3916ad2021-07-30 12:53:03 +0000339 apex_available: [
340 "//apex_available:platform",
341 "com.android.virt",
342 ],
Ivan Lozano5e4d7882021-07-15 15:40:14 -0400343}
Ivan Lozano9a39d732021-07-16 13:35:47 -0400344
Ivan Lozano9b705242021-11-13 07:47:13 -0500345rust_toolchain_library_rlib {
Ivan Lozano9a39d732021-07-16 13:35:47 -0400346 name: "libcfg_if.rust_toolchain",
347 crate_name: "cfg_if",
348 host_supported: true,
Ivan Lozano9b705242021-11-13 07:47:13 -0500349 toolchain_src: stdlibs_src_path + "/vendor/cfg-if/src/lib.rs",
Ivan Lozano9a39d732021-07-16 13:35:47 -0400350}
351
Ivan Lozano9b705242021-11-13 07:47:13 -0500352rust_toolchain_library_rlib {
Ivan Lozano9a39d732021-07-16 13:35:47 -0400353 name: "liblibc.rust_toolchain",
354 crate_name: "libc",
355 host_supported: true,
Ivan Lozano9b705242021-11-13 07:47:13 -0500356 toolchain_src: stdlibs_src_path + "/vendor/libc/src/lib.rs",
Ivan Lozano9a39d732021-07-16 13:35:47 -0400357 cfgs: [
358 "freebsd11",
359 "libc_priv_mod_use",
360 "libc_union",
361 "libc_const_size_of",
362 "libc_align",
363 "libc_core_cvoid",
364 "libc_packedN",
365 "libc_thread_local",
366 ],
367 features: [
368 "std",
369 "align",
370 ],
371 edition: "2015",
372}