Cargo Features

[dependencies]
origin = { version = "0.23.2", default-features = false, features = ["nightly", "optimize_for_size", "take-charge", "origin-start", "external-start", "thread", "signal", "init-fini-arrays", "init-array", "fini-array", "program-at-exit", "thread-at-exit", "atomic-dbg-logger", "env_logger", "max_level_off", "experimental-relocate", "unstable-errno", "param", "eh-personality", "eh-personality-continue", "panic-handler", "panic-handler-trap", "getauxval", "std", "alloc", "rustc-dep-of-std", "libc", "errno"] }
default = errno, init-fini-arrays, libc, log, program-at-exit, signal, std, thread-at-exit

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".

nightly = unwinding

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.

optimize_for_size

Enable optimizations that reduce code size (at the cost of performance).

take-charge external-start? origin-start?

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.

Enables runtime and use-explicitly-provided-auxv of rustix

origin-start = take-charge

Enable "take-charge" mode using origin's _start definition.

external-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".

Affects linux_raw::start

thread thread-at-exit unstable-errno? = param, rustix-futex-sync

Enable support for threads.

Enables mm, process, runtime and thread of rustix

Affects origin::thread

signal default

Enable support for signal handlers.

Enables runtime of rustix

Affects origin::signal

init-fini-arrays default = fini-array, init-array

Enable support for ELF .init_array and .fini_array.

init-array atomic-dbg-logger? env_logger? init-fini-arrays

Enable support for ELF .init_array.

fini-array init-fini-arrays

Enable support for ELF .fini_array.

program-at-exit default = alloc

Enable support for origin::program::at_exit.

Affects libc::at_exit, linux_raw::at_exit

thread-at-exit default = alloc, thread

Enable support for origin::thread::at_exit.

Affects libc::at_exit, linux_raw::at_exit

atomic-dbg-logger = init-array

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.

Enables log of atomic-dbg

Enable atomic-dbg's simple logger. This doesn't require std.

env_logger = 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.

Enables env_logger

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.

max_level_off

Disable logging.

Enables max_level_off of log

experimental-relocate

Enable highly experimental support for performing startup-time relocations,
needed to support statically-linked PIE executables.

Enables mm and runtime of rustix

unstable-errno = thread

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.

Affects libc::errno_location, linux_raw::errno_location

param thread?

Have origin call rustix::param::init on startup.

Enables param of rustix

eh-personality

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.

Enables personality of unwinding

eh-personality-continue

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.

Enables personality-dummy of optional unwinding

panic-handler

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.

Enables panic-handler of unwinding

panic-handler-trap

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.

Enables panic-handler-dummy of optional unwinding

getauxval

Enable this to define a C ABI-compatible getauxval function. Most Rust code should use functions in rustix::param instead.

Enables param of rustix

std default = alloc

Enable features which depend on Rust's std.

Enables std of bitflags and rustix

alloc program-at-exit std thread-at-exit = smallvec

Enable features which depend on the Rust global allocator, such as functions that return owned strings or Vecs.

Enables alloc of rustix

rustc-dep-of-std

Use this iff you're experimenting with using origin from within Rust's standard library implementation.

Enables rustc-std-workspace-alloc, rustc-dep-of-std of bitflags and rustc-std-workspace-core

Special dependencies used in rustc-dep-of-std mode.

and rustc-dep-of-std of linux-raw-sys ^0.4.9, rustix, rustix-futex-sync, optional libc, and optional unwinding

libc:

Enable this when disabling origin's implementations.

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

log default max_level_off?
rustix-futex-sync rustc-dep-of-std? thread?
smallvec alloc?
atomic-dbg atomic-dbg-logger?
libc default
errno default
unwinding unwind not arm eh-personality? nightly? panic-handler?