OSDN Git Service

Object/WasmObjectFile: Fix comparison of different signs
[android-x86/external-llvm.git] / llvm-host-build.mk
1 ifeq ($(FORCE_BUILD_LLVM_DEBUG),true)
2 local_optflags = -O0 -g
3 else
4 local_optflags = -O2
5 endif
6
7 LOCAL_CFLAGS += \
8         -D_GNU_SOURCE   \
9         -D__STDC_LIMIT_MACROS   \
10         $(local_optflags)       \
11         -fomit-frame-pointer    \
12         -Wall   \
13         -W      \
14         -Wno-unused-parameter   \
15         -Wno-maybe-uninitialized \
16         -Wno-missing-field-initializers \
17         -Wwrite-strings \
18         -Werror \
19         -Dsprintf=sprintf \
20         $(LOCAL_CFLAGS)
21
22 ifeq ($(FORCE_BUILD_LLVM_GLOBAL_ISEL),true)
23 LOCAL_CFLAGS += \
24         -DLLVM_BUILD_GLOBAL_ISEL
25 endif
26
27 # Disable certain warnings for use with mingw.
28 # We also must undefine WIN32_LEAN_AND_MEAN, since it is being passed globally
29 # on the command line, and LLVM defines this internally itself.
30 LOCAL_CFLAGS_windows += -Wno-array-bounds \
31                         -Wno-comment \
32                         -UWIN32_LEAN_AND_MEAN
33
34 ifeq ($(FORCE_BUILD_LLVM_DISABLE_NDEBUG),true)
35 LOCAL_CFLAGS := \
36         $(LOCAL_CFLAGS) \
37         -D_DEBUG        \
38         -UNDEBUG
39 endif
40
41 ifneq ($(REQUIRES_EH),1)
42 LOCAL_CFLAGS += -fno-exceptions
43 else
44 REQUIRES_EH := 0
45 LOCAL_CFLAGS += -fexceptions
46 endif
47
48 ifneq ($(REQUIRES_RTTI),1)
49 LOCAL_CPPFLAGS += -fno-rtti
50 else
51 REQUIRES_RTTI := 0
52 endif
53
54 LOCAL_CPPFLAGS :=       \
55         $(LOCAL_CPPFLAGS)       \
56         -Wno-sign-promo         \
57         -std=c++11
58
59 LOCAL_CPPFLAGS_linux := \
60         -Woverloaded-virtual
61
62 LOCAL_CPPFLAGS_darwin += \
63         -Wno-deprecated-declarations \
64         -Woverloaded-virtual
65
66 # Make sure bionic is first so we can include system headers.
67 LOCAL_C_INCLUDES :=     \
68         $(LLVM70_ROOT_PATH)     \
69         $(LLVM70_ROOT_PATH)/include     \
70         $(LLVM70_ROOT_PATH)/host/include        \
71         $(LOCAL_C_INCLUDES)
72
73 # Add on ncurses to have support for terminfo
74 LOCAL_LDLIBS_darwin += -lncurses
75 LOCAL_LDLIBS_linux += -lncurses
76 LOCAL_LDLIBS_linux += -lgcc_s
77
78 LOCAL_IS_HOST_MODULE := true
79
80 ifeq ($(HOST_PREFER_32_BIT),true)
81 LOCAL_MULTILIB := 32
82 else
83 ifeq (libLLVM70, $(filter libLLVM70,$(LOCAL_SHARED_LIBRARIES)$(LOCAL_SHARED_LIBRARIES_$(HOST_OS))))
84 # Skip building a 32-bit shared object if they are using libLLVM70.
85 LOCAL_MULTILIB := first
86 endif
87 endif
88
89 ###########################################################
90 ## Commands for running tblgen to compile a td file
91 ###########################################################
92 define transform-host-td-to-out70
93 @mkdir -p $(dir $@)
94 @echo "Host TableGen: $(TBLGEN_LOCAL_MODULE) (gen-$(1)) <= $<"
95 $(hide) $(LLVM70_TBLGEN) \
96         -I $(dir $<)    \
97         -I $(LLVM70_ROOT_PATH)/include  \
98         -I $(LLVM70_ROOT_PATH)/host/include     \
99         -I $(LLVM70_ROOT_PATH)/lib/Target       \
100         $(if $(strip $(CLANG_ROOT_PATH)),-I $(CLANG_ROOT_PATH)/include,)        \
101         -gen-$(strip $(1))      \
102         -o $@ $<
103 endef