Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ project](https://github.com/redsift/ingraind/tree/v1.0).
In order to build some of the code here, you will need the following:

* Linux 4.19+, with a build tree. The build tree is picked up from standard locations, or the `KERNEL_SOURCE` environment variable.
* LLVM 9, or an LLVM version compatible with the Rust release you're using to build
* LLVM 10
* The latest stable Rust compiler. We only promise to build with the latest stable and nightly compilers.

# Getting started
Expand All @@ -70,7 +70,6 @@ sure you sync the git submodules necessary to build redbpf:

Then install the dependencies for your distro before running the usual ritual.

cargo build --release
cargo install --path cargo-bpf

## Ubuntu
Expand All @@ -82,19 +81,20 @@ Install the following dependencies:
gnupg2 \
software-properties-common \
build-essential \
clang-9 \
llvm-9 \
clang-10 \
llvm-10 \
libelf-dev \
linux-headers \
ca-certificates{,-java}
linux-headers-$(uname -r) \
zlib1g \
ca-certificates

## Fedora

yum install -y clang-9.0.0 \
llvm-9.0.0 \
llvm-libs-9.0.0 \
llvm-devel-9.0.0 \
llvm-static-9.0.0 \
yum install -y clang-10.0.0 \
llvm-10.0.0 \
llvm-libs-10.0.0 \
llvm-devel-10.0.0 \
llvm-static-10.0.0 \
kernel \
kernel-devel \
elfutils-libelf-devel \
Expand Down
2 changes: 1 addition & 1 deletion cargo-bpf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ futures = { version = "0.3", optional = true }
tokio = { version = "0.2.4", features = ["rt-core", "io-driver", "macros", "signal"], optional = true }
hexdump = { version = "0.1", optional = true }
libc = "0.2.66"
llvm-sys = "90"
llvm-sys = "100"
syn = { version = "1.0", features = ["full", "visit"] }
quote = "1.0"
proc-macro2 = "1.0"
Expand Down
12 changes: 6 additions & 6 deletions cargo-bpf/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,12 @@ fn probe_names(doc: &Document) -> Result<Vec<String>, Error> {
}

fn get_opt_executable() -> Result<String, Error> {
for llc in vec!["opt".into(), env::var("OPT").unwrap_or("opt-9".into())].drain(..) {
if let Ok(out) = Command::new(&llc).arg("--version").output() {
for opt in vec!["opt".into(), env::var("OPT").unwrap_or("opt-10".into())].drain(..) {
if let Ok(out) = Command::new(&opt).arg("--version").output() {
match String::from_utf8(out.stdout) {
Ok(out) => {
if out.contains("LLVM version 9.") {
return Ok(llc);
if out.contains("LLVM version 10.") {
return Ok(opt);
}
}
Err(_) => continue,
Expand All @@ -304,11 +304,11 @@ fn get_opt_executable() -> Result<String, Error> {
}

pub(crate) fn get_llc_executable() -> Result<String, Error> {
for llc in vec!["llc".into(), env::var("LLC").unwrap_or("llc-9".into())].drain(..) {
for llc in vec!["llc".into(), env::var("LLC").unwrap_or("llc-10".into())].drain(..) {
if let Ok(out) = Command::new(&llc).arg("--version").output() {
match String::from_utf8(out.stdout) {
Ok(out) => {
if out.contains("LLVM version 9.") {
if out.contains("LLVM version 10.") {
return Ok(llc);
}
}
Expand Down