summaryrefslogtreecommitdiffstats
path: root/core/definitions.mk
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2014-03-31 17:37:47 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-03-31 17:37:47 +0000
commit1758fe1f87b58f91db569ba3c0fa406f5f37819e (patch)
treef1f7d604f1d918d72da6e3680e178a9de1475a2f /core/definitions.mk
parentf6811abe12601c9753f329cb34da568f0072ca76 (diff)
parent30dbfa43eff071438376b5699dbe3391d08204da (diff)
downloadbuild-1758fe1f87b58f91db569ba3c0fa406f5f37819e.zip
build-1758fe1f87b58f91db569ba3c0fa406f5f37819e.tar.gz
build-1758fe1f87b58f91db569ba3c0fa406f5f37819e.tar.bz2
am 30dbfa43: am 1c380c13: Merge "Remove the unnecessary indirection of TARGET_STRIP_COMMAND"
* commit '30dbfa43eff071438376b5699dbe3391d08204da': Remove the unnecessary indirection of TARGET_STRIP_COMMAND
Diffstat (limited to 'core/definitions.mk')
-rw-r--r--core/definitions.mk11
1 files changed, 9 insertions, 2 deletions
diff --git a/core/definitions.mk b/core/definitions.mk
index fdfa1ca..e69ba40 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -1321,16 +1321,23 @@ endef
## Commands for filtering a target executable or library
###########################################################
+ifneq ($(TARGET_BUILD_VARIANT),user)
+ TARGET_STRIP_EXTRA = && $(PRIVATE_OBJCOPY) --add-gnu-debuglink=$< $@
+ TARGET_STRIP_KEEP_SYMBOLS_EXTRA = --add-gnu-debuglink=$<
+endif
+
define transform-to-stripped
@mkdir -p $(dir $@)
@echo "target Strip: $(PRIVATE_MODULE) ($@)"
-$(hide) $($(PRIVATE_2ND_ARCH_VAR_PREFIX)TARGET_STRIP_COMMAND)
+$(hide) $(PRIVATE_STRIP) --strip-all $< -o $@ $(TARGET_STRIP_EXTRA)
endef
define transform-to-stripped-keep-symbols
@mkdir -p $(dir $@)
@echo "target Strip (keep symbols): $(PRIVATE_MODULE) ($@)"
-$(hide) $($(PRIVATE_2ND_ARCH_VAR_PREFIX)TARGET_STRIP_KEEP_SYMBOLS_COMMAND)
+$(hide) $(PRIVATE_OBJCOPY) \
+ `$(PRIVATE_READELF) -S $< | awk '/.debug_/ {print "-R " $$2}' | xargs` \
+ $(TARGET_STRIP_KEEP_SYMBOLS_EXTRA) $< $@
endef