Unable to build 'no_std' crate into dylib #104159
Labels
A-lang-item
Area: Language items
A-linkage
Area: linking into static, shared libraries and binaries
A-runtime
Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows
Hi folks,
I am having an issue of building a dylib with no_std.
After adding the missing language items, the compilation is fine.
But linking the product (libnostd_dylib.so) into an executable gives me duplicate language items.
As others have pointed out (https://stackoverflow.com/questions/43097676/how-to-build-a-standard-linux-so-library-with-stable-rust-without-using-std), an end product such as a binary executable needs panic handlers and exception handling routines to run. I can understand that. I may also partially get/accept the point that a shared library could be an end product (perhaps it would be better if someone could name an example).
But what I feel quite confusing is that, most of the time, the dylib could be intermediate (I know it will be linked by other crates/executables), and those crates (or libstd) will ultimately provide these language items, so how can I produce a no_std dylib without providing these two language items in this crate itself?
The text was updated successfully, but these errors were encountered: