Skip to content

Commit a290f51

Browse files
RISC-V: Fix VDSO build for !MMU
We don't have a VDSO for the !MMU configurations, so don't try to build one. Fixes: fde9c59 ("riscv: explicitly use symbol offsets for VDSO") Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 803930e commit a290f51

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

arch/riscv/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,11 @@ PHONY += vdso_install
108108
vdso_install:
109109
$(Q)$(MAKE) $(build)=arch/riscv/kernel/vdso $@
110110

111+
ifeq ($(CONFIG_MMU),y)
111112
prepare: vdso_prepare
112113
vdso_prepare: prepare0
113114
$(Q)$(MAKE) $(build)=arch/riscv/kernel/vdso include/generated/vdso-offsets.h
115+
endif
114116

115117
ifneq ($(CONFIG_XIP_KERNEL),y)
116118
ifeq ($(CONFIG_RISCV_M_MODE)$(CONFIG_SOC_CANAAN),yy)

arch/riscv/include/asm/vdso.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
#ifndef _ASM_RISCV_VDSO_H
99
#define _ASM_RISCV_VDSO_H
1010

11+
12+
/*
13+
* All systems with an MMU have a VDSO, but systems without an MMU don't
14+
* support shared libraries and therefor don't have one.
15+
*/
16+
#ifdef CONFIG_MMU
17+
1118
#include <linux/types.h>
1219
#include <generated/vdso-offsets.h>
1320

@@ -19,6 +26,8 @@ struct vdso_data {
1926
#define VDSO_SYMBOL(base, name) \
2027
(void __user *)((unsigned long)(base) + __vdso_##name##_offset)
2128

29+
#endif /* CONFIG_MMU */
30+
2231
asmlinkage long sys_riscv_flush_icache(uintptr_t, uintptr_t, uintptr_t);
2332

2433
#endif /* _ASM_RISCV_VDSO_H */

0 commit comments

Comments
 (0)