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