Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

Commit cec92fa

Browse files
authored
Merge pull request #66 from aquarhead/llvm-10
Upgrade to LLVM 10
2 parents b63a552 + d87dd07 commit cec92fa

3 files changed

Lines changed: 18 additions & 18 deletions

File tree

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ project](https://github.com/redsift/ingraind/tree/v1.0).
5252
In order to build some of the code here, you will need the following:
5353

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

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

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

73-
cargo build --release
7473
cargo install --path cargo-bpf
7574

7675
## Ubuntu
@@ -82,19 +81,20 @@ Install the following dependencies:
8281
gnupg2 \
8382
software-properties-common \
8483
build-essential \
85-
clang-9 \
86-
llvm-9 \
84+
clang-10 \
85+
llvm-10 \
8786
libelf-dev \
88-
linux-headers \
89-
ca-certificates{,-java}
87+
linux-headers-$(uname -r) \
88+
zlib1g \
89+
ca-certificates
9090

9191
## Fedora
9292

93-
yum install -y clang-9.0.0 \
94-
llvm-9.0.0 \
95-
llvm-libs-9.0.0 \
96-
llvm-devel-9.0.0 \
97-
llvm-static-9.0.0 \
93+
yum install -y clang-10.0.0 \
94+
llvm-10.0.0 \
95+
llvm-libs-10.0.0 \
96+
llvm-devel-10.0.0 \
97+
llvm-static-10.0.0 \
9898
kernel \
9999
kernel-devel \
100100
elfutils-libelf-devel \

cargo-bpf/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ futures = { version = "0.3", optional = true }
2323
tokio = { version = "0.2.4", features = ["rt-core", "io-driver", "macros", "signal"], optional = true }
2424
hexdump = { version = "0.1", optional = true }
2525
libc = "0.2.66"
26-
llvm-sys = "90"
26+
llvm-sys = "100"
2727
syn = { version = "1.0", features = ["full", "visit"] }
2828
quote = "1.0"
2929
proc-macro2 = "1.0"

cargo-bpf/src/build.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -287,12 +287,12 @@ fn probe_names(doc: &Document) -> Result<Vec<String>, Error> {
287287
}
288288

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

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

0 commit comments

Comments
 (0)