-
Notifications
You must be signed in to change notification settings - Fork 8
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
compiler_builtins
seems to be missing symbols
#53
Comments
One workaround is to add a dependency on |
@alexcrichton can you verify — the reason the That's a serious complication for building |
Ah yes, this is something we'll need to handle. Most platforms don't enable the How Cargo would know what to do here is... unknown. Although arguably if we "fix" target-specific features we could have target-specific dependencies on |
This is relevant for the msp430 target, FWIW. Two solutions are to bring in However, when I do debug builds with |
Note: there are two semi-related things that need some investigation:
|
I am building for a no_std platform, where I have to supply the mem functions (all flash access must be word aligned), unfortunately with the merge of rust-lang/compiler-builtins#357 I can't find a way to opt out of the Any suggestions? Are there any longer term plans to allow the |
The |
@josephlr I think it'd Just Work if |
@DianaNites Will that work when using |
@toothbrush7777777 I don't see why it would? If you're asking for just core to be built, why would it build compiler_builtins? |
@DianaNites I read somewhere that |
It's also my understanding that |
Ah yeah requiring alloc, good point. Though idk if it actually does? build-std is weird, and build-std-features even weirder, they're the features of core doesn't list any dependencies, so idk. Might it just rely on the symbols compiler_builtins provides, during linking? |
This is essentially correct. Right now, feature resolution is done though the
You're correct, building
This (building
This is correct. |
This fixes rust-lang/wg-cargo-std-aware#53 Now users will be able to do: ``` cargo build -Zbuild-std=core -Zbuild-std-features=compiler-builtins-mem ``` and correctly get the Rust implemenations for `memcpy` and friends. Signed-off-by: Joe Richey <joerichey@google.com>
@tomaka @alexcrichton this can be closed now that rust-lang/rust#77284 is merged. |
@josephlr I wouldn't consider that a complete fix for this issue, as it appears to require manually setting the |
If you're building for a custom target, you will have to tell cargo whether or not your platform provides implementations of |
Actually, @ehuss I think you might be on to something here. In an ideal world, users would be able to override Here's how I think this all should work long-term:
This would be the idea state of affairs in my opinion, but it probably requires some subset of rust-lang/rust#29603 to be on a path to stabilization before we can use it. Note that This might be possible in the future, but probably can't be done right now. |
This issue made it impossible to use -Zbuild-std without implementing the memory related symbols required by the core lib such as memcpy, memset, etc yourself. rust-lang/wg-cargo-std-aware#53 After this PR you can now tell cargo that your platform supports these mem features and just use the built in implementations in rustc.
FYI, I submitted rust-lang/compiler-builtins#411 a few years ago and it's been possible to override the memcpy and family of functions downstream ever since. |
This is the continuation of rust-lang/compiler-builtins#334
When compiling a pure Rust crate with
-Zbuild-std=core,alloc
, I get missing symbols errors for everything related to memcpying (memcpy
,memset
).This is covered by the
mem
feature ofcompiler_builtins
, which for a reason I don't understand isn't enabled by default.Until mid-December can be solved by explicitly depending on
compilter_builtins
with themem
feature. However, one of the nightlies broke this and when doing so one now gets:I believe that the original cause is the features not enabled on
compiler_builtins
.The text was updated successfully, but these errors were encountered: