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

'eh_personality' not found when building from another directory #67

Closed
hug-dev opened this issue Jan 31, 2019 · 2 comments
Closed

'eh_personality' not found when building from another directory #67

hug-dev opened this issue Jan 31, 2019 · 2 comments

Comments

@hug-dev
Copy link
Contributor

hug-dev commented Jan 31, 2019

Problem

When a cortex-m-quickstart project is built from another directory using
cargo build --manifest-path=oof-test/Cargo.toml
command it fails with the following output:

[hug-dev@machine tmp]$ cargo build --manifest-path=oof-test/Cargo.toml
   Compiling semver-parser v0.7.0
   Compiling proc-macro2 v0.4.26
   Compiling unicode-xid v0.1.0
   Compiling rand_core v0.4.0
   Compiling vcell v0.1.0
   Compiling cortex-m v0.5.8
   Compiling aligned v0.2.0
   Compiling cortex-m-semihosting v0.3.2
   Compiling cortex-m-rt v0.6.7
   Compiling r0 v0.2.2
   Compiling oof-test v0.1.0 (/tmp/oof-test)
   Compiling panic-halt v0.2.0
   Compiling volatile-register v0.2.0
   Compiling rand_core v0.3.1
   Compiling rand v0.5.6
   Compiling semver v0.9.0
   Compiling rustc_version v0.2.3
   Compiling bare-metal v0.2.4
   Compiling quote v0.6.11
   Compiling syn v0.15.26
   Compiling cortex-m-rt-macros v0.1.5
error: language item required, but not found: `eh_personality`

error: aborting due to previous error

error: Could not compile `oof-test`.

To learn more, run the command again with --verbose.

How to reproduce

  • rustc 1.34.0-nightly (147311c5f 2019-01-30)
  • cargo generate --git https://github.com/rust-embedded/cortex-m-quickstart
  • Project name: oof-test
  • cargo build --manifest-path=oof-test/Cargo.toml

Why is it a problem?

I would like to create a Rust workspace with multiple cortex-m-quickstart projects, but because of that I can not. The workaround I did is to have a script that pushd into the Cargo projects and cargo build from there. Could be nice to have that working!

@japaric
Copy link
Member

japaric commented Feb 7, 2019

'eh_personality' not found

You get this error when you compile cortex-m crates for the host. To cross compile you need cargo build --target thumbv7m-none-eabi for example. You don't need the --target to cross compile within the quickstart directory because .cargo/config sets the default compilation target to thumbv7m-none-eabi (for example).

@hug-dev
Copy link
Contributor Author

hug-dev commented Feb 7, 2019

Oh yes that is because I was outside of the project directory that cargo did not pick the target information from .cargo/config. Adding --target works!

@hug-dev hug-dev closed this as completed Feb 7, 2019
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