diff --git a/sys/conf/Makefile.riscv b/sys/conf/Makefile.riscv --- a/sys/conf/Makefile.riscv +++ b/sys/conf/Makefile.riscv @@ -37,7 +37,7 @@ KERNEL_LMA?= 0x80200000 LDFLAGS+= --defsym='kernel_lma=${KERNEL_LMA}' -.if !empty(DDB_ENABLED) +.if !empty(DDB_ENABLED) || !empty(DTR_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 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -160,7 +160,8 @@ .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