Skip to content

Conversation

@mkroening
Copy link

Relying on stateful directives to persist across inline assembly instances is forbidden: https://doc.rust-lang.org/reference/inline-assembly.html#r-asm.directives.stateful

Without this patch, in some scenarios, trapframe fails to compile, since the macros XLENB, LOAD_SP, and STORE_SP may not be available:

error: operand must be a symbol with %lo/%pcrel_lo/%tprel_lo specifier or an integer in the range [-2048, 2047]
   |
note: instantiated into assembly here
  --> <inline asm>:17:18
   |
17 |     addi sp, sp, -34 * XLENB
   |                  ^

error: unrecognized instruction mnemonic
   |
note: instantiated into assembly here
  --> <inline asm>:21:5
   |
21 |     STORE_SP x1, 1
   |     ^
...
error: could not compile `trapframe` (lib) due to 99 previous errors

…m instances

Relying on stateful directives to persist across inline assembly instances is forbidden:
https://doc.rust-lang.org/reference/inline-assembly.html#r-asm.directives.stateful
@mkroening
Copy link
Author

CC: @simonschoening

@mkroening
Copy link
Author

This is the same issue as rust-embedded/riscv#321, which was resolved in rust-embedded/riscv#322.

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

Successfully merging this pull request may close these issues.

1 participant