Skip to content

Fix embedded builds#49

Open
onur-ozkan wants to merge 2 commits into
awesomized:mainfrom
Orkavian:no-std-embedded-build
Open

Fix embedded builds#49
onur-ozkan wants to merge 2 commits into
awesomized:mainfrom
Orkavian:no-std-embedded-build

Conversation

@onur-ozkan

@onur-ozkan onur-ozkan commented Jun 5, 2026

Copy link
Copy Markdown

The Problem

crc-fast currently forces the library target to build as lib, cdylib and staticlib. When crc-fast is used as a dependency in a no_std embedded project, cargo still asks rustc to build those crate types.

The cdylib/staticlib outputs behave like final artifacts, so rustc requires crc-fast to provide a panic_impl. That pushes downstream libraries to enable crc-fast/panic-handler, which conflicts with embedded applications that already provide their own panic handler such as panic-halt.

The Solution

Build the library target as the default rust library output only and make no_std-visible code to use core::arch instead of std::arch.

Changes

  • Remove crate-type = ["lib", "cdylib", "staticlib"].
  • Switch std::arch to core::arch in avx512 module.

Remove forced cdylib/staticlib crate types from the library target as
that forces downstream embedded crates to enable crc-fast/panic-handler,
which then conflicts with the application's own panic handler.

Signed-off-by: Onur Özkan <work@onurozkan.dev>
This keeps the SIMD module usable when crc-fast is built
without std.

Signed-off-by: Onur Özkan <work@onurozkan.dev>
@onur-ozkan

Copy link
Copy Markdown
Author

This is currently blocking mavlink/rust-mavlink#497.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant