Forums - AOSP Support

11 posts / 0 new
Last post
AOSP Support
xboxfanj
Join Date: 11 Feb 13
Posts: 41
Posted: Mon, 2015-10-26 18:39

The release notes of version 3.7 of the Snapdragon LLVM Compiler mention Full support for building Android code base (AOSP) without any changes to the build system.  I attempted to build with it, but the following line failed with error: expected value token: https://www.codeaurora.org/cgit/quic/la/platform/frameworks/rs/tree/driv...

I'm guessing that I'm missing something here.

  • Up0
  • Down0
Raja Moderator
Join Date: 17 Apr 13
Posts: 42
Posted: Mon, 2015-10-26 20:38

Thanks for your question.

We verified that the Snapdragon LLVM 3.7 toolchain can build the AOSP tip from Google code base as of first week of August. The code you are trying to compile is Qualcomm's version of Android which is older; Google migrated most of AOSP modules to be built with LLVM only recently (in the last 2 months) and cannot be cleanly built with Snapdragon LLVM.

Please note that you would need to point the AOSP build system to use Snapdragon LLVM instead of llvm.org LLVM that is part of NDK. This may require a small change to AOSP make system that we will be happy to share. Please let us know if you would like this change

  • Up0
  • Down0
xboxfanj
Join Date: 11 Feb 13
Posts: 41
Posted: Tue, 2015-10-27 10:27

So it works without modification on the AOSP master branch, but not the marshmallow release branches?  And yes, I would like to see the change you are referring to.  Thank you for your help and quick response.

  • Up0
  • Down0
frap129
Join Date: 19 Feb 15
Posts: 3
Posted: Thu, 2015-11-26 16:40

@Raja I would also like to see the change, as I am having trouble using this compiler at all.

  • Up0
  • Down0
xboxfanj
Join Date: 11 Feb 13
Posts: 41
Posted: Sat, 2016-01-02 00:13
Raja, any update here would be much appreciated.
  • Up0
  • Down0
Raja Moderator
Join Date: 17 Apr 13
Posts: 42
Posted: Mon, 2016-01-04 15:17

Sorry about the delay. Please apply the patch below to AOSP build system. We use this patch internally to build AOSP with Snapdragon LLVM. Please let us know if you run into issues

 

Thanks

 

 

diff --git a/core/binary.mk b/core/binary.mk

index e18f8c8..18106ac 100644

--- a/core/binary.mk

+++ b/core/binary.mk

@@ -169,6 +169,8 @@ ifdef LOCAL_CLANG_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)

my_clang := $(strip $(LOCAL_CLANG_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)))

endif

+my_qcclang := $(strip $(LOCAL_QCCLANG))

+

# clang is enabled by default for host builds

# enable it unless we've specifically disabled clang above

ifdef LOCAL_IS_HOST_MODULE

@@ -186,6 +188,12 @@ ifeq ($(USE_CLANG_PLATFORM_BUILD),true)

     endif

endif

+ifeq ($(QCCLANG),true)

+    ifeq ($(my_qcclang),)

+        my_qcclang := true

+    endif

+endif

+

# arch-specific static libraries go first so that generic ones can depend on them

my_static_libraries := $(LOCAL_STATIC_LIBRARIES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_STATIC_LIBRARIES_$(my_32_64_bit_suffix)) $(my_static_libraries)

my_whole_static_libraries := $(LOCAL_WHOLE_STATIC_LIBRARIES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_WHOLE_STATIC_LIBRARIES_$(my_32_64_bit_suffix)) $(my_whole_static_libraries)

@@ -262,6 +270,14 @@ my_target_global_cflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)CLANG_TARGET_GLOBAL_CFL

my_target_global_conlyflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)CLANG_TARGET_GLOBAL_CONLYFLAGS)

my_target_global_cppflags += $($(LOCAL_2ND_ARCH_VAR_PREFIX)CLANG_TARGET_GLOBAL_CPPFLAGS)

