Browse Source

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'
Alessandro Decina 3 năm trước cách đây
mục cha
commit
1e3ed7714b
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      build.rs

+ 5 - 1
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\"");
     }