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