llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.51k stars 11.3k forks source link

android-ndk-r26c use -pg ld.lld: error: undefined symbol: _mcount #98742

Open mckaylinux opened 1 month ago

mckaylinux commented 1 month ago

Hi All,

I want to use the -pg option in LLVM for performance profiling, but I'm encountering an error during linking that indicates _mcount is undefined. Can anyone help me out? Thank you.

android-ndk-r26c-linux/android-ndk-r26c/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android34-clang -pg simd.c -o simdpg

ld.lld: error: undefined symbol: _mcount

ZLangJIT commented 1 month ago

Doesnt ndk use its own custom llvm with additional support for mobile hardware ?

mckaylinux commented 1 month ago

@ZLangJIT, thank you for your reply. Yes, the NDK uses its own custom LLVM with additional support for mobile hardware. I can use the -pg option in Clang(x86), but I do not know why I cannot do the same thing in the NDK.