Hi,
I tried to build my program with Snapdragon LLVM, but I got a problem when linking. The LLVM compiler seems tried to find linker in usr/lib/bin, rahter than Android NDK path. I tried to add export LD = "$(NDK_root)" in my makefile but no use.
My command line is
clang++ -o test.bin libx.a liby.a
How should I fix the problem?
Thanks for your query.
As you may be aware, the Snapdragon LLVM compiler (like llvm.org LLVM compiler) relies on an external linker such as the GNU linker. For the Android NDK plugin, the Snapdragon LLVM uses "ld" that comes as part of the GCC toolchain. The typical build flow (Android makefile) includes specification of the location of GNU sysroot as well as the GNU toolchain.
Kindly refer to section 3.7 of the "Snapdragon ARM LLVM Compiler for Android" for details and ways to specify the toolchain to use for linking
Hope this helps.
Thanks
--Raja