Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdded support for ARM #9
Conversation
dcuddeback
reviewed
Jan 21, 2016
| @@ -55,7 +55,7 @@ impl TTYPort { | |||
| Err(_) => return Err(super::error::from_raw_os_error(EINVAL)) | |||
| }; | |||
|
|
|||
| let fd = unsafe { libc::open(cstr.as_ptr(), O_RDWR | O_NOCTTY | O_NONBLOCK, 0) }; | |||
| let fd = unsafe { libc::open(cstr.as_ptr() as *const c_char, O_RDWR | O_NOCTTY | O_NONBLOCK, 0) }; | |||
This comment has been minimized.
This comment has been minimized.
dcuddeback
Jan 21, 2016
Owner
That's odd. CString::as_ptr() is supposed to return a *const c_char: http://doc.rust-lang.org/std/ffi/struct.CString.html#method.as_ptr. The cast shouldn't be necessary.
This comment has been minimized.
This comment has been minimized.
|
@Razican This is an odd one. I've been cross-compiling this for armv6 on Linux (Raspberry Pi) for a while. It almost looks like there are two competing versions of I'm not sure what's going on with AppVeyor. The build failure doesn't seem related to your change. |
This comment has been minimized.
This comment has been minimized.
|
The issue was the one here: https://users.rust-lang.org/t/solved-issues-using-serial-library-in-arm/4357/2 It could be due to competing libc versions, since wiringpi (a library I was using too) was using libc 0.1. In any case, this should be prevented :/ |
This comment has been minimized.
This comment has been minimized.
|
@Razican Thanks for reporting this. I spent some time digging into the compilation error and tracked it down to an incompatibility between the The issue is that both You can see this by comparing compilation of
On Rust 1.6, the results are reversed. v0.3.0 has the opposite compilation error (expecting
To summarize:
Ultimately, I think this is an upstream issue that should be address by Rust or Cargo. For example, if we could specify a dependency on a particular version of Rust or In retrospect, I probably should have bumped the version to v0.4 when I upgraded the |
Razican commentedJan 20, 2016
I added support for ARM, since the build would fail. It would be great if you could add this change to the crates.io release, thanks!
Note: of course it continues building perfectly in other platforms :)