Skip to content

Commit

Permalink
add the crash dump for sbl build in intel build core
Browse files Browse the repository at this point in the history
Test Done:
1. android boot
2. crashdump function works

Tracked-On: OAM-126307
Signed-off-by: Bo He <[email protected]>
Signed-off-by: Haoyu Tang <[email protected]>
  • Loading branch information
bhe4 authored and sysopenci committed Oct 11, 2024
1 parent 55984e9 commit 43d8280
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
20 changes: 18 additions & 2 deletions core/definitions.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ IASL := $(INTEL_PATH_BUILD)/acpi-tools/linux64/bin/iasl
# Generation
KF4SBL_SYMBOLS_ZIP := $(PRODUCT_OUT)/kf4sbl_symbols.zip
FB4SBL_SYMBOLS_ZIP := $(PRODUCT_OUT)/fb4sbl_symbols.zip
CD4SBL_SYMBOLS_ZIP := $(PRODUCT_OUT)/cd4sbl_symbols.zip

# Extra host tools we need built to use our *_from_target_files
# or sign_target_files_* scripts
Expand Down Expand Up @@ -147,13 +148,24 @@ endef
define transform-o-to-sbl-executable
@echo "target SBL Executable: $(PRIVATE_MODULE) ($@)"
$(hide) mkdir -p $(dir $@)
$(hide) $(IAFW_LD) $1 \
$(hide) if [ $(findstring cd4sbl,$(PRIVATE_MODULE) ) ]; then \
$(IAFW_LD) $1 \
--defsym=CONFIG_LP_BASE_ADDRESS=$(CRASHDUMP_BASE_ADDRESS) \
--defsym=CONFIG_LP_HEAP_SIZE=$(CRASHDUMP_HEAP_SIZE) \
--defsym=CONFIG_LP_STACK_SIZE=$(CRASHDUMP_STACK_SIZE) \
--whole-archive $(call module-built-files,$(LIBPAYLOAD_CRT0)) --no-whole-archive \
$(PRIVATE_ALL_OBJECTS) --start-group $(PRIVATE_ALL_STATIC_LIBRARIES) --end-group $(IAFW_LIBCLANG) \
-Map $(@:.sbl=.map) -o $(@:.sbl=.sym.elf); \
else \
$(IAFW_LD) $1 \
--defsym=CONFIG_LP_BASE_ADDRESS=$(LIBPAYLOAD_BASE_ADDRESS) \
--defsym=CONFIG_LP_HEAP_SIZE=$(LIBPAYLOAD_HEAP_SIZE) \
--defsym=CONFIG_LP_STACK_SIZE=$(LIBPAYLOAD_STACK_SIZE) \
--whole-archive $(call module-built-files,$(LIBPAYLOAD_CRT0)) --no-whole-archive \
$(PRIVATE_ALL_OBJECTS) --start-group $(PRIVATE_ALL_STATIC_LIBRARIES) --end-group $(IAFW_LIBCLANG) \
-Map $(@:.sbl=.map) -o $(@:.sbl=.sym.elf)
-Map $(@:.sbl=.map) -o $(@:.sbl=.sym.elf); \
fi

$(hide)$(IAFW_STRIP) --strip-all $(@:.sbl=.sym.elf) -o $(@:.sbl=.elf)

$(hide) cp $(@:.sbl=.elf) $@
Expand All @@ -168,6 +180,8 @@ if [ $(findstring kf4sbl,$(PRIVATE_MODULE) ) ]; then \
cp $(SBL_DIR)/sbl_bm $(PRODUCT_OUT)/sbl_bm; \
elif [ $(findstring fb4sbl,$(PRIVATE_MODULE) ) ]; then \
cp $(SBL_DIR)/sbl_bm $(PRODUCT_OUT)/sbl_fb; \
elif [ $(findstring cd4sbl,$(PRIVATE_MODULE) ) ]; then \
cp $(SBL_DIR)/sbl_bm $(PRODUCT_OUT)/sbl_cd; \
fi


Expand All @@ -176,6 +190,8 @@ $(hide) if [ "$(PRIVATE_MODULE:debug=)" = fb4sbl-user ]; then \
zip -juy $(FB4SBL_SYMBOLS_ZIP) $@; \
elif [ "$(PRIVATE_MODULE:debug=)" = kf4sbl-user ]; then \
zip -juy $(KF4SBL_SYMBOLS_ZIP) $(@:.sbl=.map) $(@:.sbl=.sym.elf); \
elif [ "$(PRIVATE_MODULE:debug=)" = cd4sbl-user ]; then \
zip -juy $(CD4SBL_SYMBOLS_ZIP) $(@:.sbl=.map) $(@:.sbl=.sym.elf); \
fi
endef

Expand Down
4 changes: 2 additions & 2 deletions tasks/publish.mk
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ endif
# Publish kf4sbl symbols files
.PHONY: publish_kf4sbl_symbols
ifeq ($(TARGET_BUILD_VARIANT:debug=)|$(KERNELFLINGER_SUPPORT_NON_EFI_BOOT),user|true)
publish_kf4sbl_symbols: publish_mkdir_dest kf4sbl-$(TARGET_BUILD_VARIANT) fb4sbl-$(TARGET_BUILD_VARIANT)
$(hide)($(ACP) $(KF4SBL_SYMBOLS_ZIP) $(FB4SBL_SYMBOLS_ZIP) $(publish_dest))
publish_kf4sbl_symbols: publish_mkdir_dest kf4sbl-$(TARGET_BUILD_VARIANT) fb4sbl-$(TARGET_BUILD_VARIANT) cd4sbl-$(TARGET_BUILD_VARIANT)
$(hide)($(ACP) $(KF4SBL_SYMBOLS_ZIP) $(FB4SBL_SYMBOLS_ZIP) $(CD4SBL_SYMBOLS_ZIP) $(publish_dest))
else
publish_kf4sbl_symbols:
@echo "Publish kf4sbl symbols: skipped"
Expand Down

0 comments on commit 43d8280

Please sign in to comment.