Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.
Closed
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
2 changes: 1 addition & 1 deletion cargo-bpf/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ fn build_probe(cargo: &Path, package: &Path, target_dir: &Path, probe: &str) ->
.arg("--cfg")
.arg(version)
.args(
"--emit=llvm-bc -C panic=abort -C lto -C link-arg=-nostartfiles -C opt-level=3"
"--emit=llvm-bc -C panic=abort -C lto -C link-arg=-nostartfiles -C opt-level=3 -C debuginfo=2"
.split(' '),
)
.arg("-o")
Expand Down
5 changes: 0 additions & 5 deletions cargo-bpf/src/llvm.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use anyhow::{anyhow, Result};
use llvm_sys::bit_writer::LLVMWriteBitcodeToFile;
use llvm_sys::core::*;
use llvm_sys::debuginfo::LLVMStripModuleDebugInfo;
use llvm_sys::ir_reader::LLVMParseIRInContext;
use llvm_sys::prelude::*;
use llvm_sys::target::*;
Expand Down Expand Up @@ -131,10 +130,6 @@ pub unsafe fn process_ir(context: LLVMContextRef, module: LLVMModuleRef) -> Resu
func = LLVMGetNextFunction(func);
}

// the debug info generated by rustc seems to trigger a segfault in the
// BTF code in llvm, so strip it until that is fixed
LLVMStripModuleDebugInfo(module);

Ok(())
}

Expand Down