Refactor Stripper. Allow a stripper other than SOSLIM to be specified

Orig-Change-Id: I61137f5bb123dc5f610af9928ed3debdf85ba74d
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
This commit is contained in:
Bruce Beare 2011-05-31 10:40:20 -07:00 committed by David 'Digit' Turner
parent 742968bda2
commit c101e27d54
8 changed files with 14 additions and 9 deletions

View File

@ -45,6 +45,8 @@ HOST_NO_UNDEFINED_LDFLAGS := -Wl,-undefined,error
HOST_CC := $(CC)
HOST_CXX := $(CXX)
HOST_AR := $(AR)
HOST_STRIP := $(STRIP)
HOST_STRIP_COMMAND = $(HOST_STRIP) --strip-debug $< -o $@
HOST_SHLIB_SUFFIX := .dylib
HOST_JNILIB_SUFFIX := .jnilib

View File

@ -52,6 +52,8 @@ TARGET_CXX := $(TARGET_TOOLS_PREFIX)g++$(HOST_EXECUTABLE_SUFFIX)
TARGET_AR := $(TARGET_TOOLS_PREFIX)ar$(HOST_EXECUTABLE_SUFFIX)
TARGET_OBJCOPY := $(TARGET_TOOLS_PREFIX)objcopy$(HOST_EXECUTABLE_SUFFIX)
TARGET_LD := $(TARGET_TOOLS_PREFIX)ld$(HOST_EXECUTABLE_SUFFIX)
TARGET_STRIP := $(HOST_OUT_EXECUTABLES)/soslim$(HOST_EXECUTABLE_SUFFIX)
TARGET_STRIP_COMMAND = $(TARGET_STRIP) --strip --shady --quiet $< --outfile $@
TARGET_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined

View File

@ -28,6 +28,8 @@ TARGET_CXX := $(TARGET_TOOLS_PREFIX)c++$(HOST_EXECUTABLE_SUFFIX)
TARGET_AR := $(TARGET_TOOLS_PREFIX)ar$(HOST_EXECUTABLE_SUFFIX)
TARGET_OBJCOPY := $(TARGET_TOOLS_PREFIX)objcopy$(HOST_EXECUTABLE_SUFFIX)
TARGET_LD := $(TARGET_TOOLS_PREFIX)ld$(HOST_EXECUTABLE_SUFFIX)
TARGET_STRIP := $(TARGET_TOOLS_PREFIX)strip$(HOST_EXECUTABLE_SUFFIX)
TARGET_STRIP_COMMAND = $(TARGET_STRIP) --strip-debug $< -o $@
TARGET_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined
@ -106,7 +108,7 @@ TARGET_CRTEND_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_android.o
TARGET_CRTBEGIN_SO_O := $(TARGET_OUT_STATIC_LIBRARIES)/sobegin.o
TARGET_CRTEND_SO_O := $(TARGET_OUT_STATIC_LIBRARIES)/soend.o
TARGET_STRIP_MODULE:=false
TARGET_STRIP_MODULE:=true
TARGET_DEFAULT_SYSTEM_SHARED_LIBRARIES := libc libstdc++ libm

View File

@ -44,6 +44,8 @@ TARGET_CXX := $(TARGET_TOOLS_PREFIX)g++$(HOST_EXECUTABLE_SUFFIX)
TARGET_AR := $(TARGET_TOOLS_PREFIX)ar$(HOST_EXECUTABLE_SUFFIX)
TARGET_OBJCOPY := $(TARGET_TOOLS_PREFIX)objcopy$(HOST_EXECUTABLE_SUFFIX)
TARGET_LD := $(TARGET_TOOLS_PREFIX)ld$(HOST_EXECUTABLE_SUFFIX)
TARGET_STRIP := $(TARGET_TOOLS_PREFIX)strip$(HOST_EXECUTABLE_SUFFIX)
TARGET_STRIP_COMMAND = $(TARGET_STRIP) --strip-debug $< -o $@
ifneq ($(wildcard $(TARGET_CC)),)
TARGET_LIBGCC := \
@ -97,7 +99,7 @@ TARGET_CRTEND_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_android.o
TARGET_CRTBEGIN_SO_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_so.o
TARGET_CRTEND_SO_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_so.o
# TARGET_STRIP_MODULE:=true
TARGET_STRIP_MODULE:=true
TARGET_DEFAULT_SYSTEM_SHARED_LIBRARIES := libc libstdc++ libm

View File

@ -28,6 +28,7 @@ combo_os_arch := $($(combo_target)OS)-$($(combo_target)ARCH)
$(combo_target)CC := $(CC)
$(combo_target)CXX := $(CXX)
$(combo_target)AR := $(AR)
$(combo_target)STRIP := $(STRIP)
$(combo_target)BINDER_MINI := 0

View File

@ -232,7 +232,6 @@ EMMA_JAR := external/emma/lib/emma$(COMMON_JAVA_PACKAGE_SUFFIX)
# Binary prelinker/compressor tools
APRIORI := $(HOST_OUT_EXECUTABLES)/apriori$(HOST_EXECUTABLE_SUFFIX)
LSD := $(HOST_OUT_EXECUTABLES)/lsd$(HOST_EXECUTABLE_SUFFIX)
SOSLIM := $(HOST_OUT_EXECUTABLES)/soslim$(HOST_EXECUTABLE_SUFFIX)
# Deal with archaic version of bison on Mac OS X.
ifeq ($(filter 1.28,$(shell $(YACC) -V)),)

View File

@ -1086,13 +1086,10 @@ endef
## Commands for filtering a target executable or library
###########################################################
# Because of bug 743462 ("Prelinked image magic gets stripped
# by arm-elf-objcopy"), we have to use soslim to strip target
# binaries.
define transform-to-stripped
@mkdir -p $(dir $@)
@echo "target Strip: $(PRIVATE_MODULE) ($@)"
$(hide) $(SOSLIM) --strip --shady --quiet $< --outfile $@
$(hide) $(TARGET_STRIP_COMMAND)
endef
define transform-to-prelinked

View File

@ -75,7 +75,7 @@ ifeq ($(LOCAL_COMPRESS_MODULE_SYMBOLS),true)
$(error Symbol compression not yet supported.)
compress_output := $(intermediates)/COMPRESSED-$(LOCAL_BUILT_MODULE_STEM)
#TODO: write the real $(SOSLIM) rule.
#TODO: write the real $(STRIPPER) rule.
#TODO: define a rule to build TARGET_SYMBOL_FILTER_FILE, and
# make it depend on ALL_ORIGINAL_DYNAMIC_BINARIES.
$(compress_output): $(compress_input) $(TARGET_SYMBOL_FILTER_FILE) | $(ACP)
@ -137,7 +137,7 @@ endif
ifeq ($(LOCAL_STRIP_MODULE),true)
# Strip the binary
$(strip_output): $(strip_input) | $(SOSLIM)
$(strip_output): $(strip_input) | $(TARGET_STRIP)
$(transform-to-stripped)
else
# Don't strip the binary, just copy it. We can't skip this step