Skip to content

Compile error on RISC-V due to .insn (llvm<=13 only) #1291

Closed
@XieJiSS

Description

@XieJiSS

I'd like to create this issue to track the status of compiling .insn i 0x0F, 0, x0, x0, 0x010 directives, as well as pause / fence w,0 (these three are aliases)

Currently with clang 13.0.1, this error occurs when compiling rust:

error: unknown directive
   |
note: instantiated into assembly here
  --> <inline asm>:1:2
   |
1  |     .insn i 0x0F, 0, x0, x0, 0x010
   |     ^

error: could not compile `log` due to previous error

This is introduced by 597b8e8. I'm not saying that the commit itself has issues: rust can use this safely because rust-lang/llvm-project has cherry-picked the upstream commit to support .insn: rust-lang/rust#91528. However, for those using clang v13.0.1 (or, let's say, the unmodified llvm toolchain), they may encounter this issue during compiling. Hence, I create this issue as a explanation as well as tracking the status of llvm support for .insn.

The code should compile fine with clang 14.

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