Skip to content

Commit

Permalink
feat: add lld linker
Browse files Browse the repository at this point in the history
  • Loading branch information
hongxuchen committed Nov 14, 2023
1 parent 60cbbdd commit a754ce2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/whole-program-llvm.md
Expand Up @@ -5,9 +5,13 @@ When applying analysis, we usually need to work on a `linked` LLVM bitcode file,
# using `llvm-link`
This requires each step of compilation to generate `bc` files and then apply `llvm-link` against all `bc` files.

# using `gold link`
# using `lld linker`
Adding flags `-flto -fuse-ld=lld -Wl,-save-temps` to generate the temporal bc files.

# using `gold linker`
`export LDFLAGS="-flto -fuse-ld=gold -Wl,-plugin-opt=emit-llvm"`
http://gbalats.github.io/2015/12/10/compiling-autotooled-projects-to-LLVM-bitcode.html

# using `wllvm` or `gllvm`
[wllvm](https://github.com/travitch/whole-program-llvm) and [gllvm](https://github.com/SRI-CSL/gllvm) are solutions to generating linked bitcode files.
For example, when using gllvm, you should ensure the corresponding compiler is gclang and gclang++, which can be typically set by using `export CC=gclang CXX=gclang++`.

0 comments on commit a754ce2

Please sign in to comment.