OSDN Git Service

MISched: Fix moving stores across barriers
[android-x86/external-llvm.git] / llvm-device-build.mk
1 LOCAL_MODULE_TARGET_ARCH := $(LLVM_SUPPORTED_ARCH)
2
3 LOCAL_CLANG := true
4
5 LOCAL_CFLAGS := \
6         -D_GNU_SOURCE   \
7         -D__STDC_LIMIT_MACROS   \
8         -D__STDC_CONSTANT_MACROS        \
9         -D__STDC_FORMAT_MACROS  \
10         -O2     \
11         -fomit-frame-pointer    \
12         -Wall   \
13         -W      \
14         -Wno-unused-parameter   \
15         -Wwrite-strings \
16         -Dsprintf=sprintf \
17         $(LOCAL_CFLAGS)
18
19 # ARM64 builds seem to miscompile libLLVM without fno-inline.
20 # Test and eventually remove after a future rebase.
21 LOCAL_CFLAGS_arm64 += -fno-inline
22
23 # The three inline options together reduce libbcc.so almost 1MB.
24 # We move them from global build/core/combo/TARGET_linux-arm.mk
25 # to here.
26 LOCAL_CFLAGS := -DANDROID_TARGET_BUILD \
27                 -finline-functions \
28                 $(LOCAL_CFLAGS)
29
30 ifeq ($(TARGET_BUILD_VARIANT),eng)
31 LOCAL_CFLAGS := -DANDROID_ENGINEERING_BUILD \
32                 $(LOCAL_CFLAGS)
33 endif
34
35 ifeq ($(LLVM_ENABLE_ASSERTION),true)
36 LOCAL_CFLAGS := \
37         $(LOCAL_CFLAGS) \
38         -D_DEBUG        \
39         -UNDEBUG
40 endif
41
42 ifneq ($(REQUIRES_EH),1)
43 LOCAL_CFLAGS += -fno-exceptions
44 else
45 # No action. The device target should not have exception enabled since bionic
46 # doesn't support it
47 REQUIRES_EH := 0
48 endif
49
50 ifneq ($(REQUIRES_RTTI),1)
51 LOCAL_CPPFLAGS +=       -fno-rtti
52 else
53 REQUIRES_RTTI := 0
54 endif
55
56 LOCAL_CPPFLAGS :=       \
57         $(LOCAL_CPPFLAGS)       \
58         -Woverloaded-virtual    \
59         -Wno-sign-promo         \
60         -std=c++11
61
62 # Make sure bionic is first so we can include system headers.
63 LOCAL_C_INCLUDES :=     \
64         bionic \
65         external/libcxx/include \
66         $(LLVM_ROOT_PATH)       \
67         $(LLVM_ROOT_PATH)/include       \
68         $(LLVM_ROOT_PATH)/device/include        \
69         $(LOCAL_C_INCLUDES)
70
71 include external/libcxx/libcxx.mk
72
73 ###########################################################
74 ## Commands for running tblgen to compile a td file
75 ###########################################################
76 define transform-device-td-to-out
77 @mkdir -p $(dir $@)
78 @echo "Device TableGen (gen-$(1)): $(TBLGEN_LOCAL_MODULE) <= $<"
79 $(hide) $(LLVM_TBLGEN) \
80         -I $(dir $<)    \
81         -I $(LLVM_ROOT_PATH)/include    \
82         -I $(LLVM_ROOT_PATH)/device/include     \
83         -I $(LLVM_ROOT_PATH)/lib/Target \
84     -gen-$(strip $(1)) \
85     -o $@ $<
86 endef