git: b926b6db37f3 - main - riscv: always include frame pointer
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 12 Jan 2023 15:06:49 UTC
The branch main has been updated by mhorne:
URL: https://cgit.FreeBSD.org/src/commit/?id=b926b6db37f3195e83f9fd2751b7e0c6dcf8aaef
commit b926b6db37f3195e83f9fd2751b7e0c6dcf8aaef
Author: Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2023-01-11 18:04:45 +0000
Commit: Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2023-01-12 15:04:24 +0000
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
---
sys/conf/Makefile.riscv | 2 +-
sys/conf/kmod.mk | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/sys/conf/Makefile.riscv b/sys/conf/Makefile.riscv
index d4b1e6934ae8..35b2ca10a717 100644
--- a/sys/conf/Makefile.riscv
+++ b/sys/conf/Makefile.riscv
@@ -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
diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk
index 89da3d4fc82e..9c681bad3c80 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -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