Skip to content

Conversation

NeroBurner
Copy link

Try to fix the Android toolchain for more projects by setting more
variables.

Fixes: #825

Try to fix the Android toolchain for more projects by setting more
variables.

Fixes: #825
@NeroBurner NeroBurner self-assigned this Sep 18, 2025
@NeroBurner NeroBurner added bug Something isn't working infrastructure Problems with the CI infrastructure or CI jobs labels Sep 18, 2025
@NeroBurner
Copy link
Author

@olliwang still not working. Could you have a look?

 /usr/local/lib/android/sdk/ndk/27.3.13750724/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -fPIC -pthread -Wall -O3 -L. -Wl,-z,defs -Wl,-znodelete -shared -Wl,-Bsymbolic   \
	-o providers/legacy.so -Wl,--version-script=providers/legacy.ld \
	providers/legacy-dso-legacyprov.o \
	providers/liblegacy.a providers/libcommon.a -lcrypto -ldl -pthread -latomic -Wl,--build-id=sha1 -Wl,--no-undefined-version -Wl,--fatal-warnings -Wl,--gc-sections -Qunused-arguments -Wl,--no-undefined  -Wl,--gc-sections -latomic -lm -lc++ -lm  -ldl -lc  -ldl
ld.lld: error: providers/legacy-dso-legacyprov.o is incompatible with elf64-x86-64
ld.lld: error: providers/liblegacy.a(liblegacy-lib-cipher_blowfish.o) is incompatible with elf64-x86-64
ld.lld: error: providers/liblegacy.a(liblegacy-lib-cipher_blowfish_hw.o) is incompatible with elf64-x86-64
ld.lld: error: providers/liblegacy.a(liblegacy-lib-cipher_cast5.o) is incompatible with elf64-x86-64
ld.lld: error: providers/liblegacy.a(liblegacy-lib-cipher_cast5_hw.o) is incompatible with elf64-x86-64
ld.lld: error: providers/liblegacy.a(liblegacy-lib-cipher_des.o) is incompatible with elf64-x86-64
ld.lld: error: providers/liblegacy.a(liblegacy-lib-cipher_des_hw.o) is incompatible with elf64-x86-64
ld.lld: error: providers/liblegacy.a(liblegacy-lib-cipher_desx.o) is incompatible with elf64-x86-64
ld.lld: error: providers/liblegacy.a(liblegacy-lib-cipher_desx_hw.o) is incompatible with elf64-x86-64
ld.lld: error: providers/liblegacy.a(liblegacy-lib-cipher_idea.o) is incompatible with elf64-x86-64
ld.lld: error: providers/liblegacy.a(liblegacy-lib-cipher_idea_hw.o) is incompatible with elf64-x86-64
ld.lld: error: providers/liblegacy.a(liblegacy-lib-cipher_rc2.o) is incompatible with elf64-x86-64

.github/toolchains/android-ndk-api-35-arm64-v8a-libcxx14.cmake

# toolchain file generated by set_matrix.py, do not modify!
set(CMAKE_SYSTEM_NAME "Android")
set(CMAKE_SYSTEM_VERSION "35") # API level
set(ANDROID_PLATFORM "android-35") # API level
set(CMAKE_ANDROID_ARCH_ABI "arm64-v8a")
set(ANDROID_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(ANDROID_STL "c++_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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working infrastructure Problems with the CI infrastructure or CI jobs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI: android toolchain almost always broken
1 participant