Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails on armv7 #36

Closed
codeandkey opened this issue Sep 28, 2018 · 3 comments
Closed

Build fails on armv7 #36

codeandkey opened this issue Sep 28, 2018 · 3 comments

Comments

@codeandkey
Copy link

Can't get this crate to compile on my pi -- it does compile on the same toolchain for x86_64 though.

Host info:

Linux pi 4.14.50-v7+ #1122 SMP Tue Jun 19 12:26:26 BST 2018 armv7l GNU/Linux
stable-armv7-unknown-linux-gnueabihf (default)
rustc 1.29.1 (b801ae664 2018-09-20)

Build log:

 Compiling lz4 v1.23.0                                                                                        
error[E0308]: mismatched types
  --> /home/jtst/.cargo/registry/src/github.com-1ecc6299db9ec823/lz4-1.23.0/src/block/mod.rs:81:21
   |
81 |                     src.as_ptr() as *const i8,
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
   |
   = note: expected type `*const u8`
              found type `*const i8`

error[E0308]: mismatched types
  --> /home/jtst/.cargo/registry/src/github.com-1ecc6299db9ec823/lz4-1.23.0/src/block/mod.rs:82:21
   |
82 |                     dst_buf.as_mut_ptr() as *mut i8,
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
   |
   = note: expected type `*mut u8`
              found type `*mut i8`

error[E0308]: mismatched types
  --> /home/jtst/.cargo/registry/src/github.com-1ecc6299db9ec823/lz4-1.23.0/src/block/mod.rs:90:21
   |
90 |                     src.as_ptr() as *const i8,
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
   |
   = note: expected type `*const u8`
              found type `*const i8`

error[E0308]: mismatched types
  --> /home/jtst/.cargo/registry/src/github.com-1ecc6299db9ec823/lz4-1.23.0/src/block/mod.rs:91:21
   |
91 |                     dst_buf.as_mut_ptr() as *mut i8,
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
   |
   = note: expected type `*mut u8`
              found type `*mut i8`

error[E0308]: mismatched types
  --> /home/jtst/.cargo/registry/src/github.com-1ecc6299db9ec823/lz4-1.23.0/src/block/mod.rs:99:21
   |
99 |                     src.as_ptr() as *const i8,
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
   |
   = note: expected type `*const u8`
              found type `*const i8`

error[E0308]: mismatched types
   --> /home/jtst/.cargo/registry/src/github.com-1ecc6299db9ec823/lz4-1.23.0/src/block/mod.rs:100:21
    |
100 |                     dst_buf.as_mut_ptr() as *mut i8,
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    |
    = note: expected type `*mut u8`
               found type `*mut i8`

error[E0308]: mismatched types
   --> /home/jtst/.cargo/registry/src/github.com-1ecc6299db9ec823/lz4-1.23.0/src/block/mod.rs:164:13
    |
164 |             src.as_ptr() as *const i8,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> /home/jtst/.cargo/registry/src/github.com-1ecc6299db9ec823/lz4-1.23.0/src/block/mod.rs:165:13
    |
165 |             decompressed.as_mut_ptr() as *mut i8,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    |
    = note: expected type `*mut u8`
               found type `*mut i8`
@jheyens
Copy link
Collaborator

jheyens commented Sep 30, 2018

I see, where this is coming from, since we are "lying" to C about what kind of char ptr we got here. I'll see if I can reproduce this on Qemu systems.
Thanks!

@jheyens
Copy link
Collaborator

jheyens commented Oct 12, 2018

Fixed on master. I'll close this issue once I publish the next version to crates.io.

The error was due to lz4-sys C bindings using *c_char pointers, where c_char is i8 on x86 and u8 on arm.

@jheyens
Copy link
Collaborator

jheyens commented Nov 28, 2018

Uploaded to crates.io.

Sorry for the delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants