Home | History | Annotate | Download | only in clang
      1 
      2 include $(BUILD_SYSTEM)/clang/x86.mk
      3 include $(BUILD_SYSTEM)/clang/HOST_x86_common.mk
      4 
      5 ifeq ($(HOST_OS),linux)
      6 CLANG_CONFIG_x86_HOST_TRIPLE := i686-linux-gnu
      7 CLANG_CONFIG_x86_HOST_COMBO_EXTRA_ASFLAGS := $(CLANG_CONFIG_x86_LINUX_HOST_EXTRA_ASFLAGS)
      8 CLANG_CONFIG_x86_HOST_COMBO_EXTRA_CFLAGS := $(CLANG_CONFIG_x86_LINUX_HOST_EXTRA_CFLAGS)
      9 CLANG_CONFIG_x86_HOST_COMBO_EXTRA_CPPFLAGS := $(CLANG_CONFIG_x86_LINUX_HOST_EXTRA_CPPFLAGS)
     10 CLANG_CONFIG_x86_HOST_COMBO_EXTRA_LDFLAGS := $(CLANG_CONFIG_x86_LINUX_HOST_EXTRA_LDFLAGS)
     11 endif
     12 ifeq ($(HOST_OS),darwin)
     13 CLANG_CONFIG_x86_HOST_TRIPLE := i686-apple-darwin
     14 CLANG_CONFIG_x86_HOST_COMBO_EXTRA_ASFLAGS := $(CLANG_CONFIG_x86_DARWIN_HOST_EXTRA_ASFLAGS)
     15 CLANG_CONFIG_x86_HOST_COMBO_EXTRA_CFLAGS := $(CLANG_CONFIG_x86_DARWIN_HOST_EXTRA_CFLAGS)
     16 CLANG_CONFIG_x86_HOST_COMBO_EXTRA_CPPFLAGS := $(CLANG_CONFIG_x86_DARWIN_HOST_EXTRA_CPPFLAGS)
     17 CLANG_CONFIG_x86_HOST_COMBO_EXTRA_LDFLAGS := $(CLANG_CONFIG_x86_DARWIN_HOST_EXTRA_LDFLAGS)
     18 endif
     19 
     20 CLANG_CONFIG_x86_HOST_EXTRA_ASFLAGS := \
     21   $(CLANG_CONFIG_EXTRA_ASFLAGS) \
     22   $(CLANG_CONFIG_HOST_EXTRA_ASFLAGS) \
     23   $(CLANG_CONFIG_x86_EXTRA_ASFLAGS) \
     24   $(CLANG_CONFIG_x86_HOST_COMBO_EXTRA_ASFLAGS) \
     25   -target $(CLANG_CONFIG_x86_HOST_TRIPLE)
     26 
     27 CLANG_CONFIG_x86_HOST_EXTRA_CFLAGS := \
     28   $(CLANG_CONFIG_EXTRA_CFLAGS) \
     29   $(CLANG_CONFIG_HOST_EXTRA_CFLAGS) \
     30   $(CLANG_CONFIG_x86_EXTRA_CFLAGS) \
     31   $(CLANG_CONFIG_x86_HOST_COMBO_EXTRA_CFLAGS) \
     32   $(CLANG_CONFIG_x86_HOST_EXTRA_ASFLAGS)
     33 
     34 CLANG_CONFIG_x86_HOST_EXTRA_CONLYFLAGS := \
     35   $(CLANG_CONFIG_EXTRA_CONLYFLAGS) \
     36   $(CLANG_CONFIG_HOST_EXTRA_CONLYFLAGS) \
     37   $(CLANG_CONFIG_x86_EXTRA_CONLYFLAGS) \
     38   $(CLANG_CONFIG_x86_HOST_COMBO_EXTRA_CONLYFLAGS)
     39 
     40 CLANG_CONFIG_x86_HOST_EXTRA_CPPFLAGS := \
     41   $(CLANG_CONFIG_EXTRA_CPPFLAGS) \
     42   $(CLANG_CONFIG_HOST_EXTRA_CPPFLAGS) \
     43   $(CLANG_CONFIG_x86_EXTRA_CPPFLAGS) \
     44   $(CLANG_CONFIG_x86_HOST_COMBO_EXTRA_CPPFLAGS) \
     45   -target $(CLANG_CONFIG_x86_HOST_TRIPLE)
     46 
     47 CLANG_CONFIG_x86_HOST_EXTRA_LDFLAGS := \
     48   $(CLANG_CONFIG_EXTRA_LDFLAGS) \
     49   $(CLANG_CONFIG_HOST_EXTRA_LDFLAGS) \
     50   $(CLANG_CONFIG_x86_EXTRA_LDFLAGS) \
     51   $(CLANG_CONFIG_x86_HOST_COMBO_EXTRA_LDFLAGS) \
     52   -target $(CLANG_CONFIG_x86_HOST_TRIPLE)
     53 
     54 define $(clang_2nd_arch_prefix)convert-to-host-clang-flags
     55   $(strip \
     56   $(call subst-clang-incompatible-x86-flags,\
     57   $(filter-out $(CLANG_CONFIG_x86_UNKNOWN_CFLAGS),\
     58   $(1))))
     59 endef
     60 
     61 $(clang_2nd_arch_prefix)CLANG_HOST_GLOBAL_CFLAGS := \
     62   $(call $(clang_2nd_arch_prefix)convert-to-host-clang-flags,$($(clang_2nd_arch_prefix)HOST_GLOBAL_CFLAGS)) \
     63   $(CLANG_CONFIG_x86_HOST_EXTRA_CFLAGS)
     64 
     65 $(clang_2nd_arch_prefix)CLANG_HOST_GLOBAL_CONLYFLAGS := \
     66   $(call $(clang_2nd_arch_prefix)convert-to-host-clang-flags,$($(clang_2nd_arch_prefix)HOST_GLOBAL_CONLYFLAGS)) \
     67   $(CLANG_CONFIG_x86_HOST_EXTRA_CONLYFLAGS)
     68 
     69 $(clang_2nd_arch_prefix)CLANG_HOST_GLOBAL_CPPFLAGS := \
     70   $(call $(clang_2nd_arch_prefix)convert-to-host-clang-flags,$($(clang_2nd_arch_prefix)HOST_GLOBAL_CPPFLAGS)) \
     71   $(CLANG_CONFIG_x86_HOST_EXTRA_CPPFLAGS)
     72 
     73 $(clang_2nd_arch_prefix)CLANG_HOST_GLOBAL_LDFLAGS := \
     74   $(call $(clang_2nd_arch_prefix)convert-to-host-clang-flags,$($(clang_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS)) \
     75   $(CLANG_CONFIG_x86_HOST_EXTRA_LDFLAGS)
     76 
     77 $(clang_2nd_arch_prefix)HOST_LIBPROFILE_RT := $(LLVM_RTLIB_PATH)/libclang_rt.profile-i686.a
     78