Skip to content
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

Use link_args to alias arm builtins #39

Closed
wants to merge 2 commits into from

Conversation

mattico
Copy link
Contributor

@mattico mattico commented Aug 16, 2016

This is a bit of a hack, but it seems to me like the best way we have to create function aliases right now. It's up to you whether this is better than just having more function stubs.

Note that I haven't actually tested this yet as I don't have access to my arm toolchain.

@Amanieu
Copy link
Member

Amanieu commented Aug 16, 2016

arm-linux-gnueabi-gcc: error: unrecognized command line option '--defsym=__aeabi_memcpy8=__aeabi_memcpy'

Try using -Wl,--defsym=__aeabi_memcpy8=__aeabi_memcpy instead so that gcc passes the arguments to the linker.

@japaric
Copy link
Member

japaric commented Aug 16, 2016

I couldn't get this to work locally. When linking an executable (from cu), these --defsym arguments didn't appear in the linker arguments (as seen from -Z print-link-args) and I got "an undefined reference to __aeabi_memcpy4" error.

But if we can get this to work, then it seems fine to add to me. I don't know if these arguments are gcc specific but rustc only knows how to gcc as a linker, and no other linker, anyway so it doesn't matter. This change also seems easy to revert if link_args gets removed and removal shouldn't be visible by downstream users.

@Amanieu
Copy link
Member

Amanieu commented Aug 16, 2016

You need to mark these with #[cfg(not(test))].

@mattico
Copy link
Contributor Author

mattico commented Aug 16, 2016

Thanks for helping me code-by-proxy @Amanieu. I'm finally back on my real computer so I can test this myself, but I expect there aren't any changes left to make after that last one :P

@mattico
Copy link
Contributor Author

mattico commented Aug 16, 2016

@japaric I'll see if I can actually get this working locally now.

@japaric
Copy link
Member

japaric commented Sep 1, 2016

This is blocked by rust-lang/rust#36176. link_args are not propagated from rlibs to binaries.

@japaric
Copy link
Member

japaric commented Sep 14, 2016

re: link_args. Alex said:

This "feature" has basically always been slated for deprecation/removal.

So we can't really on link_args to do this :-(. Closing ...

Regardless, thanks for the PR @mattico!

@japaric japaric closed this Sep 14, 2016
@mattico mattico deleted the use_fn_alias branch September 14, 2016 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants