Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zag-research/zig-llvm

Quick guide to compiling LLVM & Zig source files
https://github.com/zag-research/zig-llvm

compilation llvm zig

Last synced: 30 days ago
JSON representation

Quick guide to compiling LLVM & Zig source files

Awesome Lists containing this project

README

        

#### Compiling

The `builder_test` folder contains simple functions to test the LLVM IR builder from within Zig.
To execute, you'll need to download LLVM from source and provide the necessary compiler flags
Example of how to execute is shown below (might need to change path to LLVM headers and library files):
```bash
# Run from WSL
zig build-exe main.zig -lc++ -I/usr/lib/llvm-14/include -L /usr/lib/llvm-14/lib -lLLVM-14
```

The `link_test` folder contains simple functions to test linking LLVM IR with a zig file.
To execute:
```bash
clang -c add.ll -o add.o
zig build-exe main.zig add.o -femit-bin=main
./main.o
```

The `ll_output_test` folder contains a simple .c and .zig file. In
order to link the two together, see the README in that folder