From ee3d0578e602d39134a5f40c48ee557807386a27 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Tue, 9 Jan 2018 11:39:21 +0100 Subject: [PATCH 1/2] Correct the type of c_char. On ARM64, it is supposed to be unsigned char: $ aarch64-unknown-cloudabi-cc -dM -E - < /dev/null | grep __CHAR_UNSIGNED__ #define __CHAR_UNSIGNED__ 1 --- src/cloudabi/aarch64.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cloudabi/aarch64.rs b/src/cloudabi/aarch64.rs index e9e2473d..4caa6d7b 100644 --- a/src/cloudabi/aarch64.rs +++ b/src/cloudabi/aarch64.rs @@ -1,4 +1,4 @@ -pub type c_char = i8; +pub type c_char = u8; pub type c_long = i64; pub type c_ulong = u64; pub type wchar_t = u32; From dad866d67040ea4b0af8ff0b375ea26ee00cc4aa Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Tue, 9 Jan 2018 11:40:07 +0100 Subject: [PATCH 2/2] Add support for CloudABI running on 32-bit ARM systems. --- src/cloudabi/arm.rs | 4 ++++ src/cloudabi/mod.rs | 3 +++ 2 files changed, 7 insertions(+) create mode 100644 src/cloudabi/arm.rs diff --git a/src/cloudabi/arm.rs b/src/cloudabi/arm.rs new file mode 100644 index 00000000..eca53607 --- /dev/null +++ b/src/cloudabi/arm.rs @@ -0,0 +1,4 @@ +pub type c_char = u8; +pub type c_long = i32; +pub type c_ulong = u32; +pub type wchar_t = u32; diff --git a/src/cloudabi/mod.rs b/src/cloudabi/mod.rs index 1d8875f9..e506414e 100644 --- a/src/cloudabi/mod.rs +++ b/src/cloudabi/mod.rs @@ -151,6 +151,9 @@ cfg_if! { if #[cfg(target_arch = "aarch64")] { mod aarch64; pub use self::aarch64::*; + } else if #[cfg(any(target_arch = "arm"))] { + mod arm; + pub use self::arm::*; } else if #[cfg(any(target_arch = "x86"))] { mod x86; pub use self::x86::*;