OSDN Git Service

android: shared_llvm.mk: add libLLVMOrcJIT to llvm_device_static_libraries
[android-x86/external-llvm.git] / llvm-device-build.mk
1 LOCAL_MODULE_TARGET_ARCH := $(LLVM90_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         -Werror \
17         -Dsprintf=sprintf \
18         $(LOCAL_CFLAGS)
19
20 ifeq ($(FORCE_BUILD_LLVM_GLOBAL_ISEL),true)
21 LOCAL_CFLAGS += \
22         -DLLVM_BUILD_GLOBAL_ISEL
23 endif
24
25 # The three inline options together reduce libbcc.so almost 1MB.
26 # We move them from global build/core/combo/TARGET_linux-arm.mk
27 # to here.
28 LOCAL_CFLAGS := -DANDROID_TARGET_BUILD \
29                 -finline-functions \
30                 $(LOCAL_CFLAGS)
31
32 ifeq ($(TARGET_BUILD_VARIANT),eng)
33 LOCAL_CFLAGS := -DANDROID_ENGINEERING_BUILD \
34                 $(LOCAL_CFLAGS)
35 endif
36
37 ifeq ($(FORCE_BUILD_LLVM_DISABLE_NDEBUG),true)
38 LOCAL_CFLAGS := \
39         $(LOCAL_CFLAGS) \
40         -D_DEBUG        \
41         -UNDEBUG
42 endif
43
44 ifneq ($(REQUIRES_EH),1)
45 LOCAL_CFLAGS += -fno-exceptions
46 else
47 # No action. The device target should not have exception enabled since bionic
48 # doesn't support it
49 REQUIRES_EH := 0
50 endif
51
52 ifneq ($(REQUIRES_RTTI),1)
53 LOCAL_CPPFLAGS +=       -fno-rtti
54 else
55 REQUIRES_RTTI := 0
56 endif
57
58 LOCAL_CPPFLAGS :=       \
59         $(LOCAL_CPPFLAGS)       \
60         -Woverloaded-virtual    \
61         -Wno-sign-promo         \
62         -std=c++11
63
64 # Make sure bionic is first so we can include system headers.
65 LOCAL_C_INCLUDES :=     \
66         bionic \
67         $(LLVM90_ROOT_PATH)     \
68         $(LLVM90_ROOT_PATH)/include     \
69         $(LLVM90_ROOT_PATH)/device/include      \
70         $(LOCAL_C_INCLUDES)
71
72 ###########################################################
73 ## Commands for running tblgen to compile a td file
74 ###########################################################
75 define transform-device-td-to-out90
76 @mkdir -p $(dir $@)
77 @echo "Device TableGen (gen-$(1)): $(TBLGEN_LOCAL_MODULE) <= $<"
78 $(hide) $(LLVM90_TBLGEN) \
79         -I $(dir $<)    \
80         -I $(LLVM90_ROOT_PATH)/include  \
81         -I $(LLVM90_ROOT_PATH)/device/include   \
82         -I $(LLVM90_ROOT_PATH)/lib/Target       \
83     -gen-$(strip $(1)) \
84     -o $@ $<
85 endef