-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/checkout/src/libcore/num/mod.rs:920: undefined reference to `__muloti4' when using core::num methods in a no-std staticlib #48339
Comments
The funny thing is that this is all triggered by |
Indeed, this all still happens when replacing the body of the foo function with |
The
error is because panic_fmt was not properly exported. It's missing |
The core problem here seems to be that libcompiler-builtins is not linked in, while it is when building without no-std. |
Cc @japaric I think it is one of the issues you mentioned on http://blog.japaric.io/embedded-rust-in-2018/ (or close to one of them) |
That's because |
There are actually two problems in one here. One is that somehow the implementation for The second is that when it's pulled in, legitimately or not, you end up with a dependency on a |
Clarification: By this I guess you mean more "not stripped out", right? i.e., the implementation for
This seems to interact with @aturon's proposal to deprecate the facade and move towards something more like cargo features. If we did so, it'd be no problem for us to bring in supplemental libraries in addition to core. cc @jethrogb -- I'm not really clear on what the "state of the art" is here. I had a look around the portability WG repo but I wasn't sure just what I was looking for. =) |
In the case of the code I pasted when filing this issue, it's "just" a problem of it not being stripped out. In fact, passing Also note that the problem does happen without involving a non-rust compiler, on Windows: it seems cargo doesn't pass the equivalent to |
ok so the bigger priority is to find a way to supply it. |
This issue would be fixed by #49380. |
Yes, this is now fixed. |
STR:
Note this happens whether you actually use
overflowing_mul
or not: anything that uses a function from core::num triggers this because of how the linker works.The following also appears:
which is surprising when building with panic=abort.
Somehow, building without --release (but adding panic=abort to profile.dev) adds another error:
The text was updated successfully, but these errors were encountered: