Skip to content

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

Closed
@japaric

Description

@japaric

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions