-
Notifications
You must be signed in to change notification settings - Fork 83
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
gcm_context
size mismatch for target i686-linux-android
#299
Comments
Hi @DrTobe , I guess this error is related to : 612e36c . Did you remember why you made this change? It seems that that commit hard coded the size of many C types (which may change in different platform) when computing the size of contexts. And more importantly, the size of these contexts actually are not able to be hard coded since the type definitions in C side can change with different config. |
The reasoning for these semi-hardcoded sizes is explained in the comment above:
Actually, I have tried to make this a little bit more platform-independent. Before, the sizes were fully-hardcoded with a 64-bit platform in mind. I changed these sizes to be dynamic in commit 5027a7c but that defeats the purpose of these checks. So I tried to calculate these sizes in a platform-independent way. Apparently, this does not work for some platforms. Actually, it is unnecessarily painful to calculate C type sizes by hand for different platforms. Should we try to find a completely different approach here which avoids manual size calculations? Maybe, we could copy+translate the expected C types to Rust with a |
@osobiehl These functions are completely unused and just for compile-time checks. If you just want the code to compile, remove these functions and try again. |
@DrTobe I see what you mean here. |
That sounds smart but there is still the problem you mentioned above:
How can we handle the config changes then? |
I think my words about config changes was wrong. |
I am trying to compile for the
i686-linux-android
target. However, it looks like there is a mismatch between the size of structs between the generatedgcm_context
struct and__SIZE_OF_GCM_CONTEXT
.Here is a quick overview of the build script I am using (NDK_HOME) is the path to android-ndk on system
The text was updated successfully, but these errors were encountered: