소스 검색

Include Linux atomic emulation on androideabi

The old androideabi uses armv5 and thus also needs the atomic emulation
and because Android is basically Linux it can use the same
implementation.
Tilmann Meyer 3 년 전
부모
커밋
186517b326
2개의 변경된 파일10개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 2
      build.rs
  2. 5 1
      src/lib.rs

+ 5 - 2
build.rs

@@ -69,8 +69,11 @@ fn main() {
         println!("cargo:rustc-cfg=thumb_1")
     }
 
-    // Only emit the ARM Linux atomic emulation on pre-ARMv6 architectures.
-    if llvm_target[0] == "armv4t" || llvm_target[0] == "armv5te" {
+    // Only emit the ARM Linux atomic emulation on pre-ARMv6 architectures. This
+    // includes the old androideabi. It is deprecated but it is available as a
+    // rustc target (arm-linux-androideabi).
+    if llvm_target[0] == "armv4t" || llvm_target[0] == "armv5te" || llvm_target[2] == "androideabi"
+    {
         println!("cargo:rustc-cfg=kernel_user_helpers")
     }
 }

+ 5 - 1
src/lib.rs

@@ -49,7 +49,11 @@ pub mod mem;
 #[cfg(target_arch = "arm")]
 pub mod arm;
 
-#[cfg(all(kernel_user_helpers, target_os = "linux", target_arch = "arm"))]
+#[cfg(all(
+    kernel_user_helpers,
+    any(target_os = "linux", target_os = "android"),
+    target_arch = "arm"
+))]
 pub mod arm_linux;
 
 #[cfg(any(target_arch = "riscv32"))]