Maybe the problem is with va_list, try to compile with -mtriple=riscv64-unknown-linux -mcpu=generic-rv64