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.
Thanks for your query.
Looks like you are trying to invoke Snapdragon LLVM ARM for the x86 target. Since you are using it in AOSP context, it is very likely you are trying to build host (x86) executables with Snapdragon LLVM ARM. Snapdragon LLVM ARM compiler supports only ARM targets (32-bit and 64-bit). Please adjust your Android.mk to use Snapdragon LLVM only for target builds and use GCC or prebuilt clang (that comes as part of AOSP) for host builds
I have tried unsuccessfully to do this. Android's build system uses host clang for both target and host modules. Can you point me to a way that I could use Snapdragon Clang for target and AOSP for host? Also, for a full Android build, what flags are recommended?
Can you try the following?
Edit build/core/binary.mk and add the following rule
ifdef LOCAL_IS_HOST_MODULE
LOCAL_CLANG := false
endif
This should result in Android.mk using GCC for host builds.
That seems to have worked... kind of.
Currently, I get Error: selected processor does not support Thumb mode 'udiv'
Seems like an issue that would be easily fixed in ARM.td of the LLVM source. I do have the llvm-rs source forward ported to 3.5 using swift and a9 as reference, but while that does work well, I am guessing that there have been many improvements on your end since 2012, so I would love to be able to take advantage of that.
Thank you again, Raja.
If you are compiling with -mcpu=krait2 option passed on the command line, but using "-no-integrated-as", you will see this error from the GNU assembler. There are two ways to fix it
1. Remove -no-integrated-as since integrated assembler is enabled by default for Snapdragon LLVM.
2. Instead of saying -mcpu=krait2, please use "-mcpu=cortex-a9 -mtune=krait2". This will prevent generation of divide instructions while still optimizing for Snapdragon Krait. The result code can be run on all ARMv7 cores (divide instructions are not supported by all ARMv7 cores)
1. 3.5.1 is the latest version. We are working on the Snapdragon LLVM ARM 3.6 release which we expect to be available next week
2. Yes, -Ofast -mcpu=krait2 -mfpu=neon is the recommended set of options for best performance for ARMv7.
3. There are signficiant code differences between Snapdragon LLVM and llvm.org LLVM. Majority of these difference are performance optimizations to improve the performance of applications built for Snapdragon LLVM
@xboxfanj
Hi,
i got it working maybe you want to have a look and helpout? :)
http://forum.xda-developers.com/android/software-hacking/wip-compile-and...