OSDN Git Service

Use strip mode mini-debug-info by default except on mips.
authorYabin Cui <yabinc@google.com>
Tue, 26 Apr 2016 23:08:00 +0000 (16:08 -0700)
committerYabin Cui <yabinc@google.com>
Wed, 27 Apr 2016 00:39:59 +0000 (17:39 -0700)
Bug: 27923447
Change-Id: I818dea44f126155b4b9b3cd929823d8eda1a1174

core/dynamic_binary.mk

index f11803d..58f76b0 100644 (file)
@@ -116,8 +116,17 @@ my_strip_module := $(firstword \
   $(LOCAL_STRIP_MODULE_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) \
   $(LOCAL_STRIP_MODULE))
 ifeq ($(my_strip_module),)
+  my_strip_module := mini-debug-info
+endif
+
+ifeq ($(my_strip_module),mini-debug-info)
+# Don't use mini-debug-info on mips (both 32-bit and 64-bit). objcopy checks that all
+# SH_MIPS_DWARF sections having name prefix .debug_ or .zdebug_, so there seems no easy
+# way using objcopy to remove all debug sections except .debug_frame on mips.
+ifneq ($(filter mips mips64,$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)),)
   my_strip_module := true
 endif
+endif
 
 $(strip_output): PRIVATE_STRIP := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_STRIP)
 $(strip_output): PRIVATE_OBJCOPY := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_OBJCOPY)