Skip to content

Can't compile for thumbv6-none-eabi #33

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

Closed
japaric opened this issue Aug 13, 2016 · 0 comments
Closed

Can't compile for thumbv6-none-eabi #33

japaric opened this issue Aug 13, 2016 · 0 comments

Comments

@japaric
Copy link
Member

japaric commented Aug 13, 2016

Because some of our assembly implementation use thumb2 instructions that aren't available for it.

$ xargo build --target thumbv6m-none-eabi
   Compiling rustc_builtins v0.1.0 (file:///home/japaric/tmp/rustc-builtins)
error: <inline asm>:5:11: error: instruction requires: thumb2
          ldr r1, [sp], #4
          ^

  --> src/arm.rs:8:5
   |
8  |     asm!("push {lr}
   |     ^

error: <inline asm>:2:11: error: instruction requires: thumb2
          sub r12, sp, #12
          ^

  --> src/arm.rs:20:5
   |
20 |     asm!("push {lr}
   |     ^

error: <inline asm>:3:11: error: instruction requires: arm-mode
          str r12, [sp, #-20]!
          ^

  --> src/arm.rs:20:5
   |
20 |     asm!("push {lr}
   |     ^

error: <inline asm>:5:11: error: instruction requires: arm-mode
          ldrd r2, r3, [sp, #8]
          ^

  --> src/arm.rs:20:5
   |
20 |     asm!("push {lr}
   |     ^

error: aborting due to 4 previous errors

error: Could not compile `rustc_builtins`.

To learn more, run the command again with --verbose.
error: `cargo` process didn't exit successfully

Possible solutions:

  • Change the assembly implementations to not use thumb2 instructions.
  • Add a special implementation just for this target. The problem is that, AFAIK, there's no cfg argument that handles this conditional compilation. We'll likely need some way to cfg on the arch component of llvm-target.

cc @Amanieu

tgross35 pushed a commit to tgross35/compiler-builtins that referenced this issue Feb 23, 2025
80: Add sin and cos r=japaric a=porglezomp

Closes rust-lang#11 
Closes rust-lang#33

Co-authored-by: C Jones <[email protected]>
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

1 participant