Skip to content

[Build] Undefined symbol cross compiling on MacOs for armeabi-v7a #26458

@antonivanov-r

Description

@antonivanov-r

Describe the issue

Hi,
I'm getting undefined symbol during linking for armeabi-v7a.
arm64-v8a compiles and links fine.

Urgency

v1.22.0 built fine, so it's a regression

Target platform

Android

Build script

command = [
str(onnx_dir / "build.sh"),
"--build_dir", f"{abi_dir}",
"--android_sdk_path", f"{android_home}",
"--android_ndk_path", f"{ndk_home}",
"--android_abi", f"{abi}",
"--minimal_build", "extended",
"--parallel",
"--skip_tests",
"--config=MinSizeRel",
"--disable_exceptions",
"--android_api", f"{api_ver}",
"--android",
"--enable_lto",
"--disable_ml_ops",
"--build_shared_lib",
"--cmake_extra_defines=onnxruntime_BUILD_UNIT_TESTS=OFF"
]

Error / output

[100%] Linking CXX static library libonnxruntime_providers.a
[100%] Built target onnxruntime_providers
[100%] Building CXX object CMakeFiles/onnxruntime.dir/Users/user/Developer/onnxruntime/onnxruntime/onnxruntime/core/platform/android/cxa_demangle.cc.o
[100%] Building C object CMakeFiles/onnxruntime.dir/generated_source.c.o
[100%] Linking CXX shared library libonnxruntime.so
ld.lld: error: undefined symbol: ArmKleidiAI::MlasDynamicQGemmBatch(MLAS_GEMM_DYN_QUANT_SHAPE_PARAMS const&, MLAS_GEMM_DYN_QUANT_DATA_PARAMS const*, unsigned int, onnxruntime::concurrency::ThreadPool*)
>>> referenced by dynamic_quantize_matmul.cc
>>>               lto.tmp:(onnxruntime::contrib::DynamicQuantizeMatMul::Compute(onnxruntime::OpKernelContext*) const)

ld.lld: error: undefined symbol: ArmKleidiAI::MlasDynamicQgemmPackBSize(unsigned int, unsigned int)
>>> referenced by dynamic_quantize_matmul.cc
>>>               lto.tmp:(onnxruntime::contrib::DynamicQuantizeMatMul::PrePack(onnxruntime::Tensor const&, int, std::__ndk1::shared_ptr<onnxruntime::IAllocator>, bool&, onnxruntime::PrePackedWeights*))
>>> referenced by qgemm.cpp
>>>               lto.tmp:(MlasGemmPackBSize(unsigned int, unsigned int, bool, bool))

ld.lld: error: undefined symbol: ArmKleidiAI::MlasDynamicQgemmPackB(unsigned int, unsigned int, signed char const*, float const*, float const*, void*)
>>> referenced by dynamic_quantize_matmul.cc
>>>               lto.tmp:(onnxruntime::contrib::DynamicQuantizeMatMul::PrePack(onnxruntime::Tensor const&, int, std::__ndk1::shared_ptr<onnxruntime::IAllocator>, bool&, onnxruntime::PrePackedWeights*))
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libonnxruntime.so] Error 1
make[1]: *** [CMakeFiles/onnxruntime.dir/all] Error 2

Visual Studio Version

No response

GCC / Compiler Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildbuild issues; typically submitted using templateplatform:mobileissues related to ONNX Runtime mobile; typically submitted using template

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions