Using LLVM Target for RISCV (incompatibility error)

If you use llvm as your codegenerator, it will not generate double-float object file for riscv, I don’t know why, but it can’t, even though you add -mfloat-abi=hard, the workaround is save the code as a text assembly code and then call your cross compiler to generate object file.

for example

fadd = tvm.build(s, [A, B, C], tgt, name="myadd")
from tvm.contrib import cc
path = "lib/riscv.so"
fadd.save("lib/riscv.s")
cc.create_shared(path, ["lib/riscv.s"], cc="riscv64-unknown-linux-gnu-g++")