7

I would like to generate a fully linked LLVM bitcode file from Rust source code which could be executed by LLVM IR interpreters such as lli. I found solutions such as one from Reddit and another one from Stack Overflow, but they didn't provide enough guidance or could not make fully linked ones.

I hope there could be some detailed guidance here.

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
zsf222
  • 345
  • 1
  • 10
  • Never used Rust, but I suspect you need to compile your sources with `rustc --emit=llvm-ir` and then use `llvm-link` to link resulting bitcode files into a single one. – arrowd Jun 12 '19 at 07:26
  • @arrowd I have tried the method on a hello world code, but there is a segmentation fault when running it with `lli` . – zsf222 Jun 13 '19 at 02:57
  • I think you mean fully linked, *interpretable* LLVM bitcode. – Olsonist Feb 02 '22 at 04:07

0 Answers0