You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

351 lines
9.2 KiB

// Sysroot Libraries
package {
default_applicable_licenses: ["prebuilts_rust_license"],
}
// Added automatically by a large-scale-change that took the approach of
// 'apply every license found to every target'. While this makes sure we respect
// every license restriction, it may not be entirely correct.
//
// e.g. GPL in an MIT project might only apply to the contrib/ directory.
//
// Please consider splitting the single license below into multiple licenses,
// taking care not to lose any license_kind information, and overriding the
// default license using the 'licenses: [...]' property on targets as needed.
//
// For unused files, consider creating a 'fileGroup' with "//visibility:private"
// to attach the license to, and including a comment whether the files may be
// used in the current project.
// See: http://go/android-license-faq
license {
name: "prebuilts_rust_license",
visibility: [":__subpackages__"],
license_kinds: [
"SPDX-license-identifier-Apache-2.0",
"SPDX-license-identifier-BSD",
"SPDX-license-identifier-GPL",
"SPDX-license-identifier-GPL-2.0",
"SPDX-license-identifier-GPL-3.0",
"SPDX-license-identifier-LGPL",
"SPDX-license-identifier-MIT",
"SPDX-license-identifier-NCSA",
"SPDX-license-identifier-OpenSSL",
"legacy_notice",
"legacy_permissive",
"legacy_unencumbered",
],
// large-scale-change unable to identify any license_text files
}
rustc = "linux-x86/1.51.0/src/stdlibs"
// The basic crates are only available as static libraries
// .rust_sysroot is appended to the name to prevent accidental direct usage
// of these crates by user code.
// The most likely place for this to occur would be liblibc.
rust_defaults {
name: "rust_sysroot_defaults",
no_stdlibs: true,
edition: "2018",
native_coverage: false,
host_supported: true,
sysroot: true,
vendor_available: true,
vendor_ramdisk_available: true,
apex_available: [
"//apex_available:platform",
"//apex_available:anyapex",
],
target: {
linux_glibc: {
enabled: false,
},
darwin: {
enabled: false,
},
},
min_sdk_version: "29",
}
rust_library_rlib {
name: "libcore.rust_sysroot",
defaults: ["rust_sysroot_defaults"],
crate_name: "core",
srcs: [rustc + "/library/core/src/lib.rs"],
}
rust_library_rlib {
name: "libbacktrace_sys.rust_sysroot",
defaults: ["rust_sysroot_defaults"],
crate_name: "backtrace_sys",
srcs: [rustc + "/library/backtrace/crates/backtrace-sys/src/lib.rs"],
features: [
"core",
"compiler_builtins",
],
rlibs: [
"liballoc.rust_sysroot",
"libcompiler_builtins.rust_sysroot",
"libcore.rust_sysroot",
"liblibc.rust_sysroot",
],
}
rust_library_rlib {
name: "librustc_demangle.rust_sysroot",
defaults: ["rust_sysroot_defaults"],
crate_name: "rustc_demangle",
srcs: [rustc + "/vendor/rustc-demangle/src/lib.rs"],
features: [
"core",
"compiler_builtins",
],
rlibs: [
"libcompiler_builtins.rust_sysroot",
"libcore.rust_sysroot",
],
edition: "2015",
}
rust_library_rlib {
name: "libbacktrace_rs.rust_sysroot",
defaults: ["rust_sysroot_defaults"],
crate_name: "backtrace_rs",
srcs: [rustc + "/vendor/backtrace/src/lib.rs"],
features: [
"core",
"compiler_builtins",
],
rlibs: [
"libbacktrace_sys.rust_sysroot",
"libcfg_if.rust_sysroot",
"libcompiler_builtins.rust_sysroot",
"libcore.rust_sysroot",
"liblibc.rust_sysroot",
"librustc_demangle.rust_sysroot",
],
}
rust_library_rlib {
name: "libcompiler_builtins.rust_sysroot",
defaults: ["rust_sysroot_defaults"],
crate_name: "compiler_builtins",
features: [
"compiler-builtins",
"core",
"default",
],
srcs: [rustc + "/vendor/compiler_builtins/src/lib.rs"],
rlibs: ["libcore.rust_sysroot"],
flags: [
"-C",
"panic=abort",
"-C",
"overflow-checks=off",
],
edition: "2015",
}
rust_library_rlib {
name: "liblibc.rust_sysroot",
defaults: ["rust_sysroot_defaults"],
crate_name: "libc",
features: ["align"],
srcs: [rustc + "/vendor/libc/src/lib.rs"],
rlibs: [
"libcompiler_builtins.rust_sysroot",
"libcore.rust_sysroot",
],
// Generated via build.rs autodetect on compiler version. May need to be
// regenerated on compiler version bump.
cfgs: [
"freebsd11",
"libc_priv_mod_use",
"libc_union",
"libc_const_size_of",
"libc_align",
"libc_core_cvoid",
"libc_packedN",
"libc_thread_local",
],
edition: "2015",
}
rust_library_rlib {
name: "liballoc.rust_sysroot",
defaults: ["rust_sysroot_defaults"],
crate_name: "alloc",
srcs: [rustc + "/library/alloc/src/lib.rs"],
rlibs: [
"libcompiler_builtins.rust_sysroot",
"libcore.rust_sysroot",
],
}
rust_library_rlib {
name: "libcfg_if.rust_sysroot",
defaults: ["rust_sysroot_defaults"],
crate_name: "cfg_if",
features: [
"compiler_builtins",
"core",
],
srcs: [rustc + "/vendor/cfg-if/src/lib.rs"],
rlibs: [
"libcompiler_builtins.rust_sysroot",
"libcore.rust_sysroot",
],
}
rust_library_rlib {
name: "libpanic_abort.rust_sysroot",
defaults: ["rust_sysroot_defaults"],
crate_name: "panic_abort",
srcs: [rustc + "/library/panic_abort/src/lib.rs"],
rlibs: [
"liballoc.rust_sysroot",
"libcompiler_builtins.rust_sysroot",
"libcore.rust_sysroot",
"libcfg_if.rust_sysroot",
"liblibc.rust_sysroot",
],
}
rust_library_rlib {
name: "libpanic_unwind.rust_sysroot",
defaults: ["rust_sysroot_defaults"],
crate_name: "panic_unwind",
srcs: [rustc + "/library/panic_unwind/src/lib.rs"],
rlibs: [
"liballoc.rust_sysroot",
"libcore.rust_sysroot",
"liblibc.rust_sysroot",
"libunwind.rust_sysroot",
"libcompiler_builtins.rust_sysroot",
"libcfg_if.rust_sysroot",
],
}
rust_library_rlib {
name: "libunwind.rust_sysroot",
defaults: ["rust_sysroot_defaults"],
crate_name: "unwind",
srcs: [rustc + "/library/unwind/src/lib.rs"],
rlibs: [
"libcompiler_builtins.rust_sysroot",
"libcore.rust_sysroot",
"liblibc.rust_sysroot",
"libcfg_if.rust_sysroot",
],
}
rust_library_rlib {
name: "libhashbrown.rust_sysroot",
defaults: ["rust_sysroot_defaults"],
crate_name: "hashbrown",
srcs: [rustc + "/vendor/hashbrown/src/lib.rs"],
features: [
"alloc",
"compiler_builtins",
"core",
"nightly",
"rustc-dep-of-std",
"rustc-internal-api",
],
cfgs: ["has_extern_crate_alloc"],
rlibs: [
"libcore.rust_sysroot",
"libcompiler_builtins.rust_sysroot",
"liballoc.rust_sysroot",
"libunwind.rust_sysroot",
],
}
// Top level sysroot libraries are available both as static and dynamic
rust_library {
name: "libstd",
defaults: ["rust_sysroot_defaults"],
crate_name: "std",
target: {
linux_bionic: {
rlibs: ["libpanic_abort.rust_sysroot"],
},
android: {
rlibs: ["libpanic_abort.rust_sysroot"],
},
},
srcs: [rustc + "/library/std/src/lib.rs"],
features: [
"default",
"std_detect_dlsym_getauxval",
"std_detect_file_io",
"profiler",
],
rlibs: [
"libbacktrace_rs.rust_sysroot",
"libcompiler_builtins.rust_sysroot",
"libcore.rust_sysroot",
"librustc_demangle.rust_sysroot",
"liblibc.rust_sysroot",
"libcfg_if.rust_sysroot",
"liballoc.rust_sysroot",
"libhashbrown.rust_sysroot",
"libunwind.rust_sysroot",
"libprofiler_builtins.rust_sysroot",
],
}
rust_library {
name: "libterm",
defaults: ["rust_sysroot_defaults"],
crate_name: "term",
srcs: [rustc + "/library/term/src/lib.rs"],
rustlibs: ["libstd"],
}
rust_library {
name: "libgetopts",
defaults: ["rust_sysroot_defaults"],
crate_name: "getopts",
srcs: [rustc + "/vendor/getopts/src/lib.rs"],
rlibs: ["libunicode_width.rust_sysroot"],
rustlibs: ["libstd"],
edition: "2015",
}
rust_library_rlib {
name: "libunicode_width.rust_sysroot",
defaults: ["rust_sysroot_defaults"],
crate_name: "unicode_width",
srcs: [rustc + "/vendor/unicode-width/src/lib.rs"],
rustlibs: ["libstd"],
edition: "2015",
}
rust_library {
name: "libtest",
defaults: ["rust_sysroot_defaults"],
crate_name: "test",
srcs: [rustc + "/library/test/src/lib.rs"],
rustlibs: [
"libterm",
"libgetopts",
"libstd",
],
rlibs: [
"liblibc.rust_sysroot",
"libcfg_if.rust_sysroot",
],
}
rust_library_rlib {
name: "libprofiler_builtins.rust_sysroot",
defaults: ["rust_sysroot_defaults"],
crate_name: "profiler_builtins",
srcs: [rustc + "/library/profiler_builtins/src/lib.rs"],
rlibs: [
"libcompiler_builtins.rust_sysroot",
"libcore.rust_sysroot",
],
}