🍺 BREW Explorer

← all formulae

flip-link

brew install flip-link v0.1.12 Apache-2.0 OR MIT

Adds zero-cost stack overflow protection to your embedded programs

3
30-day installs · #12017
12
90-day · #11295
154
365-day · #8030
421
★ GitHub stars · updated 2mo ago

Build dependencies

GitHub topics

embedded embedded-rust ferrous-systems linkers rust rust-tools tooling

Links

Raw metadata
{
  "aliases": [],
  "alternatives": [],
  "build_dependencies": [
    "rust"
  ],
  "categories": [],
  "caveats": null,
  "conflicts_with": [],
  "dependencies": [],
  "deprecated": 0,
  "deprecation_reason": null,
  "desc": "Adds zero-cost stack overflow protection to your embedded programs",
  "disable_reason": null,
  "disabled": 0,
  "enrichment_fetched_at": "2026-06-20T23:37:42+00:00",
  "first_seen": "2026-06-20T23:34:18+00:00",
  "full_name": "flip-link",
  "github_default_branch": "main",
  "github_last_commit_at": "2026-06-12T14:31:08Z",
  "github_readme_excerpt": "# `flip-link`\n\n\u003e adds zero-cost stack overflow protection to your embedded programs\n\n## The problem\n\nBare metal Rust programs may *not* be memory safe in presence of stack overflows.\nFor example, this is the case for Rust programs based on v0.6.x of the `cortex-m-rt` crate.\n\nThe following program, which contains no `unsafe` code block, can run into *undefined behavior* if it reaches a stack overflow condition.\n\n``` rust\n// static variables placed in the .bss / .data sections\nstatic FLAG1: AtomicBool = AtomicBool::new(false); // .bss\nstatic FLAG2: AtomicBool = AtomicBool::new(true);  // .data\n\nfn main() {\n    let _x = fib(100);\n}\n\n#[inline(never)]\nfn fib(n: u32) -\u003e u32 {\n    // allocate and initialize 4 kilobytes of stack memory\n    let _use_stack = [0xAA; 1024];\n\n    if n \u003c 2 {\n        1\n    } else {\n        fib(n - 1) + fib(n - 2) // recursion\n    }\n}\n\n#[interrupt]\nfn interrupt_handler() {\n    // does some operation with `FLAG1` and `FLAG2`\n}\n```\n\nThe default memory layout of ARM Cortex-M programs in RAM is shown below.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/overflow.svg\" alt=\"left: default memory layout of ARM Cortex-M programs; right: stack overflow condition\"\u003e\n\u003c/p\u003e\n\nThe function call stack, also known as the \"stack\", grows downwards on function calls and when local variables (e.g. `let x`) are created (these variables are also placed on the stack).\n\nIf the stack grows too large it collides with the `.bss + .data` region, which contains all the program\u0027s static variables. The collision results in the static variables being overwritten with unrelated data. This can result in the program observing the static variables in an invalid state: for example an `AtomicBool` may hold the value `3` -- this is undefined behavior because the Rust ABI expects this single-byte variable to be either `0` or `1`.\n\n## The solution\n\nOne potential solution is to change the memory layout of the program and place the stack *below* the `.bss+.data` region.\n\nWith this flipped memory layou",
  "github_repo": "knurling-rs/flip-link",
  "github_stars": 421,
  "github_topics": [
    "embedded",
    "embedded-rust",
    "ferrous-systems",
    "linkers",
    "rust",
    "rust-tools",
    "tooling"
  ],
  "homepage": "https://github.com/knurling-rs/flip-link",
  "homepage_og_description": null,
  "homepage_og_image": null,
  "homepage_title": null,
  "installs_30d": 3,
  "installs_365d": 154,
  "installs_90d": 12,
  "keg_only": 0,
  "keg_only_reason": null,
  "last_seen": "2026-06-20T23:34:18+00:00",
  "license": "Apache-2.0 OR MIT",
  "llm_generated_at": null,
  "llm_model": null,
  "name": "flip-link",
  "oldnames": [],
  "one_liner": null,
  "optional_dependencies": [],
  "rank_30d": 12017,
  "rank_365d": 8030,
  "rank_90d": 11295,
  "raw_hash": "2fe506bc4e58e293",
  "recommended_dependencies": [],
  "revision": 0,
  "ruby_source_path": "Formula/f/flip-link.rb",
  "tap": "homebrew/core",
  "test_dependencies": [
    "rustup"
  ],
  "uses_from_macos": [],
  "version_head": null,
  "version_stable": "0.1.12",
  "versioned_formulae": [],
  "why_use_this": null
}