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

Change-Id: I61137f5bb123dc5f610af9928ed3debdf85ba74d
Signed-off-by: Bruce Beare <brucex.j.beare@intel.com>
This commit is contained in:
Bruce Beare 2010-06-24 14:02:00 -07:00
parent daea3fce40
commit 45ac434151
9 changed files with 15 additions and 10 deletions

View file

@ -742,7 +742,7 @@ stnod: systemtarball-nodeps
#######
## boot tarball
define build-boottarball-target
$(hide) echo "Target boot fs tarball: $(INSTALLED_BOOTTARBALL_TARGET)
$(hide) echo "Target boot fs tarball: $(INSTALLED_BOOTTARBALL_TARGET)"
$(hide) mkdir -p $(PRODUCT_OUT)/boot
$(hide) cp -f $(INTERNAL_BOOTIMAGE_FILES) $(PRODUCT_OUT)/boot/.
$(hide) echo $(BOARD_KERNEL_CMDLINE) > $(PRODUCT_OUT)/boot/cmdline

View file

@ -29,6 +29,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_SOBEGIN := $(TARGET_OUT_STATIC_LIBRARIES)/sobegin.o
TARGET_SOEND := $(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

@ -227,7 +227,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

@ -1096,13 +1096,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

@ -70,7 +70,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)
@ -132,7 +132,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