Skip to content

Commit

Permalink
Use GCC visibility to reduce ICU code size.
Browse files Browse the repository at this point in the history
From Jim Huang's original patch, but adapted to the internal tree, and
removing duplication.

Bug: https://review.source.android.com/17018
Change-Id: I193dec19222ec405b4f35335b7932f4fb1c3ff44
  • Loading branch information
enh-google committed Nov 9, 2010
1 parent 65f7853 commit e05e358
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
3 changes: 1 addition & 2 deletions common/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ c_includes := \
local_cflags := '-DICU_DATA_DIR_PREFIX_ENV_VAR="ANDROID_ROOT"'
local_cflags += '-DICU_DATA_DIR="/usr/icu"'

local_cflags += -D_REENTRANT -DU_COMMON_IMPLEMENTATION -O3
local_cflags += -D_REENTRANT -DU_COMMON_IMPLEMENTATION -O3 -fvisibility=hidden
local_ldlibs := -lpthread -lm


Expand Down Expand Up @@ -148,5 +148,4 @@ ifeq ($(WITH_HOST_DALVIK),true)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := libicuuc
include $(BUILD_HOST_SHARED_LIBRARY)

endif
22 changes: 7 additions & 15 deletions i18n/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -81,24 +81,22 @@ c_includes = \
$(LOCAL_PATH) \
$(LOCAL_PATH)/../common

local_cflags := -D_REENTRANT -DU_I18N_IMPLEMENTATION -O3 -fvisibility=hidden
local_ldlibs := -lpthread -lm


#
# Build for the target (device).
#

include $(CLEAR_VARS)

LOCAL_SRC_FILES := $(src_files)
LOCAL_C_INCLUDES := $(c_includes)

LOCAL_CFLAGS += -D_REENTRANT -DPIC -DU_I18N_IMPLEMENTATION -fPIC
LOCAL_CFLAGS += -O3

LOCAL_CFLAGS += $(local_cflags) -DPIC -fPIC
LOCAL_SHARED_LIBRARIES += libicuuc
LOCAL_LDLIBS += -lpthread -lm
LOCAL_LDLIBS += $(local_ldlibs)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := libicui18n

include $(BUILD_SHARED_LIBRARY)


Expand All @@ -107,19 +105,13 @@ include $(BUILD_SHARED_LIBRARY)
#

ifeq ($(WITH_HOST_DALVIK),true)

include $(CLEAR_VARS)

LOCAL_SRC_FILES := $(src_files)
LOCAL_C_INCLUDES := $(c_includes)

LOCAL_CFLAGS += -D_REENTRANT -DU_I18N_IMPLEMENTATION

LOCAL_CFLAGS += $(local_cflags)
LOCAL_SHARED_LIBRARIES += libicuuc
LOCAL_LDLIBS += -lpthread -lm
LOCAL_LDLIBS += $(local_ldlibs)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := libicui18n

include $(BUILD_HOST_SHARED_LIBRARY)

endif

0 comments on commit e05e358

Please sign in to comment.