Skip to content

Commit

Permalink
Turn on the mem-unaligned feature for bpf targets
Browse files Browse the repository at this point in the history
Fixes the following LLVM segfault:

 Error: e: 05:02:06 [ERROR] fatal error: "Cannot select: 0x55e970a357d0: i64,ch = AtomicLoad<(load unordered (s64) from %ir.45)> 0x55e970410be8, 0x55e970a358a0\n  0x55e970a358a0: i64,ch = CopyFromReg 0x55e970410be8, Register:i64 %19\n    0x55e970a35490: i64 = Register %19\nIn function: memcpy"
          PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
          Stack dump:
          0.	Running pass 'Function Pass Manager' on module 'unroll-loop'.
          1.	Running pass 'BPF DAG->DAG Pattern Instruction Selection' on function '@memcpy'
  • Loading branch information
alessandrod committed Nov 21, 2021
1 parent 86aa192 commit 9d6d0b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn main() {
}

// These targets have hardware unaligned access support.
if target.contains("x86_64") || target.contains("i686") || target.contains("aarch64") {
if target.contains("x86_64") || target.contains("i686") || target.contains("aarch64") || target.contains("bpf") {
println!("cargo:rustc-cfg=feature=\"mem-unaligned\"");
}

Expand Down

0 comments on commit 9d6d0b7

Please sign in to comment.