Skip to content

Commit 6aa65bb

Browse files
armv7: add -funwind-tables compile option to support stacktrace
Change-Id: Icfa223397e05dcd42ea3c12275385104bf275213 Signed-off-by: Joseph Chen <[email protected]>
1 parent d0df954 commit 6aa65bb

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

arch/arm/config.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ OBJCOPYFLAGS += -j .text -j .secure_text -j .secure_data -j .rodata -j .data \
139139
-j .u_boot_list -j .rela.dyn -j .got -j .got.plt
140140
else
141141
OBJCOPYFLAGS += -j .text -j .secure_text -j .secure_data -j .rodata -j .hash \
142-
-j .data -j .got -j .got.plt -j .u_boot_list -j .rel.dyn
142+
-j .data -j .got -j .got.plt -j .u_boot_list -j .rel.dyn \
143+
-j .ARM.exidx -j .ARM.extab
143144
endif
144145

145146
# if a dtb section exists we always have to include it

arch/arm/cpu/armv7/config.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@
1111
# of our decision.
1212
PF_NO_UNALIGNED := $(call cc-option, -mno-unaligned-access,)
1313
PLATFORM_CPPFLAGS += $(PF_NO_UNALIGNED)
14+
15+
ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),)
16+
PLATFORM_CPPFLAGS += -mabi=aapcs-linux -funwind-tables
17+
endif

examples/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ ifdef FTRACE
88
subdir-ccflags-y += -finstrument-functions -DFTRACE
99
endif
1010

11+
# Here is an compile issue: "undefined reference to `__aeabi_unwind_cpp_pr0'..."
12+
# when -funwind-tables is enabled, so make it compile depends on -funwind-tables.
13+
ifeq (,$(findstring -funwind-tables,$(PLATFORM_CPPFLAGS)))
1114
subdir-y += standalone
1215
subdir-$(CONFIG_API) += api
1316
endif
17+
endif

0 commit comments

Comments
 (0)