Skip to content

Commit 93f8fa9

Browse files
committed
OpenSSL: strip libunwind flags for Clang-based NDK
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.
1 parent 4e67b30 commit 93f8fa9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cmake/projects/OpenSSL/schemes/url_sha1_openssl.cmake.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,14 @@ if(ANDROID)
104104
# * android-ndk-r17-api-24-arm64-v8a-clang-libcxx14
105105
# * android-ndk-r18-api-24-arm64-v8a-clang-libcxx14
106106
list(APPEND configure_opts "-latomic ${CMAKE_EXE_LINKER_FLAGS}")
107+
108+
# On Clang-based Android NDK toolchains, explicitly linking libunwind is
109+
# unnecessary and results in malformed flags like "-l-l:libunwind.a", which
110+
# break the build. This block strips such flags from configure options to
111+
# ensure successful compilation.
112+
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
113+
string(REPLACE "-l-l:libunwind.a" "" configure_opts "${configure_opts}")
114+
endif()
107115
elseif(RASPBERRY_PI)
108116
set(configure_opts "linux-generic32")
109117
elseif(OPENWRT)

0 commit comments

Comments
 (0)