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

Cargo doesn't work out of the box for Cortex-M micros #9

Closed
japaric opened this issue Sep 29, 2016 · 7 comments
Closed

Cargo doesn't work out of the box for Cortex-M micros #9

japaric opened this issue Sep 29, 2016 · 7 comments
Labels
feb-2019-cleanup These issues are proposed to be closed, as part of a cleanup of issues in February 2019 in-progress microcontroller upstream

Comments

@japaric
Copy link
Member

japaric commented Sep 29, 2016

The Rust compiler supports the Cortex-M architecture but this doesn't work out of the box:

$ cargo build --target thumbv6m-none-eabi

for two reasons:

  • thumbv6m-none-eabi is not a "built-in" target so you have to supply your own target definition.
  • cargo build doesn't compile the standard crates and there's no binary release of the standard
    crates for this target.

The upstream solution is to either:

  • Add the thumb targets to the compiler and also provide binary releases of the standard crates
    for them. Or,
  • Just add the targets and teach Cargo how to build the standard libraries "on the fly".

This is being worked on. Seems like the Rust team is leaning towards the second solution. You can
track the upstream status in:

@japaric
Copy link
Member Author

japaric commented Oct 5, 2016

Update: The target definitions have landed upstream in rust-lang/rust#36874.

@thejpster
Copy link
Contributor

This upstream change is excellent. I'll go and delete the custom targets from primer immediately.

Is it possible to set a default target for a crate? If we have a one-board-per-crate model then specifying the crate seems redundant.

@japaric
Copy link
Member Author

japaric commented Oct 16, 2016

Is it possible to set a default target for a crate?

Not using a crate, no. You can use .cargo/config but that's "local" to the current project and doesn't get passed up to the top crate if set in one of the dependencies.

This "feature" has been mentioned before in the issue tracker before though (can't find the comment right now).

@japaric
Copy link
Member Author

japaric commented May 18, 2017

In the short term I hope to make binary releases of the core, compiler-builtins, etc. crates for the thumb targets available and installable via rustup; that should let us drop the dependency on Xargo for those targets.

@japaric
Copy link
Member Author

japaric commented Jun 3, 2017

In the short term I hope to make binary releases of the core, compiler-builtins, etc. crates for the thumb targets available and installable via rustup; that should let us drop the dependency on Xargo for those targets.

One blocker to do this is landing the compiler-builtins crate into rust-lang/rust as we require a libcompiler_builtins crate that contains weak memcpy et al symbols in the sysroot to make all this work.
If someone wants to help with that this comment explains what needs to be done.

@jamesmunns jamesmunns added the feb-2019-cleanup These issues are proposed to be closed, as part of a cleanup of issues in February 2019 label Feb 3, 2019
@jamesmunns
Copy link
Member

I believe now that some embedded targets have landed, we can close this issue. Marking this for a cleanup sweep. If we would like this to stay open, please provide an update to what this issue should be focused on.

@jamesmunns
Copy link
Member

I am closing this issue, please feel free to open another issue if you would like this discussed further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feb-2019-cleanup These issues are proposed to be closed, as part of a cleanup of issues in February 2019 in-progress microcontroller upstream
Projects
None yet
Development

No branches or pull requests

3 participants