Skip to content

Commit 076faae

Browse files
committed
qoriq: Adjust debug compile flags to workaround architecture limits
PowerPC e500v2 has a 248-byte limit on immediate offsets in load/store instructions. When compiling with -O0, GCC generates stack frames that exceed this limit (>4KB for complex functions), causing assembler errors. Switch to -O1 for qoriq debug builds to reduce stack frame size while maintaining full debug capabilities (-g3 -ggdb3 -fno-omit-frame-pointer).
1 parent 236314a commit 076faae

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

mk/spksrc.cross-env.mk

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ ENV += TC_KERNEL=$(TC_KERNEL)
7676
# -gz compresses debug sections to reduce file size (60-80% smaller)
7777
ifeq ($(strip $(GCC_DEBUG_INFO)),1)
7878
ifeq ($(strip $(GCC_DEBUG_FLAGS)),)
79-
GCC_DEBUG_FLAGS = -ggdb3 -g3 -O0
79+
ifeq ($(findstring $(ARCH), $(PPC_ARCHS)),$(ARCH))
80+
GCC_DEBUG_FLAGS = -ggdb3 -g3 -O1 -fno-omit-frame-pointer
81+
else
82+
GCC_DEBUG_FLAGS = -ggdb3 -g3 -O0
83+
endif
8084

8185
# Check compression support and add to flags
8286
GCC_SUPPORTS_GZ := $(shell echo | $(WORK_DIR)/../../../toolchain/syno-$(ARCH)-$(TCVERSION)/work/$(TC_TARGET)/bin/$(TC_PREFIX)gcc -gz -E - 2>/dev/null 1>&2 && echo yes)

mk/spksrc.cross-meson-crossfile.mk

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,9 @@ endif
3939
ifeq ($(GCC_DEBUG_INFO),1)
4040
@echo "debug = 'true'" ; \
4141
echo "b_ndebug = 'true'" ; \
42-
echo "optimization = '0'" ; \
42+
echo "optimization = '$(strip $(patsubst -O%,%,$(filter -O%,$(GCC_DEBUG_FLAGS))))'" ; \
4343
echo
4444
endif
45-
# @echo "install_rpath = [" ; \
46-
# echo $(LDFLAGS) $(ADDITIONAL_LDFLAGS) | tr ' ' '\n' | grep '^-Wl,--rpath,' | sed -e "s/^-Wl,--rpath,//" -e "s/^/\t'/" -e "s/$$/',/" ; \
47-
# echo -ne "\t]\n" ; \
48-
# echo
49-
# @echo "runtime_rpath = [" ; \
50-
# echo $(LDFLAGS) $(ADDITIONAL_LDFLAGS) | tr ' ' '\n' | grep '^-Wl,--rpath,' | sed -e "s/^-Wl,--rpath,//" -e "s/^/\t'/" -e "s/$$/',/" ; \
51-
# echo -ne "\t]\n" ; \
52-
# echo
5345
@echo "c_args = ["
5446
ifneq ($(strip $(MESON_BUILTIN_C_ARGS)),)
5547
@echo -ne "\t'$(MESON_BUILTIN_C_ARGS)',\n"

0 commit comments

Comments
 (0)