Home | History | Annotate | Download | only in clang
      1 
      2 include $(BUILD_SYSTEM)/clang/x86.mk
      3 
      4 CLANG_CONFIG_x86_TARGET_TRIPLE := i686-linux-android
      5 # NOTE: There is no i686-linux-android prebuilt, so we must hardcode the
      6 # x86_64 target instead.
      7 CLANG_CONFIG_x86_TARGET_TOOLCHAIN_PREFIX := \
      8   $($(clang_2nd_arch_prefix)TARGET_TOOLCHAIN_ROOT)/x86_64-linux-android/bin
      9 
     10 CLANG_CONFIG_x86_TARGET_EXTRA_ASFLAGS := \
     11   $(CLANG_CONFIG_EXTRA_ASFLAGS) \
     12   $(CLANG_CONFIG_TARGET_EXTRA_ASFLAGS) \
     13   $(CLANG_CONFIG_x86_EXTRA_ASFLAGS) \
     14   -target $(CLANG_CONFIG_x86_TARGET_TRIPLE) \
     15   -B$(CLANG_CONFIG_x86_TARGET_TOOLCHAIN_PREFIX)
     16 
     17 CLANG_CONFIG_x86_TARGET_EXTRA_CFLAGS := \
     18   $(CLANG_CONFIG_EXTRA_CFLAGS) \
     19   $(CLANG_CONFIG_TARGET_EXTRA_CFLAGS) \
     20   $(CLANG_CONFIG_x86_EXTRA_CFLAGS) \
     21   $(CLANG_CONFIG_x86_TARGET_EXTRA_ASFLAGS) \
     22   -mstackrealign
     23 
     24 # -mstackrealign is needed to realign stack in native code
     25 # that could be called from JNI, so that movaps instruction
     26 # will work on assumed stack aligned local variables.
     27 
     28 CLANG_CONFIG_x86_TARGET_EXTRA_CONLYFLAGS := \
     29   $(CLANG_CONFIG_EXTRA_CONLYFLAGS) \
     30   $(CLANG_CONFIG_TARGET_EXTRA_CONLYFLAGS) \
     31   $(CLANG_CONFIG_x86_EXTRA_CONLYFLAGS)
     32 
     33 CLANG_CONFIG_x86_TARGET_EXTRA_CPPFLAGS := \
     34   $(CLANG_CONFIG_EXTRA_CPPFLAGS) \
     35   $(CLANG_CONFIG_TARGET_EXTRA_CPPFLAGS) \
     36   $(CLANG_CONFIG_x86_EXTRA_CPPFLAGS) \
     37 
     38 CLANG_CONFIG_x86_TARGET_EXTRA_LDFLAGS := \
     39   $(CLANG_CONFIG_EXTRA_LDFLAGS) \
     40   $(CLANG_CONFIG_TARGET_EXTRA_LDFLAGS) \
     41   $(CLANG_CONFIG_x86_EXTRA_LDFLAGS) \
     42   -target $(CLANG_CONFIG_x86_TARGET_TRIPLE) \
     43   -B$(CLANG_CONFIG_x86_TARGET_TOOLCHAIN_PREFIX)
     44 
     45 
     46 define $(clang_2nd_arch_prefix)convert-to-clang-flags
     47   $(strip \
     48   $(call subst-clang-incompatible-x86-flags,\
     49   $(filter-out $(CLANG_CONFIG_x86_UNKNOWN_CFLAGS),\
     50   $(1))))
     51 endef
     52 
     53 $(clang_2nd_arch_prefix)CLANG_TARGET_GLOBAL_CFLAGS := \
     54   $(call $(clang_2nd_arch_prefix)convert-to-clang-flags,$($(clang_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS)) \
     55   $(CLANG_CONFIG_x86_TARGET_EXTRA_CFLAGS)
     56 
     57 $(clang_2nd_arch_prefix)CLANG_TARGET_GLOBAL_CONLYFLAGS := \
     58   $(call $(clang_2nd_arch_prefix)convert-to-clang-flags,$($(clang_2nd_arch_prefix)TARGET_GLOBAL_CONLYFLAGS)) \
     59   $(CLANG_CONFIG_x86_TARGET_EXTRA_CONLYFLAGS)
     60 
     61 $(clang_2nd_arch_prefix)CLANG_TARGET_GLOBAL_CPPFLAGS := \
     62   $(call $(clang_2nd_arch_prefix)convert-to-clang-flags,$($(clang_2nd_arch_prefix)TARGET_GLOBAL_CPPFLAGS)) \
     63   $(CLANG_CONFIG_x86_TARGET_EXTRA_CPPFLAGS)
     64 
     65 $(clang_2nd_arch_prefix)CLANG_TARGET_GLOBAL_LDFLAGS := \
     66   $(call $(clang_2nd_arch_prefix)convert-to-clang-flags,$($(clang_2nd_arch_prefix)TARGET_GLOBAL_LDFLAGS)) \
     67   $(CLANG_CONFIG_x86_TARGET_EXTRA_LDFLAGS)
     68 
     69 $(clang_2nd_arch_prefix)RS_TRIPLE := armv7-linux-androideabi
     70 $(clang_2nd_arch_prefix)RS_TRIPLE_CFLAGS := -D__i386__
     71 $(clang_2nd_arch_prefix)RS_COMPAT_TRIPLE := i686-linux-android
     72 
     73 $(clang_2nd_arch_prefix)TARGET_LIBPROFILE_RT := $(LLVM_RTLIB_PATH)/libclang_rt.profile-i686-android.a
     74 
     75 # Address sanitizer clang config
     76 $(clang_2nd_arch_prefix)ADDRESS_SANITIZER_RUNTIME_LIBRARY := libclang_rt.asan-i686-android
     77 $(clang_2nd_arch_prefix)ADDRESS_SANITIZER_LINKER := /system/bin/linker_asan
     78