Forums - clang doesn't autodetect C++ headers

2 posts / 0 new
Last post
clang doesn't autodetect C++ headers
bo.lind.fingerprints
Join Date: 3 Nov 16
Posts: 2
Posted: Tue, 2016-11-08 01:58

A normal, vanilla clang autodetects existing headers from GCC collections. If invoked with the -v option, the output is:

...

Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9.4
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1
...
But the Snapdragon LLVM does not. Where are C++ headers intended to come from? They aren't provided as part of the Snapdragon LLVM, and it doesn't find them.
 
Thanks in advance.
  • Up0
  • Down0
bo.lind.fingerprints
Join Date: 3 Nov 16
Posts: 2
Posted: Tue, 2016-11-08 02:38

Ah, if one actually reads the docs, the answer lies in the make-standalone-toolchain-snapdragon-llvm.sh script:

 

For ARMv7:
 
If using Android NDK r11b:
<NDK_ROOT>/build/tools/make-standalone-toolchain-snapdragon-llvm.sh \
--ndk-dir=<NDK_ROOT> --platform=android-19 --arch=arm \
--install-dir=<some_dir> --use-llvm --system=linux-x86_64
 
If using Android NDK r10e:
<NDK_ROOT>/build/tools/make-standalone-toolchain.sh --ndk-dir=<NDK_ROOT> \
--platform=android-19 --arch=arm --install-dir=<some_dir> \
--toolchain=arm-linux-androideabi-4.9 \
--llvm-version=Snapdragon_LLVM_for_Android_3.8 --system=linux-x86_64
 
The above command lines specify that android-19 platform directory must be
copied to be used as the standalone sysroot and GCC-4.9 toolchain must be
copied to be used as the linker and for other binutils such as objdump.
 
For AArch64:
 
If using Android NDK r11b:
<NDK_ROOT>/build/tools/make-standalone-toolchain-snapdragon-llvm.sh \
--ndk-dir=<NDK_ROOT> --platform=android-21 --arch=arm64 \
--install-dir=<some_dir> --use-llvm --system=linux-x86_64
 
If using Android NDK r10e:
<NDK_ROOT>/build/tools/make-standalone-toolchain.sh --ndk-dir=<NDK_ROOT> \
--platform=android-21 --arch=arm64 --install-dir=<some_dir> \
--toolchain=aarch64-linux-android-4.9 \
--llvm-version=Snapdragon_LLVM_for_Android_3.8 --system=linux-x86_64
 
  • 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.