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

Symbols missing on AVR target #318

Closed
jonahbron opened this issue Oct 6, 2019 · 4 comments
Closed

Symbols missing on AVR target #318

jonahbron opened this issue Oct 6, 2019 · 4 comments

Comments

@jonahbron
Copy link

jonahbron commented Oct 6, 2019

When compiling to the avr-unknown-unknown platform using the compiler fork, I get errors about the following missing symbols.

  • __ashlsi3
  • __lshrsi3
  • __divmodti4
  • __ashrsi3

I'm trying to track down information on how to fix this. Someone in the original ticket I opened suggested I fork compiler-builtins and implement these intrinsics.

avr-rust/rust-legacy-fork#149 (comment)

I'd love any direction anyone can offer on whether this is really the correct approach, and how to add these, this is all super new to me. Thanks in advance.

@alexcrichton
Copy link
Member

Thanks for the report! These intrinsics haven't yet been ported to Rust yet, presumably because they haven't been needed by other targets. They can be added at any time though! You'll probably be editing src/int/*.rs, and there should be examples throughout there of how to write the intrinsics.

You'll need to consult gcc/clang though to see what the expected signature of these intrinsics are.

@jonahbron jonahbron reopened this Oct 23, 2019
@jonahbron
Copy link
Author

@alexcrichton I've run into some very interesting behavior. As soon as I make compiler-builtins a dependency with Xargo, my program suddenly compiles. This is odd, considering those missing symbols are not provided by compiler-builtins right now. However, the area of my application affected by these errors does not behave as expected still, despite now compiling.

@alexcrichton
Copy link
Member

Ah sorry I'm not entirely sure what's happening in that case, most things having to do with compiler-builtins tend to be very-specific bugs or difficult to reproduce.

@jonahbron
Copy link
Author

@alexcrichton It seems like things are in fact working (bugs in my own code it seems). I still have no idea why adding the compiler-builtins dependency magically fixes the problems when it doesn't have the symbols that the compiler is complaining about, but if it compiles I'm happy 🤷‍♂️

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

No branches or pull requests

2 participants