Home | History | Annotate | Download | only in clang
      1 
      2 include $(BUILD_SYSTEM)/clang/x86_64.mk
      3 include $(BUILD_SYSTEM)/clang/HOST_x86_common.mk
      4 
      5 ifeq ($(HOST_OS),linux)
      6 CLANG_CONFIG_x86_64_HOST_TRIPLE := x86_64-linux-gnu
      7 CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_ASFLAGS := $(CLANG_CONFIG_x86_LINUX_HOST_EXTRA_ASFLAGS)
      8 CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_CFLAGS := $(CLANG_CONFIG_x86_LINUX_HOST_EXTRA_CFLAGS)
      9 CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_CPPFLAGS := $(CLANG_CONFIG_x86_LINUX_HOST_EXTRA_CPPFLAGS)
     10 CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_LDFLAGS := $(CLANG_CONFIG_x86_LINUX_HOST_EXTRA_LDFLAGS)
     11 endif
     12 ifeq ($(HOST_OS),darwin)
     13 CLANG_CONFIG_x86_64_HOST_TRIPLE := x86_64-apple-darwin
     14 CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_ASFLAGS := $(CLANG_CONFIG_x86_DARWIN_HOST_EXTRA_ASFLAGS)
     15 CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_CFLAGS := $(CLANG_CONFIG_x86_DARWIN_HOST_EXTRA_CFLAGS)
     16 CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_CPPFLAGS := $(CLANG_CONFIG_x86_DARWIN_HOST_EXTRA_CPPFLAGS)
     17 CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_LDFLAGS := $(CLANG_CONFIG_x86_DARWIN_HOST_EXTRA_LDFLAGS)
     18 endif
     19 
     20 CLANG_CONFIG_x86_64_HOST_EXTRA_ASFLAGS := \
     21   $(CLANG_CONFIG_EXTRA_ASFLAGS) \
     22   $(CLANG_CONFIG_HOST_EXTRA_ASFLAGS) \
     23   $(CLANG_CONFIG_x86_64_EXTRA_ASFLAGS) \
     24   $(CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_ASFLAGS) \
     25   -target $(CLANG_CONFIG_x86_64_HOST_TRIPLE)
     26 
     27 CLANG_CONFIG_x86_64_HOST_EXTRA_CFLAGS := \
     28   $(CLANG_CONFIG_EXTRA_CFLAGS) \
     29   $(CLANG_CONFIG_HOST_EXTRA_CFLAGS) \
     30   $(CLANG_CONFIG_x86_64_EXTRA_CFLAGS) \
     31   $(CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_CFLAGS) \
     32   $(CLANG_CONFIG_x86_64_HOST_EXTRA_ASFLAGS)
     33 
     34 CLANG_CONFIG_x86_64_HOST_EXTRA_CONLYFLAGS := \
     35   $(CLANG_CONFIG_EXTRA_CONLYFLAGS) \
     36   $(CLANG_CONFIG_HOST_EXTRA_CONLYFLAGS) \
     37   $(CLANG_CONFIG_x86_64_EXTRA_CONLYFLAGS) \
     38   $(CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_CONLYFLAGS)
     39 
     40 CLANG_CONFIG_x86_64_HOST_EXTRA_CPPFLAGS := \
     41   $(CLANG_CONFIG_EXTRA_CPPFLAGS) \
     42   $(CLANG_CONFIG_HOST_EXTRA_CPPFLAGS) \
     43   $(CLANG_CONFIG_x86_64_EXTRA_CPPFLAGS) \
     44   $(CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_CPPFLAGS) \
     45   -target $(CLANG_CONFIG_x86_64_HOST_TRIPLE)
     46 
     47 CLANG_CONFIG_x86_64_HOST_EXTRA_LDFLAGS := \
     48   $(CLANG_CONFIG_EXTRA_LDFLAGS) \
     49   $(CLANG_CONFIG_HOST_EXTRA_LDFLAGS) \
     50   $(CLANG_CONFIG_x86_64_EXTRA_LDFLAGS) \
     51   $(CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_LDFLAGS) \
     52   -target $(CLANG_CONFIG_x86_64_HOST_TRIPLE)
     53 
     54 define convert-to-host-clang-flags
     55   $(strip \
     56   $(call subst-clang-incompatible-x86_64-flags,\
     57   $(filter-out $(CLANG_CONFIG_x86_64_UNKNOWN_CFLAGS),\
     58   $(1))))
     59 endef
     60 
     61 CLANG_HOST_GLOBAL_CFLAGS := \
     62   $(call convert-to-host-clang-flags,$(HOST_GLOBAL_CFLAGS)) \
     63   $(CLANG_CONFIG_x86_64_HOST_EXTRA_CFLAGS)
     64 
     65 CLANG_HOST_GLOBAL_CONLYFLAGS := \
     66   $(call convert-to-host-clang-flags,$(HOST_GLOBAL_CONLYFLAGS)) \
     67   $(CLANG_CONFIG_x86_64_HOST_EXTRA_CONLYFLAGS)
     68 
     69 CLANG_HOST_GLOBAL_CPPFLAGS := \
     70   $(call convert-to-host-clang-flags,$(HOST_GLOBAL_CPPFLAGS)) \
     71   $(CLANG_CONFIG_x86_64_HOST_EXTRA_CPPFLAGS)
     72 
     73 CLANG_HOST_GLOBAL_LDFLAGS := \
     74   $(call convert-to-host-clang-flags,$(HOST_GLOBAL_LDFLAGS)) \
     75   $(CLANG_CONFIG_x86_64_HOST_EXTRA_LDFLAGS)
     76 
     77 HOST_LIBPROFILE_RT := $(LLVM_RTLIB_PATH)/libclang_rt.profile-x86_64.a
     78