-
Notifications
You must be signed in to change notification settings - Fork 189
OpenSSL: drop libunwind
linking for Clang-based Android NDK
#815
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
Conversation
Clang-based Android NDKs bundle unwind support and do not require explicit linking. Passing malformed flags like "-l-l:libunwind.a" caused build failures with ld.lld on NDK r23+. This change removes those flags from configure options to ensure successful builds.
sounds reasonable. I have no experience in Android toolchains thoug. Android build seems to still fail (probably a different error) Please ping me when you are happy with the state of this PR |
@NeroBurner Yes, I've tested on NDK 23+ and it works perfectly. Thanks :) |
Could you explain to me why the CI / OpenSSL android-ndk-api-35-arm64-v8a-libcxx14 ubuntu-24.04 toolchain fails? Is the |
I cannot find the source code of |
Or I created it wrong 😅 I changed their creation in #780 The toolchains are generated now by the python3 .github/workflows/set_matrix.py OpenSSL Then you'll get the toolchain files in The toolchain file looks as follows: # toolchain file generated by set_matrix.py, do not modify!
set(CMAKE_SYSTEM_NAME "Android")
set(CMAKE_SYSTEM_VERSION "35") # API level
set(CMAKE_ANDROID_ARCH_ABI "arm64-v8a")
set(CMAKE_ANDROID_NDK "$ENV{ANDROID_NDK}") # provided by GitHub
string(COMPARE EQUAL "${CMAKE_ANDROID_NDK}" "" _is_empty)
if(_is_empty)
message(FATAL_ERROR
"Environment variable 'ANDROID_NDK' not set"
)
endif()
# ANDROID macro is not defined by CMake 3.7+, however it is used by
# some packages like OpenCV
# (https://gitlab.kitware.com/cmake/cmake/merge_requests/62)
add_definitions("-DANDROID")
set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static
set(CMAKE_CXX_FLAGS_INIT "${CMAKE_CXX_FLAGS_INIT} -stdlib=libc++")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) Is it grossly wrong? 😅 |
libunwind
linking for Clang-based NDKlibunwind
linking for Clang-based Android NDK
This is the toolchain I’m using now. It has worked for several years across all the updates of Android Studio.
|
Could you provide a filled out version as well? This could be very helpful. Thanks! |
Sure. This toolchain was modified based on the original Android toolchain. Be aware that I’m targeting C++20 for my purposes. It works well with all the Hunter packages I’m using, though I definitely haven’t tested every package.
|
With filled out I was referring to have the template variables like |
It's |
And all the other values? Can you copy the final version after all the |
No problem. They look like this: @ANDROID_ABI@: arm64-v8a |
BTW, I also have some fixes for other packages built with the latest iOS 26 / macOS 26 SDK. Could you take a look at them as well? libpng: hunter-packages/libpng#9 I submitted these pull requests because the current versions cause build errors with the newer SDK, which was officially released this month. |
Thank you very much. I'll try to take a look as soon as possible. Thanks again for your contributions! |
Since Android NDK r23+,
unwind
support is bundled in the Clang toolchain and explicit linking to libunwind is no longer required. Linking this library causes build errors on modern NDKs.This change removes
libunwind
from the configure options to ensure successful builds for NDK r23+.