From 1e3ed7714b1b245f498dd405a500a6b7a0a01acd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alessandro=C2=A0Decina?= Date: Sun, 21 Nov 2021 06:54:00 +0000 Subject: [PATCH] Turn on the mem-unaligned feature for bpf targets 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' --- build.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build.rs b/build.rs index 60feb0619..b930f1d8d 100644 --- a/build.rs +++ b/build.rs @@ -34,7 +34,11 @@ 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\""); }