Topic: Compilation error for wolfSSL library for Android

Hi,

I was following the below link to integrate wolf ssl to Android OSP build.

Link: https://www.wolfssl.com/docs/installing … droid-osp/

But while doing the section “Compile wolfSSL Library" in the above link, it ended up in a compilation error.

The error is below:

external/wolfssl/./src/ssl.c:50931:13: error: shift count >= width of type [-Werror,-Wshift-count-overflow]
        ret <<= (WOLFSSL_BN_ULONG)DIGIT_BIT;
            ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
[ 92% 154/166] target  C: libwolfssl <= external/wolfssl/./src/ssl.c
ninja: build stopped: subcommand failed.
09:18:47 ninja failed with: exit status 1


Please help me to resolve this issue.

Build System: Ubuntu 14.04 (This Ubuntu version is needed for my project.)

Build logs attached

Thanks,
Kevin

Share

Re: Compilation error for wolfSSL library for Android

Hi Kevin,

This appears to be a bit width type. It doesn't appear that the logs were included. It may be easier to assist you by sending the logs via email to
support@wolfssl.com (you can refer to this post).

Can you mention the version of wolfSSL you are using?
Are you following the instructions on the page or did you find the need to make any modifications?

Cheers,
Jeff

Share

Re: Compilation error for wolfSSL library for Android

Hi Jeff,

Thanks for the response.

I had attached the logs but somehow it does not appear here. Anyway I will send it via email.

And to your queries.

1. Can you mention the version of wolfSSL you are using?
My Ans: I have used wolfssl-4.8.1 and wolfssl-jni-jsse-1.7.0.

2. Are you following the instructions on the page or did you find the need to make any modifications?
My ans: I just followed the instructions in the page. As of now I did not find the need of any other modification, As the module build itself failed.

Regards,
Kevin

Share

Re: Compilation error for wolfSSL library for Android

Hi Kevin,

Can you try defining SIZEOF_LONG and SIZEOF_LONG_LONG in your CFLAGS when compiling wolfSSL in AOSP?  This would typically be located in your Android.mk file for wolfSSL (external/wolfssl/Android.mk).  The values of these should match sizeof(long) and sizeof(long long) on your system.  These are typically 4 and 8 respectively.

For example:

LOCAL_CFLAGS:=-DSIZEOF_LONG=4 -DSIZEOF_LONG_LONG=8 <other options>

Thanks,
Chris