platform_build/core/clang/TARGET_mips.mk
Chih-Hung Hsieh ce6300a5db Add -fPIC as default Clang mips ASFLAGS.
For mips target, gcc passes -KPIC to assembler by default,
but clang passes -KPIC only if -fPIC or -fpic is given.

BUG: 17895505
Change-Id: I7803adaf8ad7b40c6473872b67f4e0b4c502b38a
2014-10-08 15:41:29 -07:00

56 lines
2 KiB
Makefile

include $(BUILD_SYSTEM)/clang/mips.mk
CLANG_CONFIG_mips_TARGET_TRIPLE := mipsel-linux-android
CLANG_CONFIG_mips_TARGET_TOOLCHAIN_PREFIX := \
$($(clang_2nd_arch_prefix)TARGET_TOOLCHAIN_ROOT)/mips64el-linux-android/bin
CLANG_CONFIG_mips_TARGET_EXTRA_ASFLAGS := \
$(CLANG_CONFIG_EXTRA_ASFLAGS) \
$(CLANG_CONFIG_TARGET_EXTRA_ASFLAGS) \
$(CLANG_CONFIG_mips_EXTRA_ASFLAGS) \
-fPIC \
-target $(CLANG_CONFIG_mips_TARGET_TRIPLE) \
-B$(CLANG_CONFIG_mips_TARGET_TOOLCHAIN_PREFIX)
CLANG_CONFIG_mips_TARGET_EXTRA_CFLAGS := \
$(CLANG_CONFIG_EXTRA_CFLAGS) \
$(CLANG_CONFIG_TARGET_EXTRA_CFLAGS) \
$(CLANG_CONFIG_mips_EXTRA_CFLAGS) \
$(CLANG_CONFIG_mips_TARGET_EXTRA_ASFLAGS)
CLANG_CONFIG_mips_TARGET_EXTRA_CPPFLAGS := \
$(CLANG_CONFIG_EXTRA_CPPFLAGS) \
$(CLANG_CONFIG_TARGET_EXTRA_CPPFLAGS) \
$(CLANG_CONFIG_mips_EXTRA_CPPFLAGS) \
CLANG_CONFIG_mips_TARGET_EXTRA_LDFLAGS := \
$(CLANG_CONFIG_EXTRA_LDFLAGS) \
$(CLANG_CONFIG_TARGET_EXTRA_LDFLAGS) \
$(CLANG_CONFIG_mips_EXTRA_LDFLAGS) \
-target $(CLANG_CONFIG_mips_TARGET_TRIPLE) \
-B$(CLANG_CONFIG_mips_TARGET_TOOLCHAIN_PREFIX)
define $(clang_2nd_arch_prefix)convert-to-clang-flags
$(strip \
$(call subst-clang-incompatible-mips-flags,\
$(filter-out $(CLANG_CONFIG_mips_UNKNOWN_CFLAGS),\
$(1))))
endef
$(clang_2nd_arch_prefix)CLANG_TARGET_GLOBAL_CFLAGS := \
$(call $(clang_2nd_arch_prefix)convert-to-clang-flags,$($(clang_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS)) \
$(CLANG_CONFIG_mips_TARGET_EXTRA_CFLAGS)
$(clang_2nd_arch_prefix)CLANG_TARGET_GLOBAL_CPPFLAGS := \
$(call $(clang_2nd_arch_prefix)convert-to-clang-flags,$($(clang_2nd_arch_prefix)TARGET_GLOBAL_CPPFLAGS)) \
$(CLANG_CONFIG_mips_TARGET_EXTRA_CPPFLAGS)
$(clang_2nd_arch_prefix)CLANG_TARGET_GLOBAL_LDFLAGS := \
$(call $(clang_2nd_arch_prefix)convert-to-clang-flags,$($(clang_2nd_arch_prefix)TARGET_GLOBAL_LDFLAGS)) \
$(CLANG_CONFIG_mips_TARGET_EXTRA_LDFLAGS)
$(clang_2nd_arch_prefix)RS_TRIPLE := armv7-none-linux-gnueabi
$(clang_2nd_arch_prefix)RS_TRIPLE_CFLAGS :=
RS_COMPAT_TRIPLE := mipsel-linux-android