-
Notifications
You must be signed in to change notification settings - Fork 12
/
Cargo.toml
200 lines (163 loc) · 7.8 KB
/
Cargo.toml
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
[package]
name = "origin"
version = "0.23.3"
authors = [
"Dan Gohman <[email protected]>",
]
description = "Program startup and thread support written in Rust"
documentation = "https://docs.rs/origin"
license = "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT"
repository = "https://github.com/sunfishcode/origin"
edition = "2021"
keywords = ["linux"]
categories = ["no-std"]
include = ["src", "Cargo.toml", "COPYRIGHT", "LICENSE*", "/*.md"]
rust-version = "1.78"
[dependencies]
linux-raw-sys = { version = "0.4.9", default-features = false, features = ["general", "no_std", "elf"] }
rustix = { version = "0.38.35", default-features = false }
bitflags = { version = "2.4.0", default-features = false }
log = { version = "0.4.14", default-features = false, optional = true }
rustix-futex-sync = { version = "0.2.1", optional = true }
smallvec = { version = "1.11.1", optional = true, features = ["const_new"] }
# Optional logging backends for use with "take-charge". You can use any
# external logger, but using these features allows origin to initialize the
# logger before `origin_main`, so that you can see the log messages emitted
# before `origin_main` is called.
# Enable `env_logger`; eg. recognizing `RUST_LOG=trace`. This requires `std`.
env_logger = { version = "0.11.0", default-features = false, optional = true }
# Enable `atomic-dbg`'s simple logger. This doesn't require `std`.
atomic-dbg = { version = "0.1", default-features = false, optional = true }
# Enable this when disabling origin's implementations.
libc = { version = "0.2.149", default-features = false, optional = true }
errno = { version = "0.3.3", default-features = false, optional = true }
# Special dependencies used in rustc-dep-of-std mode.
core = { version = "1.0.0", optional = true, package = "rustc-std-workspace-core" }
alloc = { version = "1.0.0", optional = true, package = "rustc-std-workspace-alloc" }
# Use the unwinding crate if support for unwinding is needed. This depends on
# nightly Rust. And it's not supported on ARM yet.
[target.'cfg(not(target_arch = "arm"))'.dependencies.unwinding]
version = "0.2.4"
default-features = false
features = ["unwinder"]
optional = true
# On aarch64, compiler_builtins depends on `getauxval`, so we need rustix with
# the "param" feature.
[target.'cfg(target_arch = "aarch64")'.dependencies.rustix]
version = "0.38.35"
default-features = false
features = ["param"]
[dev-dependencies]
assert_cmd = "2.0.12"
[features]
# By default, origin coexists with libc and assume std exists and enables most
# features. To have origin avoid using libc, disable the default features and
# enable either "origin-start" or "external-start".
default = ["std", "log", "libc", "errno", "signal", "init-fini-arrays", "program-at-exit", "thread-at-exit"]
# If you're using nightly Rust, enable this feature to let origin use
# nightly-only features, which include proper support for unwinding (if
# enabled), better safety checks, and better optimizations.
nightly = ["unwinding"]
# Enable optimizations that reduce code size (at the cost of performance).
optimize_for_size = []
# Use origin's implementation of program and thread startup and shutdown as
# well as signal handler registration. To use this, disable the default
# features and enable exactly one of "origin-start" or "external-start".
#
# To use threads, it is also necessary to enable the "thread" feature.
# To use signals, it is also necessary to enable the "signal" feature.
take-charge = ["rustix/use-explicitly-provided-auxv", "rustix/runtime"]
# Enable "take-charge" mode using origin's `_start` definition.
origin-start = ["take-charge"]
# Enable "take-charge" mode using an exported `start` function which is meant
# to be run very early in program startup and passed a pointer to the initial
# stack. Don't enable this when enabling "origin-start".
external-start = ["take-charge"]
# Enable support for threads.
thread = ["rustix/thread", "rustix/mm", "param", "rustix/process", "rustix/runtime", "rustix-futex-sync"]
# Enable support for signal handlers.
signal = ["rustix/runtime"]
# Enable support for ELF `.init_array` and `.fini_array`.
init-fini-arrays = ["init-array", "fini-array"]
# Enable support for ELF `.init_array`.
init-array = []
# Enable support for ELF `.fini_array`.
fini-array = []
# Enable support for `origin::program::at_exit`.
program-at-exit = ["alloc"]
# Enable support for `origin::thread::at_exit`.
thread-at-exit = ["alloc", "thread"]
# Have origin call `atomic_dbg::log::init()` on startup.
#
# To have origin emit log messages for the things it does, additionally enable the
# "log" feature.
atomic-dbg-logger = ["atomic-dbg/log", "init-array"]
# Have origin call `env_logger::init()` on startup.
#
# To have origin emit log messages for the things it does, additionally enable the
# "log" feature.
env_logger = ["dep:env_logger", "init-array"]
# Disable logging.
max_level_off = ["log/max_level_off"]
# Enable highly experimental support for performing startup-time relocations,
# needed to support statically-linked PIE executables.
experimental-relocate = ["rustix/mm", "rustix/runtime"]
# Enable unstable support for storing C errno values in the TLS header. This
# will likely be removed in the future and only exists to make it easier to
# possibly integrate a dynamic linker written in C in the near future before
# until a dynamic linker is written in Rust.
unstable-errno = ["thread"]
# Have origin call `rustix::param::init` on startup.
param = ["rustix/param"]
# Provide a `#[lang = eh_personality]` function suitable for unwinding (for
# no-std).
#
# If you know your program never unwinds and want smaller code size, use
# "eh-personality-continue" instead.
#
# This is only needed in no-std builds, as std provides a personality. See
# [the "personality" feature of the unwinding crate] for more details.
#
# [the "personality" feature of the unwinding crate]: https://crates.io/crates/unwinding#personality-and-other-utilities
eh-personality = ["unwinding/personality"]
# Provide a `#[lang = eh_personality]` function that just returns
# `CONTINUE_UNWIND` (for no-std). Use this if you know your program will never
# unwind and don't want any extra code.
eh-personality-continue = ["unwinding?/personality-dummy"]
# Provide a `#[panic_handler]` function suitable for unwinding (for no-std).
#
# If you know your program never panics and want smaller code size, use
# "panic-handler-trap" instead.
#
# This is only needed in no-std builds, as std provides a panic handler. See
# [the "panic-handler" feature of the unwinding crate] for more details.
#
# [the "panic-handler" feature of the unwinding crate]: https://crates.io/crates/unwinding#personality-and-other-utilities
panic-handler = ["unwinding/panic-handler"]
# Provide a `#[panic_handler]` function that just traps (for no-std). Use this
# if you know your program will never panic and don't want any extra code.
panic-handler-trap = ["unwinding?/panic-handler-dummy"]
# Enable this to define a C ABI-compatible `getauxval` function. Most Rust code
# should use functions in [`rustix::param`] instead.
#
# [`rustix::param`]: https://docs.rs/rustix/latest/rustix/param/index.html
getauxval = ["rustix/param"]
# Enable features which depend on Rust's std.
std = ["rustix/std", "bitflags/std", "alloc"]
# Enable features which depend on the Rust global allocator, such as functions
# that return owned strings or `Vec`s.
alloc = ["rustix/alloc", "smallvec"]
# Use this iff you're experimenting with using origin from within Rust's
# standard library implementation.
rustc-dep-of-std = [
"dep:core",
"dep:alloc",
"linux-raw-sys/rustc-dep-of-std",
"bitflags/rustc-dep-of-std",
"rustix/rustc-dep-of-std",
"unwinding?/rustc-dep-of-std",
"libc?/rustc-dep-of-std",
"rustix-futex-sync/rustc-dep-of-std",
]
[package.metadata.docs.rs]
features = ["origin-start", "signal", "program-at-exit", "thread-at-exit", "nightly"]