Fix embedded builds#49
Open
onur-ozkan wants to merge 2 commits into
Open
Conversation
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>
Author
|
This is currently blocking mavlink/rust-mavlink#497. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Problem
crc-fastcurrently forces the library target to build aslib,cdylibandstaticlib. Whencrc-fastis used as a dependency in ano_stdembedded project, cargo still asks rustc to build those crate types.The
cdylib/staticliboutputs behave like final artifacts, so rustc requirescrc-fastto provide apanic_impl. That pushes downstream libraries to enablecrc-fast/panic-handler, which conflicts with embedded applications that already provide their own panic handler such aspanic-halt.The Solution
Build the library target as the default rust library output only and make no_std-visible code to use
core::archinstead ofstd::arch.Changes
crate-type = ["lib", "cdylib", "staticlib"].std::archtocore::archin avx512 module.