-
Notifications
You must be signed in to change notification settings - Fork 25
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
How to build *compiler_builtins* in optimized mode #77
Comments
This isn't a bug in Line 120 in df6db07
This issue you're hitting is rust-lang/compiler-builtins#339 which notes that the builtin memcpy implementation is just a simple un-optimized for-loop. If you want the The For example, if you enable |
Note that you can also link a custom memcpy implementation. For example, I got something working using musl via the following steps:
Note that this approach is very application specific. Your
Finally, note that this complexity may not be worth it. Depending on your application, optimizing memcpy might have very little effect, as usually memory speed is the bottleneck for these sorts of operations. |
@josephlr Thank you very much! Your detailed guide helps us a lot! We tried using Redox's implementation but found it not very fast and kinda buggy(there's an infinite recursion in |
@tjhu rust-lang/compiler-builtins#365 makes it so x86_64 targets will now build with a highly optimized @phil-opp I think this can be closed. |
Hi,
When we run
cargo xbuild --release ... --target x86_64-kernel.json
, thememcpy
being compiled is just a simple un-optimized for-loop. Looking at the source code, I think xargo builds sysroot crates in release mode by default.I think there's something else in our settings that prevents xargo from building an optimized compiler_builtins but I am not sure what am I missing. We borrowed some of the setups, including the
target.json
, from Writing an OS in Rust.The text was updated successfully, but these errors were encountered: