Open Wawha opened 11 months ago
Your profile is too naive, you can't just set tools.android:ndk_path
and expect that it will work for all recipes. It might be sufficient for CMake, but not autotools based recipe like libcurl. You didn't show your build log, but I'm pretty sure that your native compiler has been used, because you are missing many buildenv vars like CC, CXX, AR, AS, LD, NM, RANLIB, STRIP etc
You can use android-ndk recipe to avoid headaches, or ask to conan team to fix their documentation (https://docs.conan.io/2/examples/cross_build/android/ndk.html#examples-cross-build-android-ndk is clearly too naive).
Hi @SpaceIm, thank you for your remark, indeed, It seems I'm naive about conan usage! I do not have lot experience in conan, and no experience at all with autotools...
When you propose to use android-ndk recipe
, do you mean an Android prefab? Like this one : https://github.com/vvb2060/curl-android (I just test it and it works great !).
In case you know/have some examples with autotools buildenv variables to define (and the value to set) for Android armv8
& x86-64
when using conan, I would be great!
Here the log when I launched conan install.
In the first lines, then launching configure
, there is an argument --build=x86_64-linux-gnu
, perhaps it's the problem you point.
When I mean android-ndk recipe, I mean this host profile for example:
[settings]
os=Android
os.api_level=24
arch=armv8
compiler=clang
compiler.version=14
compiler.libcxx=c++_shared
compiler.cppstd=gnu20
build_type=Release
[options]
[tool_requires]
android-ndk/r25c
[conf]
Description
When I try to include libcurl in a Android project, I have a link error (link error on my project side). With arm64-v8a, this link error tell that libcurl libraries are
incompatible with aarch64linux
. Looking at these library usingobjdump
, I see that the libraries are compile for x86_x64, and not arm64_v8a (i.e. aarch64linux). Here objdump partial output:Note that I already have multiple other Conan packages which works great on Android (fmt, abseil, range-v3, doctext, cppcodec tensorflow-lite, etc.), so the problem seems on libcurl package from that I understand.
When I compile for Android emulator with
x86_64
architecture, I have a different link error (only in Debug, not in Release). In this configuration, I have these link errors:For the moment, I have no idea how investigate or fix that issue. Any help will be welcome
Package and Environment Details
Conan profile
Steps to reproduce
Logs
Click to expand log
``` ninja: Entering directory `project_path/build/gradle-cxx/Release/1de1c133/arm64-v8a' ld: error: /home/username/.conan2-Android-armv8-clang-14/p/b/libcu4a451e92eb7c8/p/lib/libcurl.a(libcurl_la-easy.o) is incompatible with aarch64linux ld: error: /home/username/.conan2-Android-armv8-clang-14/p/b/libcu4a451e92eb7c8/p/lib/libcurl.a(libcurl_la-setopt.o) is incompatible with aarch64linux ld: error: /home/username/.conan2-Android-armv8-clang-14/p/b/libcu4a451e92eb7c8/p/lib/libcurl.a(libcurl_la-slist.o) is incompatible with aarch64linux ld: error: /home/username/.conan2-Android-armv8-clang-14/p/b/libcu4a451e92eb7c8/p/lib/libcurl.a(libcurl_la-strerror.o) is incompatible with aarch64linux clang++: error: linker command failed with exit code 1 (use -v to see invocation) ```