my_target_global_ldflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)CLANG_TARGET_GLOBAL_LDFLAGS)

+    ifeq ($(my_qcclang), true)

+        ifeq ($(strip $(my_cc)),)

+            my_cc := $(QCCLANG_PATH)/clang

+        endif

+        ifeq ($(strip $(my_cxx)),)

+            my_cxx := $(QCCLANG_PATH)/clang++

+        endif

+    endif

else

my_target_global_cflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_CFLAGS)

my_target_global_conlyflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_CONLYFLAGS)

diff --git a/core/clear_vars.mk b/core/clear_vars.mk

index e5d299c..4f204a0 100644

--- a/core/clear_vars.mk

+++ b/core/clear_vars.mk

@@ -151,6 +151,7 @@ LOCAL_MODULE_OWNER:=

LOCAL_CTS_TEST_PACKAGE:=

LOCAL_CTS_TEST_RUNNER:=

LOCAL_CLANG:=

+LOCAL_QCCLANG:=

LOCAL_JAR_EXCLUDE_FILES:=

LOCAL_JAR_PACKAGES:=

LOCAL_JAR_EXCLUDE_PACKAGES:=

 

  • Up0
  • Down0
xboxfanj
Join Date: 11 Feb 13
Posts: 41
Posted: Mon, 2016-01-04 16:22

This looks like a no-op if QCCLANG isn't defined, which it doesn't seem to be in anything open source.  Also, even if it was, I don't see how it'd be any different from simply changing the clang path manually.

  • Up0
  • Down0
xboxfanj
Join Date: 11 Feb 13
Posts: 41
Posted: Mon, 2016-02-29 14:40

Any update here?

  • Up1
  • Down0
cid.27
Join Date: 12 May 15
Posts: 1
Posted: Mon, 2016-02-29 18:20

I'm trying to build Android for MSM with the Snapdragon CLANG. The compilers bin directory is in $PATH and the right binaries gets picked (when invoking 'which clang'). I'm calling make like so:

make LOCAL_CLANG=true LOCAL_CC=clang LOCAL_CXX=clang++ -j17

but I only get a long list of errors:

external/libcxx/src/thread.cpp:63: error: unsupported reloc 43
external/libcxx/src/thread.cpp:133: error: unsupported reloc 43
external/libcxx/src/thread.cpp:133: error: unsupported reloc 43
external/libcxx/include/thread:146: error: unsupported reloc 43
external/libcxx/include/thread:149: error: unsupported reloc 43
external/libcxx/include/thread:149: error: unsupported reloc 43
clang-3.7: error: linker command failed with exit code 1 (use -v to see invocation)
build/core/host_shared_library_internal.mk:44: recipe for target 'out/host/linux-x86/obj32/lib/libc++.so' failed
make: *** [out/host/linux-x86/obj32/lib/libc++.so] Error 1
make: *** wait: No child processes.  Stop.

Btw: I get the same error with Android default CLANG and the given patch for using Snapdragon CLANG as default via shell variable doesn't work (= invalid when copy'n'pasted to a file and applied with git).

Any suggestions/ideas to point me to the right direction?

 

Regards,

Cid

  • Up0
  • Down0
Raja Moderator
Join Date: 17 Apr 13
Posts: 42
Posted: Tue, 2016-03-01 07:27

From the log, it looks like you are building the host (x86) version of libc++.so. Snapdragon LLVM supports only ARM target builds. The AOSP LLVM (provided by Google) does support x86 but I am not sure  what the issue is. I would suggest contacting Google AOSP forums to understand this issue

  • Up0
  • Down0
xboxfanj
Join Date: 11 Feb 13
Posts: 41
Posted: Sat, 2016-05-07 16:34
Raja, The real question at hand here is how do I build every target module (or every target module possible) with the snapdragon compiler and every host module with the AOSP toolchain. Can you post a patch for that please?
  • 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.