Forums - Which linker to use with Snapdragon LLVM

2 posts / 0 new
Last post
Which linker to use with Snapdragon LLVM
hunter.hangyin
Join Date: 9 Sep 14
Posts: 1
Posted: Thu, 2014-10-02 15:05

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?

  • Up0
  • Down0
Raja Moderator
Join Date: 17 Apr 13
Posts: 42
Posted: Thu, 2014-10-02 15:14

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

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.