xref: /aosp_15_r20/prebuilts/rust/linux-musl-x86/1.80.1/src/stdlibs/library/std/Cargo.toml (revision b40554a23088fb75aa6945dfe8e65169c8484da3)
1cargo-features = ["public-dependency"]
2
3[package]
4name = "std"
5version = "0.0.0"
6license = "MIT OR Apache-2.0"
7repository = "https://github.com/rust-lang/rust.git"
8description = "The Rust Standard Library"
9edition = "2021"
10
11[lib]
12crate-type = ["dylib", "rlib"]
13
14[dependencies]
15alloc = { path = "../alloc", public = true }
16cfg-if = { version = "1.0", features = ['rustc-dep-of-std'] }
17panic_unwind = { path = "../panic_unwind", optional = true }
18panic_abort = { path = "../panic_abort" }
19core = { path = "../core", public = true }
20compiler_builtins = { version = "0.1.105", features = ["weak-intrinsics"] }
21profiler_builtins = { path = "../profiler_builtins", optional = true }
22unwind = { path = "../unwind" }
23hashbrown = { version = "0.14", default-features = false, features = ['rustc-dep-of-std'] }
24std_detect = { path = "../stdarch/crates/std_detect", default-features = false, features = ['rustc-dep-of-std'] }
25
26# Dependencies of the `backtrace` crate
27rustc-demangle = { version = "0.1.24", features = ['rustc-dep-of-std'] }
28
29[target.'cfg(not(all(windows, target_env = "msvc", not(target_vendor = "uwp"))))'.dependencies]
30miniz_oxide = { version = "0.7.0", optional = true, default-features = false }
31addr2line = { version = "0.22.0", optional = true, default-features = false }
32
33[target.'cfg(not(all(windows, target_env = "msvc")))'.dependencies]
34libc = { version = "0.2.153", default-features = false, features = ['rustc-dep-of-std'], public = true }
35
36[target.'cfg(all(not(target_os = "aix"), not(all(windows, target_env = "msvc", not(target_vendor = "uwp")))))'.dependencies]
37object = { version = "0.36.0", default-features = false, optional = true, features = ['read_core', 'elf', 'macho', 'pe', 'unaligned', 'archive'] }
38
39[target.'cfg(target_os = "aix")'.dependencies]
40object = { version = "0.36.0", default-features = false, optional = true, features = ['read_core', 'xcoff', 'unaligned', 'archive'] }
41
42[dev-dependencies]
43rand = { version = "0.8.5", default-features = false, features = ["alloc"] }
44rand_xorshift = "0.3.0"
45
46[target.'cfg(any(all(target_family = "wasm", target_os = "unknown"), target_os = "xous", all(target_vendor = "fortanix", target_env = "sgx")))'.dependencies]
47dlmalloc = { version = "0.2.4", features = ['rustc-dep-of-std'] }
48
49[target.x86_64-fortanix-unknown-sgx.dependencies]
50fortanix-sgx-abi = { version = "0.5.0", features = ['rustc-dep-of-std'], public = true }
51
52[target.'cfg(target_os = "hermit")'.dependencies]
53hermit-abi = { version = "0.3.9", features = ['rustc-dep-of-std'], public = true }
54
55[target.'cfg(target_os = "wasi")'.dependencies]
56wasi = { version = "0.11.0", features = ['rustc-dep-of-std'], default-features = false }
57
58[target.'cfg(target_os = "uefi")'.dependencies]
59r-efi = { version = "4.2.0", features = ['rustc-dep-of-std'] }
60r-efi-alloc = { version = "1.0.0", features = ['rustc-dep-of-std'] }
61
62[features]
63default = ["compiler-builtins-weak-intrinsics"]
64backtrace = [
65  'addr2line/rustc-dep-of-std',
66  'object/rustc-dep-of-std',
67  'miniz_oxide/rustc-dep-of-std',
68]
69
70panic-unwind = ["panic_unwind"]
71profiler = ["profiler_builtins"]
72compiler-builtins-c = ["alloc/compiler-builtins-c"]
73compiler-builtins-mem = ["alloc/compiler-builtins-mem"]
74compiler-builtins-no-asm = ["alloc/compiler-builtins-no-asm"]
75compiler-builtins-mangled-names = ["alloc/compiler-builtins-mangled-names"]
76compiler-builtins-weak-intrinsics = ["alloc/compiler-builtins-weak-intrinsics"]
77llvm-libunwind = ["unwind/llvm-libunwind"]
78system-llvm-libunwind = ["unwind/system-llvm-libunwind"]
79
80# Make panics and failed asserts immediately abort without formatting any message
81panic_immediate_abort = ["core/panic_immediate_abort", "alloc/panic_immediate_abort"]
82# Choose algorithms that are optimized for binary size instead of runtime performance
83optimize_for_size = ["core/optimize_for_size", "alloc/optimize_for_size"]
84
85# Enable std_detect default features for stdarch/crates/std_detect:
86# https://github.com/rust-lang/stdarch/blob/master/crates/std_detect/Cargo.toml
87std_detect_file_io = ["std_detect/std_detect_file_io"]
88std_detect_dlsym_getauxval = ["std_detect/std_detect_dlsym_getauxval"]
89std_detect_env_override = ["std_detect/std_detect_env_override"]
90
91[package.metadata.fortanix-sgx]
92# Maximum possible number of threads when testing
93threads = 125
94# Maximum heap size
95heap_size = 0x8000000
96
97[[bench]]
98name = "stdbenches"
99path = "benches/lib.rs"
100test = true
101
102[lints.rust.unexpected_cfgs]
103level = "warn"
104# x.py uses beta cargo, so `check-cfg` entries do not yet take effect
105# for rust-lang/rust. But for users of `-Zbuild-std` it does.
106check-cfg = [
107    'cfg(bootstrap)',
108    'cfg(target_arch, values("xtensa"))',
109    # std use #[path] imports to portable-simd `std_float` crate
110    # and to the `backtrace` crate which messes-up with Cargo list
111    # of declared features, we therefor expect any feature cfg
112    'cfg(feature, values(any()))',
113]
114