armv7: add -funwind-tables compile option to support stacktrace

Change-Id: Icfa223397e05dcd42ea3c12275385104bf275213
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
This commit is contained in:
Joseph Chen 2019-02-01 15:15:30 +08:00
parent d0df954bf3
commit 6aa65bb1ee
3 changed files with 10 additions and 1 deletions

View File

@ -139,7 +139,8 @@ OBJCOPYFLAGS += -j .text -j .secure_text -j .secure_data -j .rodata -j .data \
-j .u_boot_list -j .rela.dyn -j .got -j .got.plt -j .u_boot_list -j .rela.dyn -j .got -j .got.plt
else else
OBJCOPYFLAGS += -j .text -j .secure_text -j .secure_data -j .rodata -j .hash \ OBJCOPYFLAGS += -j .text -j .secure_text -j .secure_data -j .rodata -j .hash \
-j .data -j .got -j .got.plt -j .u_boot_list -j .rel.dyn -j .data -j .got -j .got.plt -j .u_boot_list -j .rel.dyn \
-j .ARM.exidx -j .ARM.extab
endif endif
# if a dtb section exists we always have to include it # if a dtb section exists we always have to include it

View File

@ -11,3 +11,7 @@
# of our decision. # of our decision.
PF_NO_UNALIGNED := $(call cc-option, -mno-unaligned-access,) PF_NO_UNALIGNED := $(call cc-option, -mno-unaligned-access,)
PLATFORM_CPPFLAGS += $(PF_NO_UNALIGNED) PLATFORM_CPPFLAGS += $(PF_NO_UNALIGNED)
ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),)
PLATFORM_CPPFLAGS += -mabi=aapcs-linux -funwind-tables
endif

View File

@ -8,6 +8,10 @@ ifdef FTRACE
subdir-ccflags-y += -finstrument-functions -DFTRACE subdir-ccflags-y += -finstrument-functions -DFTRACE
endif endif
# Here is an compile issue: "undefined reference to `__aeabi_unwind_cpp_pr0'..."
# when -funwind-tables is enabled, so make it compile depends on -funwind-tables.
ifeq (,$(findstring -funwind-tables,$(PLATFORM_CPPFLAGS)))
subdir-y += standalone subdir-y += standalone
subdir-$(CONFIG_API) += api subdir-$(CONFIG_API) += api
endif endif
endif