-
Notifications
You must be signed in to change notification settings - Fork 214
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
add weak memcpy, memmove and memset #14
Conversation
I think this might just be a quirk of how the disassembly is shown when weak symbols are around. You need to link it into an executable to see the function that's actually being called. |
Hmm, I tested this with branch with one of my projects and I'm still seeing the recursive bomb. Also:
I'm going to try something different. |
OK, I know what's happening. The |
Oh sorry, |
#![feature(naked_functions)] | ||
#![no_builtins] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Amanieu It's already here
Hmm, maybe try |
I was using LTO in my other project. If I disable that then I don't get infinite recursion.
I didn't have to modify this branch. |
So, perhaps LTO is very important for my embedded projects ... |
Does |
Sadly, no. |
OK, one last thing to check, does the infinite recursion still happen if you remove |
Oh, and what happens if you add |
Fixed! With or without LTO:
|
This also fixes it. Keeping
|
OK, so here's what I think we should do: place weak versions of mem* in a separate crate which is compiled to a staticlib. Then link that staticlib into |
cc @Amanieu
The problem is that, with this change, intrinsics like
__aeabi_memcpy
get misoptimized to an infinitely recursive call: