去掉没有调用的代码。
LOCAL_CPPFLAGS += -ffunction-sections -fdata-sections
LOCAL_CFLAGS += -ffunction-sections -fdata-sections
LOCAL_LDFLAGS += -Wl,--gc-sections
去掉符号表。
LOCAL_CFLAGS := \
'-fvisibility=hidden'
本文介绍了一种通过配置编译选项来精简代码的方法,包括移除未使用的代码段和符号表,以此来减小最终输出文件的体积。
去掉没有调用的代码。
LOCAL_CPPFLAGS += -ffunction-sections -fdata-sections
LOCAL_CFLAGS += -ffunction-sections -fdata-sections
LOCAL_LDFLAGS += -Wl,--gc-sections
去掉符号表。
LOCAL_CFLAGS := \
'-fvisibility=hidden'

被折叠的 条评论
为什么被折叠?