This patch add Triple::riscv64 and Triple::riscv32 to getBitcodeMachineKind for get right e_machine.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Is this a part of a series of patches? If so, please merge this into another patch as this is perhaps too small. Doing that should allow you to write a test.
Comment Actions
@ruiu This patch is useful on its own: it allows linking bitcode files with lld. As an example, we use ThinLTO in Rust to perform simple assembly inlining. Without lld support it is impossible to use ThinLTO with RISC-V target.
Comment Actions
For riscv64, you can write a test (placed under test/ELF/lto/) like this:
; REQUIRES: riscv ; RUN: llvm-as %s -o %t.o ; RUN: ld.lld %t.o -o %t target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n64-S128" target triple = "riscv64-unknown-elf" define void @f() { ret void }