From d9252e6e2dd372012aae67cd0ed64bd67bcdcf62 Mon Sep 17 00:00:00 2001 From: Han Gao Date: Mon, 12 Aug 2024 22:51:37 +0800 Subject: [PATCH] fix: riscv: mm: rv64ilp32 undefined reference to 'p4d_offset' riscv64-unknown-elf-ld: arch/riscv/mm/fault.o: in function `.L0 ': fault.c:(.text+0x326): undefined reference to `p4d_offset' riscv64-unknown-elf-ld: fault.c:(.text+0x33c): undefined reference to `pud_offset' riscv64-unknown-elf-ld: arch/riscv/mm/pageattr.o: in function `.L0 ': pageattr.c:(.text+0x3ec): undefined reference to `p4d_offset' riscv64-unknown-elf-ld: pageattr.c:(.text+0x3fe): undefined reference to `pud_offset' riscv64-unknown-elf-ld: mm/gup.o: in function `.L0 ': gup.c:(.text+0x1230): undefined reference to `p4d_offset' riscv64-unknown-elf-ld: gup.c:(.text+0x1244): undefined reference to `pud_offset' riscv64-unknown-elf-ld: gup.c:(.text+0x138c): undefined reference to `p4d_offset' riscv64-unknown-elf-ld: mm/memory.o: in function `.L11': memory.c:(.text+0x6c): undefined reference to `p4d_offset' riscv64-unknown-elf-ld: memory.c:(.text+0x76): undefined reference to `pud_offset' Signed-off-by: Han Gao Signed-off-by: Han Gao --- arch/riscv/mm/pgtable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/mm/pgtable.c b/arch/riscv/mm/pgtable.c index 57387621d880..1cab1df2cd5c 100644 --- a/arch/riscv/mm/pgtable.c +++ b/arch/riscv/mm/pgtable.c @@ -28,7 +28,7 @@ int ptep_test_and_clear_young(struct vm_area_struct *vma, } EXPORT_SYMBOL_GPL(ptep_test_and_clear_young); -#ifdef CONFIG_64BIT +#if IS_ENABLED(CONFIG_64BIT) || (IS_ENABLED(CONFIG_ARCH_RV64ILP32) && !IS_ENABLED(CONFIG_MMU_SV32)) pud_t *pud_offset(p4d_t *p4d, unsigned long address) { if (pgtable_l4_enabled)