@@ -58,56 +58,41 @@ features = ["param"]
5858assert_cmd = " 2.0.12"
5959
6060[features ]
61- default = [ " std " , " log " , " libc" , " errno " , " thread " , " init-fini-arrays " , " program-at-exit " , " thread-at-exit " ]
62- std = [ " rustix/std " , " bitflags/std " , " alloc " ]
63- rustc-dep-of-std = [
64- " dep:core " ,
65- " dep:alloc " ,
66- " linux-raw-sys/rustc-dep-of-std " ,
67- " bitflags/rustc-dep-of-std " ,
68- " rustix/rustc-dep-of-std " ,
69- " unwinding?/rustc-dep-of-std " ,
70- " libc?/rustc-dep-of-std " ,
71- " rustix-futex-sync/rustc-dep-of-std " ,
72- ]
61+ # By default, origin coexists with libc and assume std exists and enables most
62+ # features. To have origin avoid using libc, disable the default features and
63+ # enable either "origin-start" or "external-start".
64+ default = [ " std " , " log " , " libc " , " errno " , " signal " , " init-fini-arrays " , " program-at-exit " , " thread-at-exit " ]
65+
66+ # If you're using nightly Rust, enable this feature to let origin use
67+ # nightly-only features, which include proper support for unwinding, better
68+ # safety checks, and better optimizations.
69+ nightly = [ " unwinding" ]
70+
71+ # Enable optimizations that reduce code size (at the cost of performance).
72+ optimize_for_size = [ ]
7373
7474# Use origin's implementation of program and thread startup and shutdown as
75- # well as signal handler registration.
75+ # well as signal handler registration. To use this, disable the default
76+ # features and enable exactly one of "origin-start" or "external-start".
7677#
7778# To use threads, it is also necessary to enable the "thread" feature.
7879# To use signals, it is also necessary to enable the "signal" feature.
7980take-charge = [" rustix/use-explicitly-provided-auxv" , " rustix/runtime" ]
8081
81- # Use origin's `_start` definition.
82+ # Enable "take-charge" mode using origin's `_start` definition.
8283origin-start = [" take-charge" ]
8384
84- # Don't use origin's `_start` definition, but export a `start` function which
85- # is meant to be run very early in program startup and passed a pointer to
86- # the initial stack. Don't enable this when enabling "origin-start".
85+ # Enable "take-charge" mode using an exported `start` function which is meant
86+ # to be run very early in program startup and passed a pointer to the initial
87+ # stack. Don't enable this when enabling "origin-start".
8788external-start = [" take-charge" ]
8889
89- # The loggers depend on a `.init_array` entry to initialize themselves, and
90- # `env_logger` needs it so that `c-scape` can initialize environment variables
91- # and make `RUST_LOG` available.
92- atomic-dbg-logger = [" atomic-dbg/log" , " init-array" ]
93- env_logger = [" dep:env_logger" , " init-array" ]
94-
95- # Disable logging.
96- max_level_off = [" log/max_level_off" ]
97-
98- # Enable features which depend on the Rust global allocator, such as functions
99- # that return owned strings or `Vec`s.
100- alloc = [" rustix/alloc" , " smallvec" ]
101-
10290# Enable support for threads.
10391thread = [" rustix/thread" , " rustix/mm" , " param" , " rustix/process" , " rustix/runtime" , " rustix-futex-sync" ]
10492
10593# Enable support for signal handlers.
10694signal = [" rustix/runtime" ]
10795
108- # Have origin call `rustix::param::init`.
109- param = [" rustix/param" ]
110-
11196# Enable support for ELF `.init_array` and `.fini_array`.
11297init-fini-arrays = [" init-array" , " fini-array" ]
11398
@@ -123,6 +108,21 @@ program-at-exit = ["alloc"]
123108# Enable support for `origin::thread::at_exit`.
124109thread-at-exit = [" alloc" , " thread" ]
125110
111+ # Have origin call `atomic_dbg::log::init()` on startup.
112+ #
113+ # To have origin emit log messages for the things it does, additionally enable the
114+ # "log" feature.
115+ atomic-dbg-logger = [" atomic-dbg/log" , " init-array" ]
116+
117+ # Have origin call `env_logger::init()` on startup.
118+ #
119+ # To have origin emit log messages for the things it does, additionally enable the
120+ # "log" feature.
121+ env_logger = [" dep:env_logger" , " init-array" ]
122+
123+ # Disable logging.
124+ max_level_off = [" log/max_level_off" ]
125+
126126# Enable highly experimental support for performing startup-time relocations,
127127# needed to support statically-linked PIE executables.
128128experimental-relocate = [" rustix/mm" , " rustix/runtime" ]
@@ -133,13 +133,8 @@ experimental-relocate = ["rustix/mm", "rustix/runtime"]
133133# until a dynamic linker is written in Rust.
134134unstable-errno = [" thread" ]
135135
136- # If you're using nightly Rust, enable this feature to let origin use
137- # nightly-only features, which include proper support for unwinding, better
138- # safety checks, and better optimizations.
139- nightly = [" unwinding" ]
140-
141- # Enable optimizations that reduce code size (at the cost of performance).
142- optimize_for_size = []
136+ # Have origin call `rustix::param::init` on startup.
137+ param = [" rustix/param" ]
143138
144139# Provide a `#[lang = eh_personality]` function suitable for unwinding (for
145140# no-std).
@@ -176,5 +171,25 @@ panic-handler-abort = ["unwinding?/panic-handler-dummy"]
176171# Enable this to define the `getauxval` function.
177172getauxval = [" rustix/param" ]
178173
174+ # Enable features which depend on Rust's std.
175+ std = [" rustix/std" , " bitflags/std" , " alloc" ]
176+
177+ # Enable features which depend on the Rust global allocator, such as functions
178+ # that return owned strings or `Vec`s.
179+ alloc = [" rustix/alloc" , " smallvec" ]
180+
181+ # Use this iff you're experimenting with using origin from within Rust's
182+ # standard library implementation.
183+ rustc-dep-of-std = [
184+ " dep:core" ,
185+ " dep:alloc" ,
186+ " linux-raw-sys/rustc-dep-of-std" ,
187+ " bitflags/rustc-dep-of-std" ,
188+ " rustix/rustc-dep-of-std" ,
189+ " unwinding?/rustc-dep-of-std" ,
190+ " libc?/rustc-dep-of-std" ,
191+ " rustix-futex-sync/rustc-dep-of-std" ,
192+ ]
193+
179194[package .metadata .docs .rs ]
180- features = [" origin-start" , " thread " , " signal" , " program-at-exit" , " thread-at-exit" , " nightly" ]
195+ features = [" origin-start" , " signal" , " program-at-exit" , " thread-at-exit" , " nightly" ]
0 commit comments