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

cannot transmute between types of different sizes, or dependently-sized types #185

Open
brenzi opened this issue Dec 22, 2019 · 2 comments

Comments

@brenzi
Copy link

brenzi commented Dec 22, 2019

I'm trying to build the sgx-types dependency for my project. I get the following error:

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
    --> /home/abrenzikofer/.cargo/git/checkouts/rust-sgx-sdk-fc8771c5c45bde9a/4508450/sgx_types/src/macros.rs:115:24
     |
115  |                   unsafe{macros::transmute([0u8; $size])}
     |                          ^^^^^^^^^^^^^^^^^
     | 
    ::: /home/abrenzikofer/.cargo/git/checkouts/rust-sgx-sdk-fc8771c5c45bde9a/4508450/sgx_types/src/types.rs:1413:1
     |
1413 | / impl_struct_default! {
1414 | |     sgx_ql_qv_supplemental_t, 120;
1415 | | }
     | |_- in this macro invocation
     |
     = note: source type: `[u8; 120]` (960 bits)
     = note: target type: `types::sgx_ql_qv_supplemental_t` (928 bits)


I'm building with

export CC=i686-linux-android16-clang
cargo +nightly-2019-10-04-x86_64-unknown-linux-gnu build --target i686-linux-android --release

The same thing worked with v1.0.9 but it fails with v1.1.0
Also, it works with other targets (armv7-linux-androideabi and aarch64-linux-android)

@dingelish
Copy link
Contributor

Is this rust isssue #61956?

@brenzi
Copy link
Author

brenzi commented Dec 22, 2019

don't know. anyway, I found a workaround. The sgx-types dependency can be avoided for my android crate, so that's what I did.

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