Cargo Features

[dependencies]
compiler_builtins = { version = "0.1.109", default-features = false, features = ["c", "no-asm", "compiler-builtins", "mem", "mangled-names", "rustc-dep-of-std", "public-test-deps", "weak-intrinsics"] }
default = compiler-builtins

The compiler-builtins feature is set by default whenever compiler_builtins is added without default-features = false somewhere in the dependency tree.

c = cc

Enable compilation of C code in compiler-rt, filling in some more optimized implementations and also filling in unimplemented intrinsics

no-asm

Workaround for the Cranelift codegen backend. Disables any implementations which use inline assembly and fall back to pure Rust versions (if avalible).

compiler-builtins default rustc-dep-of-std?

Flag this library as the unstable compiler-builtins lib

mem

Generate memory-related intrinsics like memcpy

mangled-names

Mangle all names so this can be linked in with other versions or other compiler-rt implementations. Also used for testing

rustc-dep-of-std = compiler-builtins, core

Only used in the compiler's build system

public-test-deps

This makes certain traits and function specializations public that are not normally public but are required by the testcrate

weak-intrinsics

Marks all intrinsics functions with weak linkage so that they can be replaced at link time by another implementation. This is particularly useful for mixed Rust/C++ binaries that want to use the C++ intrinsics, otherwise linking against the Rust stdlib will replace those from the compiler-rt library.

Unlike the "c" feature, the intrinsics are still provided by the Rust implementations and each will be used unless a stronger symbol replaces it during linking.

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.

core rustc-dep-of-std?

Enables rustc-std-workspace-core

For more information on this dependency see rust-lang/rust's src/tools/rustc-std-workspace folder

cc build c?