Cargo Features

[dependencies]
origin = { version = "0.18.3", default-features = false, features = ["std", "rustc-dep-of-std", "origin-program", "origin-thread", "origin-signal", "origin-start", "external-start", "atomic-dbg-logger", "env_logger", "max_level_off", "alloc", "thread", "signal", "param", "init-fini-arrays", "init-array", "fini-array", "experimental-relocate", "unstable-errno", "libc", "errno"] }
default = errno, init-fini-arrays, libc, log, std, thread

These default features are set whenever origin is added without default-features = false somewhere in the dependency tree.

std default = alloc

Enables std of bitflags and rustix

rustix:

This enables use of std. Disabling this enables #![no_std], and requires Rust 1.64 or newer.

rustc-dep-of-std

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

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, unwinding, and optional libc

libc:

Enable this when disabling origin's implementations.

origin-program external-start? origin-start? origin-thread?

Use origin's implementation of program startup and shutdown.

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

origin-thread = memoffset, origin-program

Use origin's implementation of thread startup and shutdown.

To use threads, it's also necessary to enable the "thread" feature.

origin-signal

Use origin's implementation of signal handle registrtion.

To use threads, it's also necessary to enable the "signal" feature.

Enables runtime of rustix

origin-start = origin-program

Use origin's _start definition.

external-start = origin-program

Don't use origin's _start definition, but export a 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 program::start

atomic-dbg-logger = init-fini-arrays

The loggers depend on a .init_array entry to initialize themselves, and env_logger needs it so that c-scape can initialize environment variables and make RUST_LOG available.

Enables log of atomic-dbg

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

env_logger = init-fini-arrays

Enables env_logger

Optional logging backends for use with "origin-program". 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

alloc std = smallvec

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

Enables alloc of rustix

Affects program::at_exit, linux_raw::at_exit

thread default unstable-errno? = param, rustix-futex-sync

Enable support for threads.

Enables mm, process, runtime and thread of rustix

Affects origin::thread

signal

Enable support for signal handlers.

Enables runtime of rustix

Affects origin::signal

param thread

Enable support for rustix::param.

Enables param of rustix

init-fini-arrays default atomic-dbg-logger? env_logger? = fini-array, init-array

Enable support for ELF .init_array and .fini_array.

init-array init-fini-arrays

Enable support for ELF .init_array.

fini-array init-fini-arrays

Enable support for ELF .fini_array.

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

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.

memoffset origin-thread?
log default max_level_off?
rustix-futex-sync rustc-dep-of-std? thread
atomic-dbg atomic-dbg-logger?
libc default
errno default
smallvec alloc?