Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Jan 2023 16:45:15 GMT
From:      Mitchell Horne <mhorne@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 217c99d12a74 - stable/13 - riscv: always include frame pointer
Message-ID:  <202301231645.30NGjFxQ044317@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by mhorne:

URL: https://cgit.FreeBSD.org/src/commit/?id=217c99d12a743de12dca37ff26d9ab0e8a8c3841

commit 217c99d12a743de12dca37ff26d9ab0e8a8c3841
Author:     Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2023-01-11 18:04:45 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2023-01-23 16:39:00 +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
    
    (cherry picked from commit b926b6db37f3195e83f9fd2751b7e0c6dcf8aaef)
---
 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 a4dafc22b2e4..2a2ab1d02277 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -158,7 +158,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
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202301231645.30NGjFxQ044317>