From 9a8ecf970bf53f7f43a8722212ff4b217a6bb403 Mon Sep 17 00:00:00 2001 From: Doug Kwan Date: Tue, 10 May 2011 21:50:58 -0700 Subject: [PATCH] Allow enabling RTTI in a module. Change-Id: Ie8ce920e3ccb7e53bdf917d8ac5a386df3e7836a --- core/binary.mk | 4 ++++ core/definitions.mk | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/binary.mk b/core/binary.mk index 53534d601d..d6ccfbfbd5 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -574,6 +574,9 @@ installed_static_library_notice_file_targets := \ $(foreach lib,$(LOCAL_STATIC_LIBRARIES) $(LOCAL_WHOLE_STATIC_LIBRARIES), \ NOTICE-$(if $(LOCAL_IS_HOST_MODULE),HOST,TARGET)-STATIC_LIBRARIES-$(lib)) +# Default is -fno-rtti. +LOCAL_RTTI_FLAG ?= -fno-rtti + ########################################################### # Rule-specific variable definitions ########################################################### @@ -581,6 +584,7 @@ $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_YACCFLAGS := $(LOCAL_YACCFLAGS) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_ASFLAGS := $(LOCAL_ASFLAGS) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CFLAGS := $(LOCAL_CFLAGS) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CPPFLAGS := $(LOCAL_CPPFLAGS) +$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_RTTI_FLAG := $(LOCAL_RTTI_FLAG) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_DEBUG_CFLAGS := $(debug_cflags) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_C_INCLUDES := $(LOCAL_C_INCLUDES) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_LDFLAGS := $(LOCAL_LDFLAGS) diff --git a/core/definitions.mk b/core/definitions.mk index 8fb0215acd..4baf31ea71 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -868,7 +868,7 @@ $(hide) $(PRIVATE_CXX) \ $(PRIVATE_TARGET_GLOBAL_CPPFLAGS) \ $(PRIVATE_ARM_CFLAGS) \ ) \ - -fno-rtti \ + $(PRIVATE_RTTI_FLAG) \ $(PRIVATE_CFLAGS) \ $(PRIVATE_CPPFLAGS) \ $(PRIVATE_DEBUG_CFLAGS) \