1
2include $(BUILD_SYSTEM)/clang/x86_64.mk
3include $(BUILD_SYSTEM)/clang/HOST_x86_common.mk
4
5ifeq ($(HOST_OS),linux)
6CLANG_CONFIG_x86_64_HOST_TRIPLE := x86_64-linux-gnu
7CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_ASFLAGS := $(CLANG_CONFIG_x86_LINUX_HOST_EXTRA_ASFLAGS)
8CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_CFLAGS := $(CLANG_CONFIG_x86_LINUX_HOST_EXTRA_CFLAGS)
9CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_CPPFLAGS := $(CLANG_CONFIG_x86_LINUX_HOST_EXTRA_CPPFLAGS)
10CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_LDFLAGS := $(CLANG_CONFIG_x86_LINUX_HOST_EXTRA_LDFLAGS)
11endif
12ifeq ($(HOST_OS),darwin)
13CLANG_CONFIG_x86_64_HOST_TRIPLE := x86_64-apple-darwin
14endif
15ifeq ($(HOST_OS),windows)
16CLANG_CONFIG_x86_64_HOST_TRIPLE := x86_64-pc-mingw64
17endif
18
19CLANG_CONFIG_x86_64_HOST_EXTRA_ASFLAGS := \
20  $(CLANG_CONFIG_EXTRA_ASFLAGS) \
21  $(CLANG_CONFIG_HOST_EXTRA_ASFLAGS) \
22  $(CLANG_CONFIG_x86_64_EXTRA_ASFLAGS) \
23  $(CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_ASFLAGS) \
24  -target $(CLANG_CONFIG_x86_64_HOST_TRIPLE)
25
26CLANG_CONFIG_x86_64_HOST_EXTRA_CFLAGS := \
27  $(CLANG_CONFIG_EXTRA_CFLAGS) \
28  $(CLANG_CONFIG_HOST_EXTRA_CFLAGS) \
29  $(CLANG_CONFIG_x86_64_EXTRA_CFLAGS) \
30  $(CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_CFLAGS) \
31  $(CLANG_CONFIG_x86_64_HOST_EXTRA_ASFLAGS)
32
33CLANG_CONFIG_x86_64_HOST_EXTRA_CPPFLAGS := \
34  $(CLANG_CONFIG_EXTRA_CPPFLAGS) \
35  $(CLANG_CONFIG_HOST_EXTRA_CPPFLAGS) \
36  $(CLANG_CONFIG_x86_64_EXTRA_CPPFLAGS) \
37  $(CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_CPPFLAGS) \
38  -target $(CLANG_CONFIG_x86_64_HOST_TRIPLE)
39
40CLANG_CONFIG_x86_64_HOST_EXTRA_LDFLAGS := \
41  $(CLANG_CONFIG_EXTRA_LDFLAGS) \
42  $(CLANG_CONFIG_HOST_EXTRA_LDFLAGS) \
43  $(CLANG_CONFIG_x86_64_EXTRA_LDFLAGS) \
44  $(CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_LDFLAGS) \
45  -target $(CLANG_CONFIG_x86_64_HOST_TRIPLE)
46
47define convert-to-host-clang-flags
48  $(strip \
49  $(call subst-clang-incompatible-x86_64-flags,\
50  $(filter-out $(CLANG_CONFIG_x86_64_UNKNOWN_CFLAGS),\
51  $(1))))
52endef
53
54CLANG_HOST_GLOBAL_CFLAGS := \
55  $(call convert-to-host-clang-flags,$(HOST_GLOBAL_CFLAGS)) \
56  $(CLANG_CONFIG_x86_64_HOST_EXTRA_CFLAGS)
57
58CLANG_HOST_GLOBAL_CPPFLAGS := \
59  $(call convert-to-host-clang-flags,$(HOST_GLOBAL_CPPFLAGS)) \
60  $(CLANG_CONFIG_x86_64_HOST_EXTRA_CPPFLAGS)
61
62CLANG_HOST_GLOBAL_LDFLAGS := \
63  $(call convert-to-host-clang-flags,$(HOST_GLOBAL_LDFLAGS)) \
64  $(CLANG_CONFIG_x86_64_HOST_EXTRA_LDFLAGS)
65