riscv: always include frame pointer

Specifically it is missing in kernel modules, meaning a proper backtrace
can't be constructed.

Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37657
This commit is contained in:
Mitchell Horne 2023-01-11 14:04:45 -04:00
parent 8372afd096
commit b926b6db37
2 changed files with 3 additions and 2 deletions

View File

@ -37,7 +37,7 @@ INCLUDES+= -I$S/contrib/libfdt -I$S/contrib/device-tree/include
KERNEL_LMA?= 0x80200000
LDFLAGS+= --defsym='kernel_lma=${KERNEL_LMA}'
.if !empty(DDB_ENABLED)
.if !empty(DDB_ENABLED) || !empty(DTRACE_ENABLED) || !empty(HWPMC_ENABLED)
CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
.endif

View File

@ -160,7 +160,8 @@ LDFLAGS+= --build-id=sha1
.endif
CFLAGS+= ${DEBUG_FLAGS}
.if ${MACHINE_CPUARCH} == aarch64 || ${MACHINE_CPUARCH} == amd64
.if ${MACHINE_CPUARCH} == aarch64 || ${MACHINE_CPUARCH} == amd64 || \
${MACHINE_CPUARCH} == riscv
CFLAGS+= -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
.endif