| Issue |
74081
|
| Summary |
[RISCV] Cannot generate RISCV executable binary from RISCV assembly code with Clang/LLVM
|
| Labels |
clang
|
| Assignees |
|
| Reporter |
Alexix24
|
Hi,
I'm trying to generate an executable riscv binary (kernel.bin) from a riscv assembly code (kernel.s).
- Using the riscv-none-embed-gcc toolchain, the binary is succesfully generated and I can run it on my device:
```sh
riscv-none-embed-as kernel.s -o kernel.o
riscv-none-embed-ld kernel.o -o kernel.elf
riscv-none-embed-objcopy -O binary kernel.elf kernel.bin
```
- But when I try to do the same process with Clang/LLVM (v17.0.5), the binary is not executed on my device:
```sh
clang -c -target riscv32 -march=rv32ia kernel.s -o kernel.elf
llvm-objcopy kernel.elf -O binary kernel.bin
```
Maybe I'm using the wrong Clang/LLVM commands, or with the wrong arguments? I see that the two .elf files are different.
Thanks !
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs