ID photo of Ciro Santilli taken in 2013 right eyeCiro Santilli OurBigBook logoOurBigBook.com  Sponsor 中国独裁统治 China Dictatorship 新疆改造中心、六四事件、法轮功、郝海东、709大抓捕、2015巴拿马文件 邓家贵、低端人口、西藏骚乱
Example: llvm/hello.ll adapted from: llvm.org/docs/LangRef.html#module-structure but without double newline.
To execute it as mentioned at github.com/dfellis/llvm-hello-world we can either use their crazy assembly interpreter, tested on Ubuntu 22.10:
sudo apt install llvm-runtime
lli hello.ll
This seems to use puts from the C standard library.
Or we can Lower it to assembly of the local machine:
sudo apt install llvm
llc hello.ll
which produces:
hello.s
and then we can assemble link and run with gcc:
gcc -o hello.out hello.s -no-pie
./hello.out
or with clang:
clang -o hello.out hello.s -no-pie
./hello.out
hello.s uses the GNU GAS format, which clang is highly compatible with, so both should work in general.

Ancestors (10)

  1. LLVM Intermediate Representation
  2. LLVM
  3. List of compilers
  4. Compiler
  5. Software
  6. Computer
  7. Information technology
  8. Area of technology
  9. Technology
  10. Home