Whole Program LLVM in Rust (rllvm)
rllvm
is a Rust port of gllvm
and provides compiler wrappers to build whole-program LLVM bitcode files for projects with source codes.
For more details, please refer to gllvm
or wllvm
.
Installation
Get Started
Configuration
The default configuration file ~/.rllvm/config.toml
will be automatically created, if it does not exist, with the following entries:
Configuration Key | Required? | Notes |
---|---|---|
llvm_config_filepath |
Yes | The absolute filepath of llvm-config |
clang_filepath |
Yes | The absolute filepath of clang |
clangxx_filepath |
Yes | The absolute filepath of clang++ |
llvm_ar_filepath |
Yes | The absolute filepath of llvm-ar |
llvm_link_filepath |
Yes | The absolute filepath of llvm-link |
llvm_objcopy_filepath |
Yes | The absolute filepath of llvm-objcopy |
bitcode_store_path |
No | The absolute path of the directory that stores intermediate bitcode files |
llvm_link_flags |
No | Extra user-provided linking flags for llvm-link |
lto_ldflags |
No | Extra user-provided linking flags for link time optimization |
bitcode_generation_flags |
No | Extra user-provided flags for bitcode generation, e.g., "-flto -fwhole-program-vtables" |
is_configure_only |
No | The configure only mode, which skips the bitcode generation (Default: false) |
log_level |
No | Log level (0: nothing, 1: error, 2: warn, 3: info, 4: debug, 5: trace) |
Here is an example of the configuration file:
= '/usr/local/Cellar/llvm/16.0.4/bin/llvm-config'
= '/usr/local/Cellar/llvm/16.0.4/bin/clang'
= '/usr/local/Cellar/llvm/16.0.4/bin/clang++'
= '/usr/local/Cellar/llvm/16.0.4/bin/llvm-ar'
= '/usr/local/Cellar/llvm/16.0.4/bin/llvm-link'
= '/usr/local/Cellar/llvm/16.0.4/bin/llvm-objcopy'
= '/tmp/bitcode_store'
= 3