0001-riscv-fix-building-external-modules.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. From 5a19c7e06236a9c55dfc001bb4d1a8f1950d23e7 Mon Sep 17 00:00:00 2001
  2. From: Andreas Schwab <schwab@suse.de>
  3. Date: Tue, 2 Nov 2021 16:51:43 +0100
  4. Subject: [PATCH] riscv: fix building external modules
  5. When building external modules, vdso_prepare should not be run. If the
  6. kernel sources are read-only, it will fail.
  7. Fixes: fde9c59aebaf ("riscv: explicitly use symbol offsets for VDSO")
  8. Signed-off-by: Andreas Schwab <schwab@suse.de>
  9. Reviewed-by: Nathan Chancellor <nathan@kernel.org>
  10. Tested-by: Nathan Chancellor <nathan@kernel.org>
  11. Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
  12. ---
  13. arch/riscv/Makefile | 2 ++
  14. 1 file changed, 2 insertions(+)
  15. diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
  16. index 5927c94302b8..8a107ed18b0d 100644
  17. --- a/arch/riscv/Makefile
  18. +++ b/arch/riscv/Makefile
  19. @@ -107,11 +107,13 @@ PHONY += vdso_install
  20. vdso_install:
  21. $(Q)$(MAKE) $(build)=arch/riscv/kernel/vdso $@
  22. +ifeq ($(KBUILD_EXTMOD),)
  23. ifeq ($(CONFIG_MMU),y)
  24. prepare: vdso_prepare
  25. vdso_prepare: prepare0
  26. $(Q)$(MAKE) $(build)=arch/riscv/kernel/vdso include/generated/vdso-offsets.h
  27. endif
  28. +endif
  29. ifneq ($(CONFIG_XIP_KERNEL),y)
  30. ifeq ($(CONFIG_RISCV_M_MODE)$(CONFIG_SOC_CANAAN),yy)
  31. --
  32. 2.41.0