-
Notifications
You must be signed in to change notification settings - Fork 830
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
libtool cannot cross compile for Android #4519
Comments
Hi @Bjoe Could you please show the full configure command that sets up the cross-compilation? |
@embhorn Yep, true. Sorry I forgot. Here my full configure command execution:
Here the Configuration summary:
|
Hi @Bjoe Cross compilation with the autotools is often difficult. We do have an example project for building in Android Studio If you still want to try the configure path, try setting the target, like: |
Hi @Bjoe , I am encountering a similar issue cross-compiling wolfSSL for Android using configure. This worked for me:
If you want a static library add Thanks, |
I already seen this. I also see that in WolfSSL is a CMakeLists.txt. But in both build solution, how can I enable/disable the "feature" that I need?
Sorry, still same issue. |
Ah! This Thanks for the hint, @dgarske ! Maybe you should add this also as hint on https://www.wolfssl.com/docs/wolfssl-manual/ch2/ -> I will close this issue. |
Hi
In short:
I try to compile WolfSSL 4.8.1 for android and use the android-ndk r19c toolchain.
I read the documentation https://www.wolfssl.com/docs/wolfssl-manual/ch2/ how to cross compile wolfssl.
I got a problem when they try to link, it uses the wrong linker. I figured out that libtool somehow striped out one required parameter.
In details:
If I execute libtool with following parameters from the command line:
Libtool will execute the "linking" with:
This ends in this error:
The problem is, that clang is using the the linker from the host machine and not from the toolchain. The reason why clang is using the wrong linker is because of the missing parameter
--target=aarch64-none-linux-android28
!If I execute clang with the pramater:
It works!
So why is libtool stripped out
--target=aarch64-none-linux-android28
?Here some settings from libtool:
After some hours I found a dirty workaround. When I change in the libtool script the following line:
From:
pic_flag=" -fPIC -DPIC"
To:
pic_flag=" -fPIC -DPIC --target=aarch64-none-linux-android28"
It works.
Here my Question:
The text was updated successfully, but these errors were encountered: