From 445beae409aa5165b0b973b913b1f2197fac6753 Mon Sep 17 00:00:00 2001 From: Steve Fung Date: Wed, 30 Aug 2017 14:58:33 -0700 Subject: [PATCH] Only generate breakpad symbols for ELF binaries When BREAKPAD_GENERATE_SYMBOLS is set to true, the build will attempt to run dump_syms for all dynamic binaries. However some build targets are now using cc_prebuilt_binary for installing python host scripts. This causes dump_syms to return an error, causing the build to fail. So check instead if the file is an ELF binary before running dump_syms. Bug: 65065674 Test: Built AT target successfully. Merged-In: Ibe7d3ebd312376600cf21efa111489451a4e7578 Change-Id: Ibe7d3ebd312376600cf21efa111489451a4e7578 (cherry picked from commit ee848655db462afe21f8327d83a5f69e3f3d6128) --- core/dynamic_binary.mk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/dynamic_binary.mk b/core/dynamic_binary.mk index 949793b634..f44b8a88f2 100644 --- a/core/dynamic_binary.mk +++ b/core/dynamic_binary.mk @@ -99,10 +99,15 @@ ifeq ($(BREAKPAD_GENERATE_SYMBOLS),true) my_breakpad_path := $(TARGET_OUT_BREAKPAD)/$(patsubst $(PRODUCT_OUT)/%,%,$(my_module_path)) breakpad_input := $(relocation_packer_output) breakpad_output := $(my_breakpad_path)/$(my_installed_module_stem).sym -$(breakpad_output) : $(breakpad_input) | $(BREAKPAD_DUMP_SYMS) +$(breakpad_output) : $(breakpad_input) | $(BREAKPAD_DUMP_SYMS) $(PRIVATE_READELF) @echo "target breakpad: $(PRIVATE_MODULE) ($@)" @mkdir -p $(dir $@) - $(hide) $(BREAKPAD_DUMP_SYMS) -c $< > $@ + $(hide) if $(PRIVATE_READELF) -S $< > /dev/null 2>&1 ; then \ + $(BREAKPAD_DUMP_SYMS) -c $< > $@ ; \ + else \ + echo "skipped for non-elf file."; \ + touch $@; \ + fi $(LOCAL_BUILT_MODULE) : $(breakpad_output) endif