I have read some webpages and articles about llvm and I am quite interested in this project. (Maybe to learn something about compiler writing without the need to struggle with the complicated points of x86).
There are pages that describe how to write llvm assembly and how to assemble it, but I did not find anything on what kind of environment is needed to actually execute these. I know that I could run llvm-gcc on my files to get an object file that is executable in a C-context. But in the case that I don't want to use the C runtime environmen (libc.so
and friends), what is needed to run llvm code? Is there any documentation on that?
DESCRIPTION. llvm-as is the LLVM assembler. It reads a file containing human-readable LLVM assembly language, translates it to LLVM bitcode, and writes the result into a file or to standard output.
The llc command compiles LLVM source inputs into assembly language for a specified architecture. The assembly language output can then be passed through a native assembler and linker to generate a native executable.
The LLVM code representation is designed to be used in three different forms: as an in-memory compiler IR, as an on-disk bitcode representation (suitable for fast loading by a Just-In-Time compiler), and as a human readable assembly language representation.
You can think of LLVM IR as a platform-independent assembly language with an infinite number of function local registers. When developing compilers there are huge benefits with compiling your source language to an intermediate representation (IR) 1 instead of compiling directly to a target architecture (e.g. x86).
There appears to be an LLVM assembler.
llvm-as is the LLVM assembler. It reads a file containing human-readable LLVM assembly language, translates it to LLVM bitcode, and writes the result into a file or to standard output.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With