Forums - Unknown target triple

9 posts / 0 new
Last post
Unknown target triple
jake.weinstein
Join Date: 11 Feb 13
Posts: 44
Posted: Sun, 2015-01-04 23:44
I have been trying to replace the AOSP prebuilt clang 3.5 with the Qualcomm krait 3.5 compiler, but I keep getting the following error on compiler-rt clang -cc1as: error: unknown target triple 'i386--linux-gnu', please use -triple or -arch
  • Up0
  • Down0
Raja Moderator
Join Date: 17 Apr 13
Posts: 42
Posted: Sat, 2015-02-21 11:25

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

  • Up0
  • Down0
jake.weinstein
Join Date: 11 Feb 13
Posts: 44
Posted: Mon, 2015-02-23 17:21

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?

  • Up0
  • Down0
Raja Moderator
Join Date: 17 Apr 13
Posts: 42
Posted: Tue, 2015-02-24 07:53

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.

  • Up0
  • Down0
jake.weinstein
Join Date: 11 Feb 13
Posts: 44
Posted: Tue, 2015-02-24 15:21
I'll try that, what I had tried is setting the cc to aosp if local_is_host_module is true, but if else, krait. I did that in core/clang/config.Mk, so maybe that was the issue, but it's where the cc is set. Your way is much easier, so it should work. Thank you for your help. Couple more questions: #1: is 3.5 or 3.5.1 recommended? 3.5.1 is about 20 days newer but I've only seen it on the swe dependencies and not here. #2: is -Ofast -mcpu=krait2 -mfpu=neon recommended? #3: Other than basic upstreaming to 3.5 and aarch64, can you tell me the differences between the customer llvm-rs from jb_2.5 (llvm 3.1) and the binaries found here? I appreciate your time.
  • Up0
  • Down0
jake.weinstein
Join Date: 11 Feb 13
Posts: 44
Posted: Tue, 2015-02-24 18:58

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.

  • Up0
  • Down0
Raja Moderator
Join Date: 17 Apr 13
Posts: 42
Posted: Tue, 2015-02-24 21:40

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)

  • Up0
  • Down0
Raja Moderator
Join Date: 17 Apr 13
Posts: 42
Posted: Tue, 2015-02-24 21:42

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

  • Up0
  • Down0
mustermaxmueller
Join Date: 3 Jun 14
Posts: 3
Posted: Tue, 2015-03-03 02:25

@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...

 

  • 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.